feat: add destination-labeled back button to Employee OnboardingExecutionFlow#2033
Draft
aaronlee777 wants to merge 3 commits into
Draft
feat: add destination-labeled back button to Employee OnboardingExecutionFlow#2033aaronlee777 wants to merge 3 commits into
aaronlee777 wants to merge 3 commits into
Conversation
dbe0477 to
c299310
Compare
serikjensen
reviewed
Jun 8, 2026
serikjensen
left a comment
Member
There was a problem hiding this comment.
This is a good first draft! i think we may need to further consider how back navigation can exist with breadcrumbs, progress indicator. Ironing out those cases would be a good candidate for design to implement in the sandbox
For the implementation, i think this is likely one we just need to ticket for the dev team. The biggest thing i'm thinking about is how to get back navigation working when you have nested flows. Ex. payroll execution flow is embedded in payroll flow. employee onboarding flow is nested inside of company onboarding flow.
…tionFlow
Add a secondary back button above each step of the Employee onboarding
execution flow. The label names the previous step (e.g. "Basic details"
on Compensation, "Compensation" on Federal taxes) so users can orient
themselves before navigating. Includes a parent-supplied
initialBackHeader prop so the first step can expose a "Back to
employees" affordance when nested in OnboardingFlow.
Extracts createBackHeaderFactory in src/components/Flow/useFlow.ts and
documents the conventions (per-flow back event, per-flow translation
namespace, destination-labeled headers) in src/components/Flow/README.md
so the same pattern can be applied to other linear flows.
Also fixes a stale-namespace bug in FlowHeader where useTranslation(ns)
caches the namespace on first render and does not re-bind when the
namespace prop changes between steps — switched to per-call
t(key, { ns }) so multi-namespace flows resolve correctly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ionFlow steps Decomposes FlowHeaderConfig into independent back/cta/indicator axes so the progress bar coexists with the destination-labeled back button on every step (profile through employeeDocuments). Total step count adapts to onboarding status (self vs full path) and withEmployeeI9. When nested inside OnboardingFlow, the parent's "Back to employees" affordance is preserved on step 1 alongside the progress bar via a new initialBack ctx field. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c299310 to
0c05974
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a secondary back button above each step of the Employee onboarding execution flow. The label names the previous step (e.g. "Basic details" on Compensation, "Compensation" on Federal taxes) so users can orient themselves before clicking. The button is hidden on the initial profile step and on the final summary step.
When
OnboardingExecutionFlowis rendered insideOnboardingFlow(the wrapper that owns the EmployeeList), the parent supplies aninitialBackHeaderso step one shows a "Back to employees" affordance and the user can exit the sub-flow at any time.Changes
onboardingExecutionStateMachine.tsmirroring the forward graph;deductionshas a guarded fork that mirrors the self-onboarding path.componentEvents.EMPLOYEE_ONBOARDING_BACKso the back event doesn't collide withCANCELbubbling.initialBackHeaderprop onOnboardingExecutionFlow+initialHeadercontext field so the first-step header survives navigation back to it.Employee.OnboardingExecutionFlowwith flat step-label keys +useI18nregistration at the flow root.createBackHeaderFactorytosrc/components/Flow/useFlow.tsand documented the pattern insrc/components/Flow/README.mdso Company Onboarding (and any future linear flow) can adopt it cheaply.FlowHeader:useTranslation(ns)caches the namespace on first render and doesn't re-bind when the prop changes between steps. Switched touseTranslation()+ per-callt(key, { ns }).Demo
Related
Testing
npm run test -- --run src/components/Employee/OnboardingExecutionFlow src/components/Employee/OnboardingFlow src/components/Flow— 48 tests pass, including 22 new state-machine tests covering destination labels, the guardeddeductionsback fork, and theinitialHeaderpreservation across BACK.npx tsc --noEmit— clean.🤖 Generated with Claude Code