Skip to content

feat(SDK-1161): add PrintChecksForm - #2586

Merged
krisxcrash merged 10 commits into
mainfrom
kw/feat/print-checks-3-form
Aug 20, 2026
Merged

feat(SDK-1161): add PrintChecksForm#2586
krisxcrash merged 10 commits into
mainfrom
kw/feat/print-checks-3-form

Conversation

@krisxcrash

Copy link
Copy Markdown
Contributor

Summary

Third PR in the print-checks stack (see #2584 for the full split rationale, splitting up #2572). This is the core piece — the check-stock form, the generate-and-poll cycle, and the checks-download mechanism.

  • Radio choice between custom/blank check stock, with a conditional starting-check-number field for blank stock.
  • Submits via usePayrollsGeneratePrintableChecksMutation, then polls useGeneratedDocumentsGet until the document is ready or fails.
  • Download mechanism: navigates directly to the generated document's signed URL via a synthetic anchor click, rather than fetching it client-side 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 fetch() from JS is subject to CORS, which the document host doesn't allow, and fails outright (learned this the hard way against a real generated URL).
  • Defines a narrow PrintChecksFormFlowContext (just the isGenerating flag its Footer needs) instead of depending on the orchestrator's full context type, which doesn't land until PR 4 — keeps this PR buildable and testable in isolation.

Base branch note: targets kw/feat/print-checks-2-banner, stacked on PR #2585.

Stack

  1. feat(SDK-1161): add print-checks terminal screens and event vocabulary #2584 — terminal screens + events
  2. feat(SDK-1161): add PrintChecksBanner #2585 — Banner
  3. This PR — Form
  4. State machine / orchestrator (stacked on this)
  5. PayrollOverview integration (stacked on 4)

Testing

  • npm run test -- --run src/components/Payroll/PrintChecks — 21 tests pass
  • npx tsc --noEmit and npm run lint:check clean

🤖 Generated with Claude Code

krisxcrash and others added 4 commits August 18, 2026 15:11
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>
@krisxcrash
krisxcrash requested a review from a team as a code owner August 18, 2026 22:24
Comment on lines +16 to +25
(Story: React.ComponentType) => (
<Suspense fallback={<div>Loading translations...</div>}>
<I18nLoader>
<GustoTestProvider>
<Story />
</GustoTestProvider>
</I18nLoader>
</Suspense>
),
],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same feedback around stories, i think there should be an abstraction to share this stuff, i feel like it exists already?

krisxcrash and others added 4 commits August 20, 2026 14:23
…nto kw/feat/print-checks-3-form

# Conflicts:
#	.reports/embedded-react-sdk.api.md
#	docs/reference/Translations/index.md
…2-banner

# Conflicts:
#	.reports/embedded-react-sdk.api.md
#	docs/reference/Translations/index.md
#	src/i18n/types.d.ts
Base automatically changed from kw/feat/print-checks-2-banner to main August 20, 2026 21:51
@krisxcrash
krisxcrash added this pull request to the merge queue Aug 20, 2026
Merged via the queue into main with commit dc8bf99 Aug 20, 2026
36 checks passed
@krisxcrash
krisxcrash deleted the kw/feat/print-checks-3-form branch August 20, 2026 22: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.

2 participants