Skip to content

feat: extract State taxes card from DashboardFlow into standalone management block#2021

Merged
serikjensen merged 1 commit into
mainfrom
migrate-state-taxes-card-to-block
Jun 4, 2026
Merged

feat: extract State taxes card from DashboardFlow into standalone management block#2021
serikjensen merged 1 commit into
mainfrom
migrate-state-taxes-card-to-block

Conversation

@serikjensen
Copy link
Copy Markdown
Member

@serikjensen serikjensen commented Jun 4, 2026

Summary

Migrates the State taxes card off the monolithic DashboardFlow path onto the "thin workflow + standalone pieces" pattern established by PaymentMethod / WorkAddress / Paystubs. Continues the strangler-fig migration outlined in .claude/skills/migrate-dashboard-card-to-block/SKILL.md.

Four standalone partner-consumable surfaces under Employee/StateTaxes/

  • useStateTaxesSummaryBaseHookReady-shaped data hook in shared/useStateTaxesSummary/.
  • StateTaxesCard — self-fetching standalone card in management/StateTaxesCard/. Hides the Edit button when no state has any withholding questions (e.g. a no-income-tax state has nothing to edit).
  • StateTaxesEditForm — renamed from the previous management/StateTaxes.tsx, now firing scoped EMPLOYEE_MANAGEMENT_STATE_TAXES_* events. Keeps the form open with an inline success alert on save; cancel returns to the card.
  • StateTaxesrobot3-orchestrated block composing the card and edit form for partners who want a single in-place surface.

Dashboard integration

The dashboard composes the pieces (StateTaxesCard + StateTaxesEditForm) directly via its existing state machine; dashboardStateMachine and DashboardComponents are retargeted from EMPLOYEE_STATE_TAXES_EDIT (now removed) onto the new scoped events. useEmployeeTaxes is trimmed to federal-only.

Shared EmployeeStateTaxesView decoupling

Following the same pattern the in-flight Deductions migration uses for DeductionsForm: the shared view now owns a dedicated Employee.StateTaxesView namespace with its own defaults. Onboarding (StateTaxes) and management (StateTaxesEditForm) each ship a flow-local dictionary hook (useOnboardingStateTaxesViewDictionary / useManagementStateTaxesViewDictionary) that resolves the view's keys against the flow's own namespace (Employee.StateTaxes / Employee.Management.StateTaxes). Partner dictionary overrides on either flow propagate into the view without leaking across flows — and the view itself no longer needs callers to dual-load Employee.StateTaxes.

Test plan

  • npm run test -- --run — 3028 tests pass (1 expected-fail unchanged).
  • npm run lint:check — 0 errors (pre-existing warnings unchanged).
  • npm run i18n:generate — types in sync with the new Employee.StateTaxesView and Employee.Management.StateTaxes namespaces.
  • npx tsx sdk-app/scripts/analyze-component-props.ts — registry exposes EmployeeManagement.StateTaxes, EmployeeManagement.StateTaxesCard, and EmployeeManagement.StateTaxesEditForm with employeeId as the required entity.
  • Spot-check in the SDK dev app: card → Edit emits EMPLOYEE_MANAGEMENT_STATE_TAXES_EDIT_REQUESTED; Save emits EMPLOYEE_MANAGEMENT_STATE_TAXES_UPDATED and shows the inline alert; Cancel emits EMPLOYEE_MANAGEMENT_STATE_TAXES_EDIT_CANCELLED and returns to the card.
  • Spot-check the dashboard Taxes tab: clicking the card's Edit routes the dashboard chrome into the edit form; Save / Cancel return to the dashboard tab as before.
Screen.Recording.2026-06-04.at.3.55.56.PM.mov

Made with Cursor

@serikjensen serikjensen force-pushed the migrate-state-taxes-card-to-block branch from a983f6d to b14fe02 Compare June 4, 2026 22:01
@serikjensen serikjensen marked this pull request as ready for review June 4, 2026 22:04
@serikjensen serikjensen requested a review from a team as a code owner June 4, 2026 22:04
…agement block

Migrates the State taxes card off the monolithic DashboardFlow path onto the
"thin workflow + standalone pieces" pattern established by PaymentMethod /
WorkAddress. Adds four independently consumable surfaces under
Employee/StateTaxes/:

- useStateTaxesSummary — BaseHookReady-shaped data hook in shared/
- StateTaxesCard — self-fetching standalone card in management/
- StateTaxesEditForm — renamed from the previous management/StateTaxes.tsx,
  now firing scoped EMPLOYEE_MANAGEMENT_STATE_TAXES_* events
- StateTaxes — robot3-orchestrated block composing the two pieces

The dashboard composes the pieces (card + edit form) directly via its
existing state machine; dashboardStateMachine and DashboardComponents are
retargeted from EMPLOYEE_STATE_TAXES_EDIT (now removed) onto the new
scoped events. useEmployeeTaxes is trimmed to federal-only.

The shared EmployeeStateTaxesView now owns a dedicated Employee.StateTaxesView
namespace with its own defaults. Onboarding and management each ship a
flow-local dictionary hook that resolves their own namespace
(Employee.StateTaxes / Employee.Management.StateTaxes) into the view's shape,
so partner `dictionary` overrides on either flow flow into the view without
leaking across flows.

Co-authored-by: Cursor <cursoragent@cursor.com>
@serikjensen serikjensen force-pushed the migrate-state-taxes-card-to-block branch from b14fe02 to cbf5f88 Compare June 4, 2026 22:07
@serikjensen serikjensen enabled auto-merge (squash) June 4, 2026 22:10
@serikjensen serikjensen merged commit 6dd5659 into main Jun 4, 2026
31 checks passed
@serikjensen serikjensen deleted the migrate-state-taxes-card-to-block branch June 4, 2026 22:14
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.

2 participants