Skip to content

feat(invoice-schedule): add invoice items with a repeatable group-array field - #1776

Closed
gabrielseco wants to merge 2 commits into
feat/invoice-schedule-fieldsetsfrom
feat/invoice-schedule-group-array
Closed

gabrielseco wants to merge 2 commits into
feat/invoice-schedule-fieldsetsfrom
feat/invoice-schedule-group-array

Conversation

@gabrielseco

@gabrielseco gabrielseco commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Invoice items on the invoice schedule form are now a list you grow with "Add item" and shrink with each row's remove button, like on the Remote platform, instead of ten fixed fields revealed one by one.

Why

The platform lets you add as many items as you need (up to the API's ten) and remove any of them. The SDK faked this with ten slots and conditionals that revealed the next slot once the previous one was filled, so a row in the middle could not be removed. The form kit already supports repeatable groups, but the SDK had no component to render one. This adds it as a general field type, so other forms can use it too.

What changed

Toggle details
  • New group-array field type. A repeatable group of fields. The SDK keeps the rows in the form and renders each row's inputs with the existing field components. Add and remove, minItems / maxItems, an optional addFieldText and hideLabel come from the schema.
  • Customizable like the other fields. A new group-array entry in the Components map lets partners replace the layout. The default one shows a row per item with a remove button, the add button and an error line. Row errors show on the row's own inputs.
  • Invoice schedule schema. The ten item_N_description / item_N_amount slots and their reveal conditionals become one items array: at least one item, at most ten (the public API's limit, now MAX_INVOICE_ITEMS), inside the "Invoice items" group. Each item has a required description and an amount of at least 1.
  • Currency in rows. The selected currency is set on the group and handed to every row's amount, because the form kit applies computed attributes on the group but not on its items.
  • Fixes the new field type needed in shared value handling: the group-array parser still used the older fields() function form and threw on the current kit; the invisible-field filter flattened the rows into an object; per-row errors were not mapped to the row's inputs; rows were not seeded or converted from cents on the way in; blank values in a row now read as missing ("Required field").
  • Breaking change to values. The create invoice schedule step's values and initial values hold items: [{ description, amount }] instead of the item_N_* keys. Partners are not in production on this step yet.
  • Public API. Additive: GroupArrayComponentProps and GroupArrayRowProps are exported, and Components['group-array'] is new. Documented in docs/COMPONENT_CUSTOMIZATION.md. The only breaking part is the value shape above.
  • Not included: an optional "no items" choice before the list and a table layout. Both are possible later through the same field type.
  • Stacked on feat(invoice-schedule): group the onboarding step under fieldsets #1767; retarget to main once it merges.

Screenshots

Toggle screenshots

Run from the example app against the review environment (PRT contractor). The onboarding step shows the items inside the "Invoice items" group with three rows and, after "Continue", the blank third row and the other required fields reporting "Required field". The standalone flow shows the same rows without the group headings.

Open as a gallery (⌘-click or Ctrl-click for a new tab): click a screenshot, then use the arrow keys.

Onboarding items rows
Onboarding: items rows
Onboarding items errors
Onboarding: row errors
Standalone items rows
Standalone: items rows
Standalone items errors
Standalone: row errors

Related Resources

Testing

Component tests cover the new field (rows from saved values, add, remove, minimum and maximum, hidden label, group error, currency handed to rows, custom component, missing component). Value tests cover seeding rows, cents conversion per row, and blank values in a row. The resolver test covers row errors. The flow and onboarding tests now add and remove rows and check the payload, the ten-row limit and the blocked blank row.

  • Tested against the example/ app in a browser (review environment, standalone flow and onboarding step)
  • Feature flag: N/A

🤖 Generated with Claude Code


Note

Medium Risk
Touches core form value parsing, validation, and a breaking invoice-schedule value shape, though partners on that step are not in production yet.

Overview
Adds a group-array form field type so schemas can render repeatable rows with add/remove, a customizable layout via Components['group-array'], and exported GroupArrayComponentProps. The SDK wires it through React Hook Form useFieldArray, a default UI, and fixes shared handling (initial row seeding, cents conversion per row, API parsing, invisible-field filtering, and validation errors keyed as items.N.field).

Invoice schedule moves from ten progressive item_N_* slots and reveal conditionals to a single items array (1–10 rows, MAX_INVOICE_ITEMS) using inputType: 'group-array', matching platform behavior. Helpers and tests now use items: [{ description, amount }] instead of flat slot keys—a breaking change for create-schedule form values.

Docs and flow README describe the new component and API mapping; slot-reveal tests are removed in favor of group-array and flow coverage.

Reviewed by Cursor Bugbot for commit 34f4bc2. Bugbot is set up for automated code reviews on this repo. Configure here.

…ray field

BREAKING CHANGE: the create invoice schedule step now holds its items as an `items` array of { description, amount } rows instead of the `item_N_description` and `item_N_amount` keys, so step values and initial values change shape.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 233.9 kB 232.66 kB +1.25 kB (+0.5%) 🔴
Total (raw) 651.56 kB 648.29 kB +3.28 kB (+0.5%) 🔴
CSS (gzip) 21.96 kB 21.95 kB +14 B (+0.1%) 🔴
CSS (raw) 114.72 kB 114.51 kB +210 B (+0.2%) 🔴

Size Limits

  • ✅ Total gzipped: 233.9 kB / 350 kB (66.8%)
  • ✅ Total raw: 651.56 kB / 850 kB (76.7%)
  • ✅ CSS gzipped: 21.96 kB / 25 kB (87.8%)

Largest Files (Top 5)

  1. index.esm-wIkXrqU6.js - 11.4 kB (0 B (0%))
  2. styles.css - 10.98 kB (+7 B (+0.1%))
  3. index.css - 10.98 kB (+7 B (+0.1%))
  4. internals-Ml68i09E.js - 6.13 kB (new)
  5. hooks-BdD5kcoU.js - 5.77 kB (new)
View All Files (292 total)
File Size (gzip) Change
index.esm-wIkXrqU6.js 11.4 kB 0 B (0%)
styles.css 10.98 kB +7 B (+0.1%)
index.css 10.98 kB +7 B (+0.1%)
internals-Ml68i09E.js 6.13 kB new
hooks-BdD5kcoU.js 5.77 kB new
sdk.gen-BRPiw4M1.js 5.58 kB 0 B (0%)
index.js 5.54 kB +30 B (+0.5%)
flows/Onboarding/hooks.js 4.67 kB 0 B (0%)
FieldSetField-BcMqXbXX.js 4.49 kB new
utils-CBHRTwXd.js 4.36 kB new

✅ Bundle size check passed

@gabrielseco gabrielseco changed the title feat(invoice-schedule)!: add invoice items with a repeatable group-array field feat(invoice-schedule): add invoice items with a repeatable group-array field Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Deploy preview for adp-cost-calculator ready!

Project:adp-cost-calculator
Status: ✅  Deploy successful!
Preview URL:https://adp-cost-calculator-18tbiuqq0-remotecom.vercel.app
Latest Commit:34f4bc2

Deployed with vercel-action

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-2e0it05ur-remotecom.vercel.app
Latest Commit:34f4bc2

Deployed with vercel-action

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

📊 Coverage Report

✅ Coverage increased! 🎉

Metric Current Previous Change Status
Lines 89.78% 89.71% +0.07% 🟢
Statements 89.66% 89.59% +0.07% 🟢
Functions 88.72% 88.62% +0.10% 🟢
Branches 81.66% 81.51% +0.15% 🟢

Detailed Breakdown

Lines Coverage
  • Covered: 5493 / 6118
  • Coverage: 89.78%
  • Change: +0.07% (26 lines)
Statements Coverage
  • Covered: 5559 / 6200
  • Coverage: 89.66%
  • Change: +0.07% (26 statements)
Functions Coverage
  • Covered: 1463 / 1649
  • Coverage: 88.72%
  • Change: +0.10% (15 functions)
Branches Coverage
  • Covered: 3432 / 4203
  • Coverage: 81.66%
  • Change: +0.15% (47 branches)

✅ Coverage check passed

…llow

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@gabrielseco

Copy link
Copy Markdown
Collaborator Author

Closing for now: the group-array field is being added on its own in #1777, and invoice items will adopt it in a follow-up.

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