Repository navigation
fix(fields): line-item grid stores an emptied multi-record lookup cell as null, reads names once per object, mutes an empty list - #36616
Merged
objectstack-fleet[bot] merged 6 commits intoNov 23, 2026
Conversation
Claude-Session: https://claude.ai/code/session_01ADHkmNmMEXS4EzeVz9RjvD Co-authored-by: Claude <noreply@anthropic.com>
…kup cell, one name read per column, muted empty list Claude-Session: https://claude.ai/code/session_01ADHkmNmMEXS4EzeVz9RjvD Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmNmMEXS4EzeVz9RjvD Co-authored-by: Claude <noreply@anthropic.com>
…ne-item-grid-followups
…ne-item-grid-followups
…tsx; batched name rows keyed by id or _id Claude-Session: https://claude.ai/code/session_01ADHkmNmMEXS4EzeVz9RjvD Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
repo:objectstack#2 · os-steve · session_01ADHkmNmMEXS4EzeVz9RjvD 席位核对ACCEPT — one card, one PR, not governed (
Landing: area lands it (non-governed, under 3000 lines): ready + auto-merge. |
objectstack-fleet
Bot
deleted the
claude/issue-36552-line-item-grid-followups
branch
November 23, 2026 04:47
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.
Fixes #36552
Clause-②: no
Metadata-protocol: none
维护者速读
Opened for
repo:objectstack#2 · os-steve · session_01ADHkmNmMEXS4EzeVz9RjvD(area s2-A).What changes
The editable line-item grid (
@object-ui/fields,GridFieldWidget), the four items of #36552:null. The lookup cell'sonChangenow goes throughemptyListAsNull, the helper the multi-select, tags and people cells already use. Measured onorigin/mainate7399fcdbbefore the change: un-picking the last record of alookupcolumn withmultiple: truewrote[{"products":[]}].origin/mainate7399fcdb: twenty lines with ausercolumn and alookupcolumn (naming two products) made 20findOneonsys_userand 20 onproduct, 0find. Each cell is its ownLookupField, whose hydration reads its one bare id withfindOne.The grid now hands every people and lookup cell it draws (editable cell, the people cell's resting face and panel, the read-only table, list mode) a data source from the new
grid-field/lineReferenceReads.ts: the page's source, with the plain by-id read (findOne(object, id), no options) gathered per tick into onefind(object, { $filter: { id: { $in: ids } } })per object, ids de-duplicated, at most 50 ids per read (LookupField's own$inpage size). Every other member, and a by-id read carrying options, passes to the page's source unchanged (bound to it). Same grid after the change: 1$inread ofsys_user(20 ids), 1 ofproduct(2 ids), 0findOne, in editable, read-only and list mode.Why not
$expandon the child read (Prime Directive 5, SQL first): the grid does not make that read. Its rows arrive as a value: fromMasterDetailForm's andLineItemsPanel's reads of the child object (both in@object-ui/plugin-form, outside this card's file surface), or stored inline as thegridfield's JSON, where no$expandreaches the ids inside. An expanded reference in a row is also what the save diff and the blank-line check would read and send back. One$inread per object is one SQLINquery, at the one place every host's rows pass through.nullon Clear is pinned (it was right by reading).cellDisplayText'smultiselectarm loses its unreachable empty-list return (the guard at the top already answers an empty list with the em dash). In list mode the muted class readsisEmptyCell, so a stored[]draws the em dash muted, asnulland''did.Changeset:
.changeset/36552-line-item-grid-followups.md, patch for@object-ui/fields.Read first (by risk)
ui/packages/fields/src/widgets/grid-field/lineReferenceReads.ts: theProxyaround the page data source, andflush(chunking, de-duplication, rows keyed byidelse_idasLookupField's own$inread keys them,nullfor an id the read did not return, rejection fan-out).ui/packages/fields/src/widgets/grid-field/GridFieldWidget.tsx: thecellSourceline and thedataSource={cellSource}props on the five cell sites; the lookuponChangehunk.ui/packages/fields/src/widgets/GridField.test.tsx: the pins, one top-level describe at the end of the file (line-item grid follow-ups: ... (objectstack#36552)).Tests
Seven pins in one top-level describe at the end of
GridField.test.tsx(moved there from a separate file once #36607 landed, per ruling record 6583487846; names and assertions unchanged): multi-record lookup un-pick writesnull; multi-person Clear writesnull; one$inread per object and zerofindOnewith all 20 names drawn, in editable, read-only and list mode; a backend answering with_idonly still draws each name from the one read; list-mode[]multi-select and tags cells draw the muted em dash.Package runs at head fbdfc7d (after merging origin/main at ed0edb1, which brought #36607)
pnpm --filter @object-ui/fields type-check(tsc --noEmit && tsc -p tsconfig.test.json): clean.GridField.test.tsx+GridField.lookupAutofill-28245.test.tsx:Test Files 2 passed (2),Tests 140 passed (140); the seven pins alone (-t 36552):Tests 7 passed.Test Files 323 passed | 1 skipped (324),Tests 4897 passed | 7 skipped (4904).Ablation (one leg per pinned behaviour, through scripts/ablation-replace.mjs, restored and proven)
The subject is imported by relative path from source, so no
dist/is involved. Each leg: anchor x1 to x0, blob changed, run, restore with blob == HEAD andgit diff HEADempty.onChangewithoutemptyListAsNull: the multi-record lookup pin fails, 1 failed / 5 passed.onWritewithoutemptyListAsNull: the multi-person pin fails, 1 failed / 5 passed.cellSourceforced toundefined(cells read the page source directly): the three one-read pins fail, 3 failed / 3 passed.null/'': the muted pin fails, 1 failed / 5 passed.idonly:× a backend that answers with _id only, 1 failed / 6 passed.The first four legs ran while the pins were in their own file; the moved pins are byte-identical in name and assertion.
Acceptance notes
GridField.test.tsx; fix(fields): a failed first load of the line-item grid body recovers on the next mount #36607 has merged, so they now sit inGridField.test.tsxas one top-level describe (ruling record 6583487846), and the separate file is deleted.idFieldis notid(LookupFieldreads those withfindon an equality filter, notfindOne), and an id the batched read did not return (deleted or unreadable; the cell's own read gets the same answer). Out of the card's shape; noted, not changed.ui/packages/fields/README.mdorcontent/docs/frontend/describes the per-line read, the stored[]or the muted class, so none was made false; none edited.lookupcolumn withmultiple: truereadsundefinedin read-only and list mode (the two read-onlyLookupFieldsites pass nomultiple), while the editable cell reads2 selected. Reported to the seat.Verification
Two minutes: from
ui/, runpnpm --filter @object-ui/fields exec vitest run --root ../.. -t 36552 packages/fields/src/widgets/GridField.test.tsx. ExpectTests 7 passed, the rest of the file skipped.Gates:
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 38 families at 2b1bd44 and the same 38 at fbdfc7d; all 38 ran locally with exit 0 at each head (--ranreconciliation: 38 derived, 38 run, 0 NOT-MEASURED, all with exit codes). Everything else is CI's.Generated by Claude Code