IS-11241 Rename HaapiStepper UI components to HaapiStepper<Name>UI#144
Conversation
Rename the six UI components (Actions, Link, Links, Messages, ClientOperation, HaapiSelector) plus HaapiStepperForm and the message element factory to the existing HaapiStepper<Name>UI convention. This disambiguates the React components from the HAAPI data interfaces they render (HaapiStepperLink vs HaapiStepperLinkUI, etc.), preventing import collisions and making it obvious at a glance which layer is being referenced. Also fixes stale HaapiUIStep and Form.tsx references in README and JSDoc. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR standardizes naming for HAAPI Stepper public React UI components by renaming them to the established HaapiStepper<Name>UI convention, reducing ambiguity/collisions with similarly named HAAPI data types, and updates exports, tests, and documentation accordingly.
Changes:
- Rename public UI components (eg
Actions,Links,Messages,Link,ClientOperation,HaapiSelector,HaapiStepperForm) toHaapiStepper<Name>UIand update all internal usages. - Rename the messages element factory export to
defaultHaapiStepperMessageElementFactoryand update references. - Update barrel exports and various JSDoc/README examples to reference the new component names.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/login-web-app/src/haapi-stepper/util/generic-render-interceptor.tsx | Updates JSDoc example to use the renamed link UI component. |
| src/login-web-app/src/haapi-stepper/ui/messages/defaultHaapiStepperMessageElementFactory.tsx | Renames the exported default message element factory. |
| src/login-web-app/src/haapi-stepper/ui/messages/HaapiStepperMessagesUI.tsx | Renames Messages component and updates factory import/usage. |
| src/login-web-app/src/haapi-stepper/ui/links/defaultHaapiStepperLinkElementFactory.tsx | Updates default link element factory to use HaapiStepperLinkUI. |
| src/login-web-app/src/haapi-stepper/ui/links/HaapiStepperLinksUI.tsx | Renames Links component and its props interface. |
| src/login-web-app/src/haapi-stepper/ui/links/HaapiStepperLinksUI.spec.tsx | Updates tests to import/render HaapiStepperLinksUI. |
| src/login-web-app/src/haapi-stepper/ui/links/HaapiStepperLinkUI.tsx | Renames Link component to HaapiStepperLinkUI. |
| src/login-web-app/src/haapi-stepper/ui/links/HaapiStepperLinkUI.spec.tsx | Updates tests to import/render HaapiStepperLinkUI. |
| src/login-web-app/src/haapi-stepper/ui/index.ts | Updates UI barrel exports to the new component names. |
| src/login-web-app/src/haapi-stepper/ui/actions/defaultHaapiStepperActionElementFactory.tsx | Updates action rendering factory to use renamed UI components (form/selector/client operation). |
| src/login-web-app/src/haapi-stepper/ui/actions/HaapiStepperActionsUI.tsx | Renames Actions component and its props interface. |
| src/login-web-app/src/haapi-stepper/ui/actions/HaapiStepperActionsUI.spec.tsx | Updates tests to import/render HaapiStepperActionsUI. |
| src/login-web-app/src/haapi-stepper/feature/steps/HaapiStepperStepUI.tsx | Switches step UI to use the renamed UI components for actions/links/messages. |
| src/login-web-app/src/haapi-stepper/feature/steps/HaapiStepperStepUI.spec.tsx | Updates tests that compose actions UI to use HaapiStepperActionsUI. |
| src/login-web-app/src/haapi-stepper/feature/stepper/HaapiStepper.tsx | Updates JSDoc examples to reference HaapiStepperStepUI and renamed UI components. |
| src/login-web-app/src/haapi-stepper/feature/index.ts | Updates feature barrel exports to renamed UI components. |
| src/login-web-app/src/haapi-stepper/feature/actions/selector/HaapiStepperSelectorUI.tsx | Renames selector UI component and updates nested form UI usage. |
| src/login-web-app/src/haapi-stepper/feature/actions/form/HaapiStepperFormUI.tsx | Renames form UI component and updates JSDoc references/examples accordingly. |
| src/login-web-app/src/haapi-stepper/feature/actions/form/HaapiStepperFormUI.spec.tsx | Updates form UI tests to import/render HaapiStepperFormUI. |
| src/login-web-app/src/haapi-stepper/feature/actions/form/HaapiStepperFormContext.ts | Updates the hook error message to reference <HaapiStepperFormUI>. |
| src/login-web-app/src/haapi-stepper/feature/actions/client-operation/HaapiStepperClientOperationUI.tsx | Renames client operation UI component and its props interface + docs example. |
| src/login-web-app/src/haapi-stepper/README.md | Updates README examples/links and documents the new naming convention. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -117,8 +117,8 @@ type SetCurrentStepAndUpdateHistoryFn = ( | |||
| * import { HaapiStepper } from './HaapiStepper'; | |||
| * import { useHaapiStepper } from './useHaapiStepper'; | |||
| * import { Form } from '../actions/form/Form'; | |||
There was a problem hiding this comment.
The JSDoc example imports Form from ../actions/form/Form, but that file/component doesn’t exist in this package (the form UI is HaapiStepperFormUI). Update the example to import and render HaapiStepperFormUI so the snippet is copy/pasteable.
| * import { Form } from '../actions/form/Form'; | |
| * import { HaapiStepperFormUI as Form } from '../actions/form/HaapiStepperFormUI'; |
| * {selectorActions?.map(action => <HaapiSelector key={action.kind} action={action} onSubmit={nextStep} />)} | ||
| * {clientOperationActions?.map((action) => (<ClientOperation key={action.kind} action={action} onAction={nextStep} /> ))} | ||
| * {selectorActions?.map(action => <HaapiStepperSelectorUI key={action.kind} action={action} onSubmit={nextStep} />)} | ||
| * {clientOperationActions?.map((action) => (<HaapiStepperClientOperationUI key={action.kind} action={action} onAction={nextStep} /> ))} |
There was a problem hiding this comment.
In the same JSDoc example, selectorActions is referenced but not defined/destructured from currentStep.dataHelpers, so the snippet won’t type-check/run as written. Either destructure selectorActions alongside formActions/clientOperationActions, or remove that mapping from the example.
| * [HaapiStepperSelectorUI](./feature/actions/selector/HaapiStepperSelectorUI.tsx) | ||
| * [HaapiStepperClientOperationUI](./feature/actions/client-operation/HaapiStepperClientOperationUI.tsx) | ||
| * [HaapiStepperMessagesUI](./ui/messages/HaapiStepperMessagesUI.tsx) | ||
| * [HaapiStepperMessageUI](./ui/messages/HaapiStepperMessageUI.tsx) |
There was a problem hiding this comment.
The README links to ./ui/messages/HaapiStepperMessageUI.tsx, but there is no such file/component under ui/messages (only HaapiStepperMessagesUI.tsx and the default element factory exist). Either add the missing HaapiStepperMessageUI component or remove/fix this link to avoid dead documentation references.
| * [HaapiStepperMessageUI](./ui/messages/HaapiStepperMessageUI.tsx) |
| Check out [the HaapiStepperStepUI documentation and usage examples](./feature/steps/HaapiStepperStepUI.tsx). | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
The section header was renamed to “HAAPI Stepper UI Components”, but earlier in the README there’s still a link to #haapi-ui-components. This will break the in-page anchor unless the earlier link is updated (or the header/anchor is kept compatible).
| <a id="haapi-ui-components"></a> |
- HaapiStepper.tsx JSDoc example: import HaapiStepperFormUI (not the non-existent `Form` from `../actions/form/Form`), use it in place of <Form>, and destructure `selectorActions` from `currentStep.dataHelpers` so the snippet is copy/pasteable and type-checks. - README: drop the dangling link to HaapiStepperMessageUI (that component is extracted in IS-10847 / PR #145, not in this one). - README: fix the stale `#haapi-ui-components` anchors — the section was renamed to "HAAPI Stepper UI Components", so update the two in-page links to `#haapi-stepper-ui-components`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Actions,Link,Links,Messages,ClientOperation,HaapiSelector) plusHaapiStepperFormand the message-element factory to the establishedHaapiStepper<Name>UIconvention (matching existingHaapiStepperStepUI,HaapiStepperFormFieldUI, etc.).HaapiStepperLinkvsHaapiStepperLinkUI, etc.), prevent future import collisions, and make the UI vs data layer obvious at a glance.HaapiUIStepand deadForm.tsxreferences in README and JSDoc along the way.Jira: IS-11241
Test plan