feat: add OnboardingExecutionFlow and skip redundant list in EmployeeListFlow#1990
Merged
Conversation
…ListFlow Extracts the employee onboarding wizard steps (Profile → Compensation → Federal/State Taxes → Payment Method → Deductions → Documents → Summary) into a new OnboardingExecutionFlow component, mirroring the PayrollFlow / PayrollExecutionFlow composition. EmployeeListFlow now renders OnboardingExecutionFlow directly on Add, landing the user on Profile instead of a duplicate onboarding employee list. OnboardingFlow's public API is unchanged; it still presents its index list standalone and composes the new sub-flow internally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors employee onboarding flow composition to avoid showing a redundant employee list when starting onboarding from EmployeeListFlow, by extracting the wizard portion into a new OnboardingExecutionFlow (mirroring the existing Payroll “ExecutionFlow” pattern).
Changes:
- Introduces
OnboardingExecutionFlowto own the onboarding wizard state machine (Profile → … → Summary). - Updates
OnboardingFlowto a small shell that renders the list first, then delegates wizard execution toOnboardingExecutionFlow. - Updates
EmployeeListFlowto renderOnboardingExecutionFlowdirectly when adding an employee, and adds a targeted test to verify it lands on the Profile step.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/Employee/OnboardingFlow/onboardingStateMachine.ts | Simplifies OnboardingFlow to a shell that delegates wizard execution to OnboardingExecutionFlow. |
| src/components/Employee/OnboardingFlow/OnboardingFlowComponents.tsx | Adds an OnboardingExecutionFlowContextual wrapper and re-exports wizard contextual components/types. |
| src/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.ts | New wizard-focused state machine extracted from the former OnboardingFlow. |
| src/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.tsx | New shared context/types and contextual wrappers for wizard steps. |
| src/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.tsx | New Flow component that wires the execution machine and initial context. |
| src/components/Employee/OnboardingExecutionFlow/index.ts | Barrel exports for the new execution flow and its types. |
| src/components/Employee/index.ts | Re-exports OnboardingExecutionFlow from the main Employee namespace. |
| src/components/Employee/exports/employeeOnboarding.ts | Exposes OnboardingExecutionFlow via the EmployeeOnboarding journey namespace. |
| src/components/Employee/EmployeeListFlow/employeeListStateMachine.ts | Adds EMPLOYEES_LIST/CANCEL transitions to return from onboarding back to the management list. |
| src/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.tsx | Switches the onboarding sub-flow to render OnboardingExecutionFlow instead of OnboardingFlow. |
| src/components/Employee/EmployeeListFlow/EmployeeListFlow.test.tsx | New test asserting “Add employee” lands directly on the Profile step. |
| docs/reference/endpoint-reference.md | Updates flow/block reference to include OnboardingExecutionFlow in the composition graph. |
| docs/reference/endpoint-inventory.json | Updates endpoint inventory to include the new flow and adjusted compositions. |
…ompanyId - Rename OnboardingFlowContextual to OnboardingExecutionFlowContextual in EmployeeListFlowComponents.tsx so the wrapper name matches what it renders - Add ensureRequired(companyId) in EmployeeListContextual for consistency with other useFlow contextual wrappers Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tion-flow # Conflicts: # docs/reference/endpoint-reference.md
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
serikjensen
approved these changes
Jun 3, 2026
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
EmployeeListFlowcurrently shows a duplicate employee list on "Add employee" because it embeds the fullOnboardingFlow, whose initial state is itself a list view. This PR extracts the wizard portion into a newOnboardingExecutionFlowsoEmployeeListFlowlands the user directly on the Profile step, whileOnboardingFlowkeeps its standalone behavior unchanged. The composition mirrors the existingPayrollFlow/PayrollExecutionFlowpattern.Changes
OnboardingExecutionFlowcomponent owning the wizard states (Profile → Compensation → Federal/State Taxes → Payment Method → Deductions → Documents → Summary), exported via theEmployeeOnboardingjourney namespace.OnboardingFlowreduced to a 3-state shell (index→executing→final) that composes the new sub-flow internally; public API and standalone behavior preserved.EmployeeListFlow.onboardnow rendersOnboardingExecutionFlowdirectly and routesEMPLOYEES_LIST/CANCELback to the management list.Testing
npm run test -- --run— 2960 passed, 1 expected fail (pre-existing).npm run build— succeeds; endpoint inventory now reports the newOnboardingExecutionFlow(22 → 24 flows).src/components/Employee/EmployeeListFlow/EmployeeListFlow.test.tsxasserts that clicking "Add" from the management list lands on the Profile SSN field (no second list).OnboardingFlow.test.tsxhappy path still passes end-to-end through the wizard.EmployeeListFlowstory → click Add employee → confirm Profile renders; complete Summary → confirm return to the management list. Also spot-check the standaloneOnboardingFlowstory still shows its onboarding list atindex.