feat: extract HomeAddress card from DashboardFlow into standalone management block#1992
Open
serikjensen wants to merge 3 commits into
Open
feat: extract HomeAddress card from DashboardFlow into standalone management block#1992serikjensen wants to merge 3 commits into
serikjensen wants to merge 3 commits into
Conversation
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>
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
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-onlyBaseHookReady-shaped data hook (shared/useHomeAddressSummary/)HomeAddressCard— standalone, self-fetching card (management/HomeAddressCard/)HomeAddressEditForm— the renamed existing edit screen (wasHomeAddress.tsx)HomeAddress— orchestrated block composing card + edit form via a local robot3 state machineThe 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, namespacedEMPLOYEE_HOME_ADDRESS_MANAGEMENT_*:EDIT_REQUESTED{ employeeId }EDIT_CANCELLEDCREATEDEmployeeAddressUPDATEDEmployeeAddressDELETEDLegacy
EMPLOYEE_HOME_ADDRESS_CREATED/_UPDATEDare preserved for onboarding consumers.Data hook split
useEmployeeBasicDetailsno longer fetches home-address data — the card owns its own fetch viauseHomeAddressSummary. 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 inEmployee.HomeAddress.Management.jsonunderform.*. Onboarding consumers (EmployeeProfile/AdminProfile) keep reading fromEmployee.HomeAddressunchanged. Skill updated to make single-namespace the default and reserve dual-loading for runtime-shared UI.Also
HomeAddress,HomeAddressCard,HomeAddressEditFormregistered in the SDK dev app sidebar (regeneratedgenerated-registry-data.ts).homeAddress.*keys removed fromEmployee.Dashboard.json.BasicDetailsView.stories.tsxupdated to drop the removed home-address props.DashboardFlowno longer hits/v1/employees/:employeeId/home_addresses; the card does.docs/workflows-overview/employee-management/employee-management.mdwith block-level + per-piece sections.Naming notes
HomeAddressis now the orchestrated block; the previousHomeAddressedit screen was renamed toHomeAddressEditFormin the same PR (skill's naming-conflict resolution rule).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)<HomeAddress />,<HomeAddressCard />,<HomeAddressEditForm />under the Employee Management sidebar innpm run sdk-appEmployeeManagement.DashboardFlowBasic Details tab still navigates card → edit → save/cancel correctlyEmployeeProfile,AdminProfile) still render Home Address field labels correctly fromEmployee.HomeAddressScreen.Recording.2026-06-02.at.4.45.46.PM.mov
Made with Cursor