Skip to content

[WIP] refactor: integrate useSignEmployeeForm hook into Employee DocumentSigner#1555

Draft
serikjensen wants to merge 8 commits intomainfrom
sdk-774-employee-doc-signer-hook
Draft

[WIP] refactor: integrate useSignEmployeeForm hook into Employee DocumentSigner#1555
serikjensen wants to merge 8 commits intomainfrom
sdk-774-employee-doc-signer-hook

Conversation

@serikjensen
Copy link
Copy Markdown
Member

Summary

  • Adds 8 new unit tests for Employee SignatureForm covering field rendering, submission validation, successful signing events, and back navigation
  • Integrates the shared useSignEmployeeForm hook into both Employee SignatureForm (non-I9) and I9SignatureForm
  • I9SignatureForm refactored from useFieldArray with nested objects to the hook's flat preparer field structure (preparerFirstName, preparer2FirstName, etc.)
  • All existing I9 tests (6) continue to pass alongside the new SignatureForm tests (8), total 14 tests

Test plan

  • All 8 Employee SignatureForm tests pass
  • All 6 I9SignatureForm tests pass
  • Lint passes
  • Build passes (verified by pre-commit hook)

Made with Cursor

Move all hook infrastructure and domain hooks out of UNSTABLE_Hooks into
permanent locations, export from the main package entry, and remove the
UNSTABLE_Hooks entry point entirely.

- Create src/partner-hook-utils/ consolidating all partner-facing hook
  infrastructure (types, error handling, form schema, fields, providers)
- Move 7 domain hooks to feature module shared/ directories following
  the component naming RFC layout
- Export all hooks and infrastructure from @gusto/embedded-react-sdk
- Remove UNSTABLE_Hooks entry point, Vite input, and package.json export
- Remove prebuilt *Form.tsx test components and UNSTABLE.* i18n files
- Update all internal imports, documentation, and Claude commands
- Add create-hook command and rename hooks implementation guide

BREAKING CHANGE: The @gusto/embedded-react-sdk/UNSTABLE_Hooks entry
point has been removed. Import hooks from @gusto/embedded-react-sdk
instead. Prebuilt hook form components (CompensationForm, etc.) have
been removed — use the hooks directly.

Made-with: Cursor
The prebuilt hook form components were deleted, so remove the empty
Hooks.ts file and its category from the sdk-app registry.

Made-with: Cursor
These hooks are part of the employee profile domain alongside
useEmployeeDetailsForm, so colocate them under Employee/Profile/shared/.

Made-with: Cursor
…atureForm

Add 8 tests for Employee SignatureForm covering field rendering, submission
validation, successful signing events, and back navigation. Existing 6 I9
tests already cover preparer toggle, preparer validation, add/remove, and
cancel event.

Made-with: Cursor
…orm and I9SignatureForm

Replace direct API calls and local form orchestration with the shared
useSignEmployeeForm hook in both components. The hook handles I9 vs non-I9
detection, form schema creation, and preparer management. I9SignatureForm
now uses flat preparer field names from the hook instead of useFieldArray.

Made-with: Cursor
Base automatically changed from sdk-774 to main April 15, 2026 15:32
@serikjensen serikjensen changed the title refactor: integrate useSignEmployeeForm hook into Employee DocumentSigner [WIP] refactor: integrate useSignEmployeeForm hook into Employee DocumentSigner Apr 16, 2026
@serikjensen serikjensen marked this pull request as draft April 16, 2026 01:06
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