Skip to content

IS-10847 Extract HaapiStepperMessageUI component#145

Draft
aleixsuau wants to merge 1 commit intofeature/IS-11241/rename-haapistepper-ui-componentsfrom
feature/IS-10847/extract-haapistepper-message-ui
Draft

IS-10847 Extract HaapiStepperMessageUI component#145
aleixsuau wants to merge 1 commit intofeature/IS-11241/rename-haapistepper-ui-componentsfrom
feature/IS-10847/extract-haapistepper-message-ui

Conversation

@aleixsuau
Copy link
Copy Markdown

@aleixsuau aleixsuau commented Apr 22, 2026

Summary

  • Extracts the single-message rendering logic from defaultHaapiStepperMessageElementFactory into a dedicated HaapiStepperMessageUI component, mirroring the existing HaapiStepperLinkUI / defaultHaapiStepperLinkElementFactory pattern.
  • Fills a singular-component gap in the public API — previously only the plural HaapiStepperMessagesUI was exported for messages, so consumers had no direct way to render a single message.
  • Stacked on top of #144 (IS-11241). Once IS-11241 Rename HaapiStepper UI components to HaapiStepper<Name>UI #144 merges, this branch should be rebased onto integration/IS-5161/login-web-app.

Jira: IS-10847 (umbrella: Haapi Stepper UI optimizations)

Test plan

  • Runtime smoke: HaapiStepperMessageUI renders correctly for each message classList variant (heading, userCode, userName, default)

… factory.

Split the single-message rendering logic out of defaultHaapiStepperMessageElementFactory
into its own HaapiStepperMessageUI component, mirroring the Link/LinkUI pattern. This
fills the singular-component gap in the public API (previously only the plural
HaapiStepperMessagesUI was exported for messages) and lets consumers render a single
message directly without reaching through the factory.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extracts the single-message rendering logic into a dedicated HaapiStepperMessageUI component and updates the default message element factory to use it, aligning the messages API with the existing link component/factory pattern and enabling consumers to render a single message directly.

Changes:

  • Added HaapiStepperMessageUI component for rendering a single HaapiStepperUserMessage.
  • Refactored defaultHaapiStepperMessageElementFactory to delegate to HaapiStepperMessageUI.
  • Exported HaapiStepperMessageUI from the UI barrel (ui/index.ts) to make it part of the public API.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/login-web-app/src/haapi-stepper/ui/messages/defaultHaapiStepperMessageElementFactory.tsx Simplifies the default factory to render via the extracted single-message UI component.
src/login-web-app/src/haapi-stepper/ui/messages/HaapiStepperMessageUI.tsx Introduces the new public component encapsulating message classList-based rendering.
src/login-web-app/src/haapi-stepper/ui/index.ts Exports HaapiStepperMessageUI to close the single-message public API gap.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

aleixsuau added a commit that referenced this pull request Apr 22, 2026
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants