feat(SDK-1161): add PrintChecks state machine and orchestrator - #2587
Merged
Conversation
First slice of the print-checks feature (split out of #2572 for reviewability): the shared event constants and the two terminal screens of the upcoming print-checks flow, PrintChecksFailure and PrintChecksSummary. Both are standalone, presentational components that will be wired into a state-machine orchestrator in a follow-up PR stacked on this one. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Second slice of the print-checks feature stack (see #2584). A standalone banner that fetches its own payroll data via usePayrollsGet, shows an info alert when the payroll has employees paid by check, and surfaces a "View and print checks" CTA once the payroll is processed. Fires PRINT_CHECKS_START when clicked. Stacked on kw/feat/print-checks-1-terminal-screens; targets that branch, not main. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Third slice of the print-checks feature stack (see #2584). The core piece: the check-stock form, the generate-and-poll cycle against usePayrollsGeneratePrintableChecksMutation/useGeneratedDocumentsGet, and the checks-download mechanism. The download navigates directly to the generated document's signed URL via a synthetic anchor click rather than fetching it into a blob: the URL already has response-content-disposition=attachment baked into its query string, so a direct browser-level request downloads it via that response header. A client-side fetch() would be subject to CORS, which the document host doesn't allow, and fails outright. Defines a narrow PrintChecksFormFlowContext (just the isGenerating flag its Footer needs from the shared machine context) rather than depending on the orchestrator's full context type, which doesn't land until the next PR in the stack — keeps this PR buildable and testable on its own. Stacked on kw/feat/print-checks-2-banner; targets that branch, not main. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Fourth slice of the print-checks feature stack (see #2584). Wires PrintChecksBanner/Form/Failure/Summary together into the public Payroll.PrintChecks component via a robot3 state machine, following the same pattern as ConfirmWireDetails/RecoveryCases: banner -> form -> summary/failure, unmounting each screen on transition instead of manually resetting form state. No inert final() state, unlike the two reference machines that define one but never transition to it -- per src/CLAUDE.md, hub-and-spoke components (no natural "end", user can reopen the flow freely) shouldn't model completion as a final state. Exports PrintChecks from the Payroll namespace and regenerates the SDK Dev App's component-props registry so it picks up companyId/payrollId as auto-provisioned entity IDs. Stacked on kw/feat/print-checks-3-form; targets that branch, not main. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
serikjensen
approved these changes
Aug 19, 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
Fourth PR in the print-checks stack (see #2584 for the full split rationale, splitting up #2572). This is where Banner/Form/Failure/Summary (PRs #2584-#2586) become the actual public
Payroll.PrintCheckscomponent.printChecksStateMachine.tsx— arobot3machine following the same pattern asConfirmWireDetails/RecoveryCases:banner -> form -> summary/failure, unmounting each screen on transition rather than manually resetting form state.PrintChecksComponents.tsx— the sharedPrintChecksContextInterface+*Contextualwrapper components that connect each screen to the machine viaFlowContext.PrintChecks.tsx— the top-level orchestrator:BaseComponent+Root, mounts the banner unconditionally and the current screen inside aModal.final()state, unlike the two reference machines (which define one but never transition to it) — persrc/CLAUDE.md, hub-and-spoke components with no natural "end" shouldn't model completion as a final state.PrintChecksfrom thePayrollnamespace and regenerates the SDK Dev App's component-props registry socompanyId/payrollIdare picked up as auto-provisioned entity IDs.Base branch note: targets
kw/feat/print-checks-3-form, stacked on PR #2586.Stack
Testing
npm run test -- --run src/components/Payroll/PrintChecks— 24 tests pass (includes a new integration test exercising the full banner → form → summary/failure flow)npx tsc --noEmitandnpm run lint:checkclean🤖 Generated with Claude Code