Skip to content

feat: extract HomeAddress card from DashboardFlow into standalone management block#1992

Open
serikjensen wants to merge 3 commits into
mainfrom
migrate-home-address-card-to-block
Open

feat: extract HomeAddress card from DashboardFlow into standalone management block#1992
serikjensen wants to merge 3 commits into
mainfrom
migrate-home-address-card-to-block

Conversation

@serikjensen
Copy link
Copy Markdown
Member

@serikjensen serikjensen commented Jun 2, 2026

Summary

Pulls the Home Address card out of the monolithic dashboard into four independently consumable pieces under Employee/HomeAddress/, following the canonical PaymentMethod template and the migrate-dashboard-card-to-block skill:

  • useHomeAddressSummary — read-only BaseHookReady-shaped data hook (shared/useHomeAddressSummary/)
  • HomeAddressCard — standalone, self-fetching card (management/HomeAddressCard/)
  • HomeAddressEditForm — the renamed existing edit screen (was HomeAddress.tsx)
  • HomeAddress — orchestrated block composing card + edit form via a local robot3 state machine

The dashboard composes the new card + edit form pieces (not the block) and routes its existing card↔edit transitions through the new scoped events. Every untouched card still goes through the legacy path; the two patterns coexist intentionally.

Scoped events

Added under componentEvents, namespaced EMPLOYEE_HOME_ADDRESS_MANAGEMENT_*:

Event When Payload
EDIT_REQUESTED Card's Manage button { employeeId }
EDIT_CANCELLED Edit form Back/Cancel
CREATED New address saved EmployeeAddress
UPDATED Existing address saved EmployeeAddress
DELETED Address deleted

Legacy EMPLOYEE_HOME_ADDRESS_CREATED / _UPDATED are preserved for onboarding consumers.

Data hook split

useEmployeeBasicDetails no longer fetches home-address data — the card owns its own fetch via useHomeAddressSummary. The bundled hook now only carries work-address data, queued for the WorkAddress migration to retire entirely.

Translation decoupling

The management edit form no longer dual-loads Employee.HomeAddress. Field labels, validation messages, courtesy-withholding copy, and the no-current-address placeholder are now in Employee.HomeAddress.Management.json under form.*. Onboarding consumers (EmployeeProfile/AdminProfile) keep reading from Employee.HomeAddress unchanged. Skill updated to make single-namespace the default and reserve dual-loading for runtime-shared UI.

Also

  • HomeAddress, HomeAddressCard, HomeAddressEditForm registered in the SDK dev app sidebar (regenerated generated-registry-data.ts).
  • homeAddress.* keys removed from Employee.Dashboard.json.
  • BasicDetailsView.stories.tsx updated to drop the removed home-address props.
  • Endpoint inventory regenerated — DashboardFlow no longer hits /v1/employees/:employeeId/home_addresses; the card does.
  • Docs entry added at docs/workflows-overview/employee-management/employee-management.md with block-level + per-piece sections.

Naming notes

  • HomeAddress is now the orchestrated block; the previous HomeAddress edit screen was renamed to HomeAddressEditForm in the same PR (skill's naming-conflict resolution rule).
  • The dashboard's "Home address" surface label is unchanged — only the code-side identity moved.

Test plan

  • npm run test -- --run (234 files / 2976 tests passing locally)
  • npm run lint:check (0 errors, 26 pre-existing warnings)
  • npx tsc --noEmit (clean)
  • Spot-check <HomeAddress />, <HomeAddressCard />, <HomeAddressEditForm /> under the Employee Management sidebar in npm run sdk-app
  • Spot-check EmployeeManagement.DashboardFlow Basic Details tab still navigates card → edit → save/cancel correctly
  • Confirm onboarding flows (EmployeeProfile, AdminProfile) still render Home Address field labels correctly from Employee.HomeAddress
Screen.Recording.2026-06-02.at.4.45.46.PM.mov

Made with Cursor

serikjensen and others added 3 commits June 2, 2026 16:37
Adds the partner-facing entry for the newly migrated HomeAddress
block, mirroring the Profile section: a block-level overview with
props/events, plus a "compose from card + edit form directly"
subsection covering HomeAddressCard and HomeAddressEditForm.

Co-authored-by: Cursor <cursoragent@cursor.com>
…agement block

Pulls the Home Address card out of the monolithic dashboard into four
independently consumable pieces under `Employee/HomeAddress/`:

- `useHomeAddressSummary` — read-only `BaseHookReady`-shaped data hook
  (`shared/useHomeAddressSummary/`)
- `HomeAddressCard` — standalone, self-fetching card
  (`management/HomeAddressCard/`)
- `HomeAddressEditForm` — the renamed existing edit screen (was
  `HomeAddress.tsx`)
- `HomeAddress` — orchestrated block composing card + edit form via a
  local robot3 state machine

Adds scoped `EMPLOYEE_HOME_ADDRESS_MANAGEMENT_*` events
(`EDIT_REQUESTED`, `EDIT_CANCELLED`, `CREATED`, `UPDATED`, `DELETED`).
The dashboard composes the new card + edit form pieces (not the block)
and routes its existing card↔edit transitions through the scoped
events. Legacy onboarding `EMPLOYEE_HOME_ADDRESS_CREATED`/`UPDATED`
constants are preserved for non-management consumers.

Splits the bundled `useEmployeeBasicDetails` so it no longer fetches
home-address data — the card owns its own fetch via the new hook. The
hook now only carries work-address data, queued for the WorkAddress
migration to retire entirely.

Decouples the management edit form's translations from
`Employee.HomeAddress`: relocates the field labels, validation
messages, courtesy-withholding copy, and no-current-address
placeholder into `Employee.HomeAddress.Management.json` under
`form.*`, and switches `HomeAddressView` to read everything from the
management namespace. Onboarding consumers keep reading from
`Employee.HomeAddress` unchanged.

Other changes:
- Registers `HomeAddress`, `HomeAddressCard`, `HomeAddressEditForm` in
  the SDK dev app registry
- Drops `homeAddress.*` keys from `Employee.Dashboard.json` (moved
  into the block's namespace under `card.*`)
- Updates `BasicDetailsView.stories.tsx` to drop the removed
  home-address props
- Regenerates the endpoint inventory (the dashboard no longer hits
  `/v1/employees/:employeeId/home_addresses`; the card does)

Co-authored-by: Cursor <cursoragent@cursor.com>
…out of git

- Clarifies the "multiple namespaces" guidance in
  migrate-dashboard-card-to-block: the default is to load only the
  block's own namespace. Dual-loading the feature's base namespace is
  only justified when a runtime-shared piece of UI inside the
  management path itself calls `useTranslation` on the base namespace
  — sharing a form hook that emits field components is not enough,
  because callers always pass `label`/`validationMessages` props from
  whatever namespace they like. Cites HomeAddress as the worked
  example.
- Adds an explicit "Workspace ownership" section to the
  dashboard-block-documenter and sdk-hook-documenter agents
  forbidding `git` operations (stage/commit/push/amend). The parent
  agent owns the workspace; documenters write files and return.

Co-authored-by: Cursor <cursoragent@cursor.com>
@serikjensen serikjensen requested a review from a team as a code owner June 2, 2026 22:38
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