fix(plugin-grid): schema-aware multi-value semantics for bulk-edit params#2206
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Contributor
Author
|
The Test failure here is a pre-existing |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…rams BulkActionDialog was schema-blind: single/multi control shape and patch shape depended solely on the hand-written BulkActionParam.multiple flag. A view author targeting a multi-value field (multiselect / tags / checkboxes, or select / lookup / user / file / image with multiple:true) who omitted the flag got a single-select control and a SCALAR patch, silently corrupting the column shape server-side. Fix: - ObjectGrid passes objectSchema.fields into BulkActionDialog and useBulkExecutor. - Explicit param.multiple (boolean) still wins; otherwise `update` params derive multi-ness from the field definition via the new isMultiValueField helper (same semantics as framework #2552). - useBulkExecutor shape-normalizes every outgoing patch (run + retry): a lone scalar aimed at a multi-value field is wrapped into a single-element array via normalizeMultiValuePatch. Verified end-to-end against a live stack: a param omitting `multiple` that targets a multiselect field now renders the multi-select control and persists an array (["frontend","design"]) instead of a scalar. Closes #2204 Co-Authored-By: Claude <noreply@anthropic.com>
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.
Closes #2204
Problem
BulkActionDialog was schema-blind: whether a bulk-edit param rendered a single- or multi-select — and whether the patch shipped a scalar or an array — depended solely on the hand-written
BulkActionParam.multipleflag. A view author targeting a multi-value field (multiselect,tags,checkboxes, orselect/lookup/user/file/imagewithmultiple: true) who forgot the flag got:{labels: "frontend"}) written to an array-shaped column — silently corrupting data server-side.Fix
objectSchema.fields(already held in state from server meta) intoBulkActionDialog→useBulkExecutor.param.multiple(boolean) still wins; otherwiseupdateparams derive multi-ness from the target field definition via the newisMultiValueFieldhelper — same semantics as the server-side guard in framework fix(spec-bridge/form): stop dropping spec FormViewSchema keys; normalize legacy groups → sections (#2545) #2552 (always-multi:multiselect/checkboxes/tags; multi-capable withmultiple: true:select/radio/lookup/user/file/image).runandretry) withnormalizeMultiValuePatch: a lone scalar aimed at a multi-value field is wrapped into a single-element array (copy-on-write, arrays/null pass through, no-op without a schema).Testing
packages/plugin-gridvitest: 181/181 pass including the newbulkActionSchemaMultiple.test.tsx(helper unit tests; schema-fallback renders multi-select + array patch; single-value non-regression; explicitmultiple: falsewins the UI but the executor still ships an array; scalardef.patchnormalization; retry re-sends the normalized patch).turbo run build --filter=@object-ui/plugin-grid(incl. dts): 12/12 tasks pass.multiplebut targets amultiselectfield now renders the multi-select control (badges + searchable checklist), and the record persists["frontend","design"](verified via REST API) instead of a scalar.Server-side counterpart: objectstack-ai/objectstack#2553 (defense-in-depth — engine wraps stray scalars on write).
🤖 Generated with Claude Code