Repository navigation
feat(invoice-schedule): add invoice items with a repeatable group-array field - #1776
Closed
gabrielseco wants to merge 2 commits into
Closed
gabrielseco wants to merge 2 commits into
gabrielseco wants to merge 2 commits into
Conversation
…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>
Contributor
📦 Bundle Size Report
Size Limits
Largest Files (Top 5)
View All Files (292 total)
✅ Bundle size check passed |
Contributor
|
Deploy preview for adp-cost-calculator ready!
Deployed with vercel-action |
Contributor
|
Deploy preview for remote-flows ready!
Deployed with vercel-action |
Contributor
📊 Coverage Report✅ Coverage increased! 🎉
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
…llow Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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. |
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
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
group-arrayfield 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 optionaladdFieldTextandhideLabelcome from the schema.group-arrayentry in theComponentsmap 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.item_N_description/item_N_amountslots and their reveal conditionals become oneitemsarray: at least one item, at most ten (the public API's limit, nowMAX_INVOICE_ITEMS), inside the "Invoice items" group. Each item has a required description and an amount of at least 1.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").items: [{ description, amount }]instead of theitem_N_*keys. Partners are not in production on this step yet.GroupArrayComponentPropsandGroupArrayRowPropsare exported, andComponents['group-array']is new. Documented indocs/COMPONENT_CUSTOMIZATION.md. The only breaking part is the value shape above.mainonce 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: row errors
Standalone: items rows
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.
example/app in a browser (review environment, standalone flow and onboarding step)🤖 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-arrayform field type so schemas can render repeatable rows with add/remove, a customizable layout viaComponents['group-array'], and exportedGroupArrayComponentProps. The SDK wires it through React Hook FormuseFieldArray, a default UI, and fixes shared handling (initial row seeding, cents conversion per row, API parsing, invisible-field filtering, and validation errors keyed asitems.N.field).Invoice schedule moves from ten progressive
item_N_*slots and reveal conditionals to a singleitemsarray (1–10 rows,MAX_INVOICE_ITEMS) usinginputType: 'group-array', matching platform behavior. Helpers and tests now useitems: [{ 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.