Skip to content

IS-11561 Align BankID progress bar and add time-left readout (HAAPI React App) - #260

Merged
aleixsuau merged 7 commits into
devfrom
fix/dev/IS-11561-bankid-progress-bar
Jul 21, 2026
Merged

IS-11561 Align BankID progress bar and add time-left readout (HAAPI React App)#260
aleixsuau merged 7 commits into
devfrom
fix/dev/IS-11561-bankid-progress-bar

Conversation

@aleixsuau

@aleixsuau aleixsuau commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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.

… time-left readout

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 HaapiStepperBankIdPollingProgressUI to 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 HaapiStepperClientOperationUI and 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 vahag-curity left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Noticed that the spacing between the collapsible panels is a bit too big.
imagem

@luisgoncalves luisgoncalves left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread src/haapi-react-sdk/haapi-stepper/feature/viewnames/BankIdViewNameBuiltInUI.tsx Outdated
aleixsuau and others added 6 commits July 21, 2026 10:33
…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>
@aleixsuau

Copy link
Copy Markdown
Contributor Author

Noticed that the spacing between the collapsible panels is a bit too big. imagem

@urre ☝️ 🙏

@aleixsuau
aleixsuau merged commit cfba83c into dev Jul 21, 2026
4 checks passed
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