IS-11561 Align BankID progress bar and add time-left readout (HAAPI React App) - #260
Conversation
… time-left readout Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors the BankID polling “authentication time” indicator so it’s driven directly by polling-step properties, rendered in a BankID-scoped component placed under the QR code, and augmented with a localized numeric time-left readout.
Changes:
- Adds
HaapiStepperBankIdPollingProgressUIto render a BankID polling countdown bar + optional localized “N minutes/seconds left” readout. - Integrates the new progress UI into the BankID built-in view layout and adds targeted component + integration tests.
- Removes the old polling-progress rendering from
HaapiStepperClientOperationUIand updates CSS/README accordingly.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/haapi-react-sdk/haapi-stepper/util/tests/mocks.ts | Extends polling-step mocks to include maxWaitTime, maxWaitRemainingTime, and metadata.viewData.messages. |
| src/haapi-react-sdk/haapi-stepper/README.md | Updates documented CSS classes to reflect the new BankID polling progress UI classes. |
| src/haapi-react-sdk/haapi-stepper/feature/viewnames/HaapiStepperBankIdPollingProgressUI.tsx | New BankID-scoped polling progress component with local countdown + optional readout. |
| src/haapi-react-sdk/haapi-stepper/feature/viewnames/HaapiStepperBankIdPollingProgressUI.spec.tsx | Unit tests for countdown behavior, label selection, and rendering conditions. |
| src/haapi-react-sdk/haapi-stepper/feature/viewnames/BankIdViewNameBuiltInUI.tsx | Renders the new progress UI in the BankID built-in view between QR and actions. |
| src/haapi-react-sdk/haapi-stepper/feature/steps/HaapiStepperStepUI.spec.tsx | Adds integration-style assertions for placement and rendering across different BankID modes. |
| src/haapi-react-sdk/haapi-stepper/feature/stepper/haapi-stepper.types.ts | Removes polling time fields from the client-operation action typing. |
| src/haapi-react-sdk/haapi-stepper/feature/stepper/data-formatters/format-next-step-data.ts | Removes logic that copied polling timing fields onto client-operation actions. |
| src/haapi-react-sdk/haapi-stepper/feature/index.ts | Exports the new HaapiStepperBankIdPollingProgressUI. |
| src/haapi-react-sdk/haapi-stepper/feature/actions/client-operation/HaapiStepperClientOperationUI.tsx | Removes embedded BankID polling progress UI and associated prop. |
| src/haapi-react-sdk/haapi-stepper/feature/actions/client-operation/HaapiStepperClientOperationUI.spec.tsx | Removes tests tied to the old client-operation-based polling progress rendering. |
| src/haapi-react-app/src/shared/util/css/styles.css | Adds styling for the new progress bar + duration readout classes and removes the old class. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vahag-curity
left a comment
There was a problem hiding this comment.
Forward-looking note for IS-11096 (session extend) — nothing to change in this PR.
HaapiStepperBankIdPollingProgressUI seeds remaining once and deliberately ignores every later server value (no effect syncs maxWaitRemainingTime back into state). The doc-comment's rationale — the server value "can only arrive later/higher … push the bar backwards" — holds for the normal poll cadence, but the Velocity reference's extend button (index.vm:60, owned by IS-11096) legitimately raises the remaining time.
I traced the render path to be sure the local countdown is otherwise sound: HaapiStepper never nulls currentStep between polls, and HaapiStepperStepUI renders BankIdViewNameBuiltInUI at a stable position with no key, so React keeps this component instance mounted across polls (that's exactly why "seed once, count locally" works). The flip side: if extend lands as a link-navigation that returns another PENDING BankID polling step, this countdown will ignore the extension and keep draining to 0. Worth verifying when IS-11096 wires up extend — a remount/key, or re-syncing when the server value increases, would cover it.
luisgoncalves
left a comment
There was a problem hiding this comment.
I'm approving, given that the ":" label is fixed. I also think it would be good to avoid the setInterval, but I may have missed something.
…time Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ocity reference Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…Velocity reference Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ing with nothing to count Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@urre ☝️ 🙏 |


Jira: https://curity.atlassian.net/browse/IS-11561
Extracts the BankID polling "authentication time" progress bar out of the client-operation action into a dedicated, BankID-scoped component, repositions it under the QR code to match the Velocity reference, and adds a localized numeric time-left readout.