Skip to content

feat: add non-linear navigation to Wizard#4814

Draft
ernst-dev wants to merge 2 commits into
mainfrom
feat/wizard-non-linear-nav
Draft

feat: add non-linear navigation to Wizard#4814
ernst-dev wants to merge 2 commits into
mainfrom
feat/wizard-non-linear-nav

Conversation

@ernst-dev

Copy link
Copy Markdown
Member

Description

Adds an opt-in, backward-compatible allowNonLinearNavigation boolean prop to Wizard. When set to true, users can jump directly to any step ahead of the current one from the navigation pane, rather than only to previously-visited steps or optional steps skippable via allowSkipTo. This enables a non-linear navigation model where every step is directly reachable.

Implementation reuses the Wizard's existing step-status/event machinery — no new event reason or breaking change:

  • A forward, not-yet-visited step now resolves to the existing Next status when allowNonLinearNavigation is on, so it renders as a focusable, non-aria-disabled navigation link.
  • Navigating to such a step fires onNavigate with reason: 'skip' (already documented as navigating to a previously-unvisited step); visited steps continue to fire reason: 'step'.
  • Forward navigation remains disabled while isLoadingNextStep is true.
  • Fully backward compatible — defaults to false; allowSkipTo (the in-form skip-to button) is independent and can be combined.

Threaded through internal.tsxwizard-navigation / wizard-step-navigation-expandablewizard-step-list (getStepStatus), covering both visual-refresh and classic navigation panes plus the small-container expandable pane.

Related links, issue #, if available: Internal SIM AWSUI-61922.

⚠️ Ticket-mismatch note: SIM AWSUI-61922 currently resolves to an unrelated ticket (P416484847 — an "AWS-UI-Highcharts" bindle permission question). No Wizard navigation spec was available on the ticket, so this change was implemented per the provided feature description. Please confirm the intended scope.

How has this been tested?

  • Added a dedicated Non-linear navigation unit-test suite in src/wizard/__tests__/wizard.test.tsx covering: all forward steps enabled when the prop is set, backward-compatibility (forward required steps stay disabled by default), reason: 'skip' on forward jumps to unvisited steps, reason: 'step' on navigating back to visited steps, and forward steps remaining disabled during isLoadingNextStep.
  • Full Wizard unit suite green: 93/93 tests pass (jest -c jest.unit.config.js src/wizard/__tests__/).
  • eslint clean on src/wizard and pages/wizard; quick-build (TypeScript) clean.
  • Added dev page pages/wizard/non-linear-navigation.page.tsx for manual/visual verification, including keyboard navigation.
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates. — Prop documented via JSDoc in interfaces.ts.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md. — Yes, opt-in, defaults to false.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md. — Yes.
  • Changes were manually tested for accessibility, see accessibility guidelines. — Reuses existing focusable/aria-current/aria-disabled navigation-link semantics.

Security

Testing

  • Changes are covered with new/existing unit tests? — Yes (5 new unit tests).
  • Changes are covered with new/existing integration tests? — Existing integration coverage unaffected; behavior validated via unit tests + dev page.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.61%. Comparing base (f97729a) to head (dfddcb5).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4814   +/-   ##
=======================================
  Coverage   97.61%   97.61%           
=======================================
  Files         952      952           
  Lines       30816    30819    +3     
  Branches    11318    11321    +3     
=======================================
+ Hits        30081    30084    +3     
  Misses        688      688           
  Partials       47       47           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant