IS-11768 HAAPI React App: move step symbols to the SDK/library layer - #305
Conversation
There was a problem hiding this comment.
Pull request overview
This PR centralizes HAAPI “step symbol” resolution and rendering in the haapi-react-sdk stepper package (instead of the HAAPI React App), and updates the server/bootstrap theme contract accordingly (theme.stepSymbols).
Changes:
- Rename bootstrap theme config from
theme.pageSymbolstotheme.stepSymbolsand update server template + previewer mock config. - Add SDK-level
StepSymbolcomponent andresolveStepSymbolutility (with tests), and render it fromHaapiStepperStepUI/ viewName built-in UIs. - Remove HAAPI React App’s page-symbol utilities/components/tests and update CSS selectors to the new SDK class names.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/identity-server/templates/core/fragments/api-driven-ui/theme.vm | Renames server-emitted theme config key to stepSymbols. |
| src/haapi-react-sdk/haapi-stepper/util/tests/mocks.ts | Adds default theme.stepSymbols in stepper API test mocks. |
| src/haapi-react-sdk/haapi-stepper/ui/symbols/StepSymbol.tsx | New SDK component to render a resolved step symbol. |
| src/haapi-react-sdk/haapi-stepper/ui/symbols/StepSymbol.spec.tsx | Unit tests for StepSymbol behavior and resolution precedence. |
| src/haapi-react-sdk/haapi-stepper/ui/symbols/step-symbol-utils.ts | New SDK utility for resolving symbol path from viewName + config. |
| src/haapi-react-sdk/haapi-stepper/ui/index.ts | Exposes StepSymbol via the UI public barrel. |
| src/haapi-react-sdk/haapi-stepper/README.md | Documents new CSS hooks for step symbol styling. |
| src/haapi-react-sdk/haapi-stepper/feature/viewnames/UserConsentViewNameBuiltInUI.tsx | Clarifies behavior to omit the step symbol for user consent built-in UI. |
| src/haapi-react-sdk/haapi-stepper/feature/viewnames/typings.ts | Adds symbolElement to built-in UI props contract. |
| src/haapi-react-sdk/haapi-stepper/feature/viewnames/BankIdViewNameBuiltInUI.tsx | Renders the injected symbolElement for BankID built-in UI. |
| src/haapi-react-sdk/haapi-stepper/feature/steps/step-element-factories.tsx | Introduces getSymbolElement() factory for step symbol rendering. |
| src/haapi-react-sdk/haapi-stepper/feature/steps/HaapiStepperStepUI.tsx | Wires symbol element into default rendering and built-in UI prop injection. |
| src/haapi-react-sdk/haapi-stepper/feature/steps/HaapiStepperStepUI.spec.tsx | Adds coverage for default symbol rendering and consent omission behavior. |
| src/haapi-react-sdk/haapi-stepper/feature/stepper/haapi-stepper.types.ts | Renames pageSymbols to stepSymbols in the bootstrap theme types. |
| src/haapi-react-app/src/shared/util/page-symbol-utils.ts | Removes app-local symbol resolution utilities (moved to SDK). |
| src/haapi-react-app/src/shared/util/css/styles.css | Renames CSS selectors from page-symbol to step-symbol. |
| src/haapi-react-app/src/shared/ui/PageSymbol/PageSymbol.tsx | Removes app-local PageSymbol component (replaced by SDK rendering). |
| src/haapi-react-app/src/shared/ui/PageSymbol/PageSymbol.spec.tsx | Removes tests for the deleted PageSymbol component. |
| src/haapi-react-app/src/shared/ui/Layout/Layout.tsx | Stops rendering a page symbol in the app layout. |
| src/haapi-react-app/src/shared/ui/Layout/Layout.spec.tsx | Updates layout tests after removing page-symbol concerns and stepper context. |
| src/haapi-react-app/previewer/shared/ui/preview/Preview.tsx | Removes page-symbol rendering from preview; relies on stepper UI. |
| src/haapi-react-app/previewer/Previewer.tsx | Updates previewer mock bootstrap config to use theme.stepSymbols. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
I like this overall. Good to move from the app layer to the SDK layer. Rename from "page" to "step" also makes sense here. I guess if you would have a "real page" somewhere in the app you could still use a StepSymbol? But in that case you possible want to use some other graphic or symbol |
PageSymbolfrom the app layer tohaapi-react-sdk/haapi-stepper/ui/symbols/asStepSymbol, withresolveStepSymbolalongside it.symbolElementstep slot inHaapiStepperStepUI; BankID's built-in UI renders it, user consent omits it.showPageSymboluser-consent special case — the built-in simply doesn't compose the slot.theme.pageSymbols->theme.stepSymbolsand the CSS classes to.haapi-stepper-step-symbol{,-image}.I didnt add an interceptor for symbols to keep it simpler and because it's possible to control the bootstrap data from the server templates. We can consider that later, if needed.