Skip to content

Line-item grid follow-ups: an emptied lookup cell writes an empty list, people names read one by one, and two display leftovers #36552

Closed

Description

@objectstack-fleet

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Follow-up from #36043 (PR #36392, merged 2026-11-22: multi-select, tags and people cells in an editable line-item grid). Found by the L2 records 7083478985 and 7085364786 on PR #36392 (N3, N4, N5, and a note on lookup cells), all graded non-blocking. Filed by the seat, not claimed. Parent: #36043.

What happens

  1. An emptied multi-record lookup cell writes [], not null. Since feat: line-item table cells for people, multi-select, tags, check and rating (#36043) #36392, an emptied multi-select, tags or people cell writes null, which the field contract asks for (a cleared multi-value field stores null). A multi-record lookup cell still writes [], as on main. Readers take both alike, but the grid's blank-row counting and stored values differ by cell type.
  2. Each people cell holding a bare id reads its name with its own findOne on sys_user (N3). A grid of 20 lines with a people column makes 20 reads to draw names. Lookup cells do the same on main.
  3. The multi-person cell's null on empty is not pinned (N4). It is right by reading (it uses the same emptyListAsNull helper as the two pinned cells), but no test would catch it drifting.
  4. Two display leftovers (N5). In cellDisplayText the multiselect arm's own empty-list return can no longer be reached. In list mode, a stored [] draws the em dash without the muted colour, because that class tests null and '' only.

To do

  1. Route the multi-record lookup cell's write through emptyListAsNull, with a pin.
  2. Expand the person (and lookup) names on the child read, or batch them into one read per column, so a grid draws names with one request. SQL first (AGENTS.md, Prime Directive 5).
  3. Add a user column with multiple case in GridField.test.tsx: Clear, expect null.
  4. Remove the dead return, and let the muted class take an empty list too.

Done when

Every emptied multi-value cell in the line-item grid writes null; a grid with a people column draws its names with one read per column, not one per line; and each of these is pinned.

Grade

p3 · area:ux · domain:ui.


Generated by Claude Code

Activity

  1. added
    enhancement
    domain:ui
    on Nov 22, 2026
  2. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:ui (editable line-item grid) · pm:queue; rationale: area:ux · Bug · follow-ups of #36043 / PR #36392: an emptied multi-record lookup cell writes [] instead of null, people names are announced one by one, and two display leftovers. UX has no p3 → p2 (was p3) · size S.

  3. added
    pm:queue
    priority:p2
    and removed on Nov 22, 2026
  4. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmNmMEXS4EzeVz9RjvD

    Claim: PM loop · 2026-11-23T02:37Z · area s2-A (record page and its fields) of seat repo:objectstack#2; seat order of 2026-11-22T22:29Z after the maintainer's 「派」 for area:ux p2 cards with no topic parent, and the seat's refill of 2026-11-23T02:36Z under the total-of-10 cap
    Area: s2-A
    Session: session_01ADHkmNmMEXS4EzeVz9RjvD
    Account: os-steve
    Branch: claude/issue-36552-line-item-grid-followups
    Worktree: objectstack-issue-36552
    Domain: domain:ui
    Seat: repo:objectstack#2
    File surface: the editable line-item grid's body: ui/packages/fields/src/widgets/grid-field/GridFieldWidget.tsx (the multi-record lookup cell's write through emptyListAsNull, the people/lookup name read, cellDisplayText, the muted empty class); the name read's shared helper in ui/packages/fields/src/** only if the batched read needs one; NEW test file(s) under ui/packages/fields/src/widgets/ for the pins (not GridField.test.tsx, which open PR #36607 edits); .changeset/; the package README / content/docs/frontend/ sentence the fix makes false. No packages/spec/**, no server package. (Stop on breach; explain in the report.)
    Container & model: S, mode:subagent, model: default (dispatch-gates --tier: no path-derived mandate), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: the console's editable line-item grid (objectstack, ui/packages/fields) | readers treat [] and null alike; names arrive one read per line | every user editing a record with a line-item grid holding a people or multi-record lookup column, today
    Thread-read: 7086317761
    Premise: holds by reading (each of the four items cites its line on main; L2 records 7083478985 and 7085364786 on PR #36392). The dev measures item 1 (a cleared multi-record lookup cell writes []) and item 2 (one findOne per line) on current main before writing, and stops and reports if either does not reproduce.
    Pre-claim lane: domain:ui — ui/packages/fields/**.
    Pre-claim deps: no Blocked-by:. Parent #36043 (PR #36392) merged. Open PR #36607 (this area, #36451) edits GridField.ts and GridField.test.tsx, neither on this surface; the pins go in a new file so the two PRs share no file. No other open PR touches grid-field/ (file lists read at this claim). overlap-check runs before every push.
    Prior rulings read: check-prior-rulings.mjs --card 36552 (terms line-item grid, emptyListAsNull, people cell) → none; the card thread holds no ruling. Item 2 follows AGENTS.md Prime Directive 5 (SQL first: expand on the child read before batching client-side).
    Serial constraints cleared: #36607 named above.

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 23, 2026
  6. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmNmMEXS4EzeVz9RjvD
    os-dev-report

    {
      "issue": 36552,
      "status": "done",
      "branch": "claude/issue-36552-line-item-grid-followups",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36616",
      "session": "session_01ADHkmNmMEXS4EzeVz9RjvD",
      "premise_still_valid": true,
      "summary": "Premise measured on origin/main e7399fcdb before any edit: a cleared multi-record lookup cell wrote [{\"products\":[]}], and 20 lines with a user and a lookup column made 20 findOne on sys_user and 20 on product (0 find). Fixed in GridFieldWidget.tsx: the lookup onChange goes through emptyListAsNull; every people/lookup cell the grid draws (editable, the people cell's face and panel, read-only table, list mode) gets dataSource from the new grid-field/lineReferenceReads.ts, a Proxy over the page source that gathers plain findOne(object,id) per tick into one find with $filter id $in per object (ids de-duplicated, 50 per read) and passes everything else through; after: 1 $in read of sys_user, 1 of product, 0 findOne in all three modes. The dead multiselect empty return is removed and the list-mode muted class reads isEmptyCell. SQL-first expansion was not taken because the grid makes no child read: rows come from plugin-form's MasterDetailForm/LineItemsPanel reads (outside the file surface) or from inline grid JSON that no $expand reaches, and expanded references in rows would flow into the save diff and blank-line check.",
      "tests": "New file ui/packages/fields/src/widgets/GridField.lineItemFollowups-36552.test.tsx, 6 tests, all under scripts/pm/os-verify-lock.sh: pins at head 2b1bd4490 'Test Files 1 passed (1) / Tests 6 passed (6)'; pnpm --filter @object-ui/fields type-check (tsc --noEmit && tsc -p tsconfig.test.json, clean) && pnpm --filter @object-ui/fields test at 2431b1b9b: 'Test Files 323 passed | 1 skipped (324) / Tests 4897 passed | 7 skipped (4904)', VERDICT command-exit 0; after merging origin/main aff34baea (nothing under ui/packages/fields moved; spec rebuilt): new file + GridField.lookupAutofill-28245 + GridField.test.tsx 'Test Files 3 passed (3) / Tests 137 passed (137)'. Ablation via scripts/ablation-replace.mjs, four legs on the committed fix (subject imported by relative source path, no dist involved), each anchor x1->x0 and blob changed, each restore blob==HEAD 44d5c73e6987 and git diff HEAD empty: lookup emptyListAsNull removed -> 1 failed/5 passed (the multi-record lookup pin); people emptyListAsNull removed -> 1 failed/5 passed (the multi-person pin); cellSource forced undefined -> 3 failed/3 passed (the three one-read pins); muted class back to null/'' -> 1 failed/5 passed (the muted pin).",
      "gates": "Local: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 2b1bd4490 derived 38 families; all 38 ran, exit captured per command before any pipe, all exit 0 (check-comment-mask-corpus first exited 1 with ENOENT on a throwaway probe test file I created and deleted while the sweep ran; re-run on the clean tree exit 0, '23572 files, 0 disagree'). --ran reconciliation: '38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN', all with exit codes; record at /mnt/project-files/objectstack-seat2/36552-gates-ran.txt (re-read after 10 s, identical). overlap-check --branch=HEAD before each of 3 pushes: VERDICT clean exit 0. CI at report time on 2b1bd4490: Check Changeset, Check PR Size, Governed Surface Queue Guard, Lint (ESLint, PM dispatch-gates, docs & code guards, repo & tooling gates, CI/release/engine gates, scoped x3), PR-body guards, Type Check (consumer gates, debt ledger, workspace) in_progress; Type Check source gates queued; UI jobs not yet listed. Not waited on.",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls + assignees leg POST /issues/36616/assignees, run 45107607739, read-back identical 7285 bytes); post-stamped report comment POST /repos/objectstack-ai/objectstack/issues/36552/comments. Plus 3 git pushes (not REST).",
      "open_questions": [
        { "question": "AGENTS.md (ruling record 6583487846) puts a new pin for a component with a shared harness file into that file; the dispatch and claim kept GridField.test.tsx off this PR because open PR #36607 edits it. Fold the pins in later?", "options": ["A keep the new file", "B after #36607 lands, move the six pins into GridField.test.tsx as a top-level describe"], "recommendation": "B, a small follow-up by the seat, because the ruling binds and the file split was only to avoid the overlap." }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: a · reach: component-level repro only (GridFieldWidget rendered with a SchemaRendererContext data source; not yet measured through the console record page) · a lookup column with multiple: true draws 'undefined' in read-only and list mode while the editable cell draws '2 selected' — the two read-only LookupField sites in GridFieldWidget.tsx pass reference/displayField/idField but no multiple, so the array value is read as one expanded object; same on main (unchanged by this PR) · dedupe words: line-item grid multi lookup readonly undefined, GridField list mode multiple lookup, read-only lookup cell multiple"
      ]
    }
  7. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmNmMEXS4EzeVz9RjvD
    os-dev-report

    {
      "issue": 36552,
      "status": "done",
      "branch": "claude/issue-36552-line-item-grid-followups",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36616",
      "session": "session_01ADHkmNmMEXS4EzeVz9RjvD",
      "premise_still_valid": true,
      "summary": "Patch round (coordinator's B). I merged origin/main at ed0edb1b5 into the branch (merge commit e8586a8ab, clean); it brings in #36607. The six pins now sit in GridField.test.tsx as one top-level describe at the end of the file, with names and assertions unchanged, and GridField.lineItemFollowups-36552.test.tsx is deleted. Hardening: lineReferenceReads.ts now keys the rows it gets back by row.id ?? row._id, the same way LookupField's own $in read keys them (recordValue). It is pinned by a seventh test, 'a backend that answers with _id only', and ablated. I updated the PR body through the relay issue_patch, ending on the signed trailer. New head: fbdfc7d4f.",
      "tests": "All under os-verify-lock at fbdfc7d4f, after rebuilding the fields dependency closure for the fresh worktree. pnpm --filter @object-ui/fields type-check (tsc --noEmit && tsc -p tsconfig.test.json) passed with no errors. GridField.test.tsx + GridField.lookupAutofill-28245.test.tsx: 'Test Files 2 passed (2)', 'Tests 140 passed (140)'. The pins alone (-t 36552): 'Tests 7 passed | 109 skipped (116)'. Ablation of the _id keying with scripts/ablation-replace.mjs, replacing (row.id ?? row._id) with (row.id ?? undefined): anchor x1 to x0, blob 353de8d25949 to c4f734799280, '1 failed | 6 passed', the failing test being 'a backend that answers with _id only'; restored to blob == HEAD with git diff HEAD empty. My first attempt at this leg used the replacement 'row.id'. That string already occurs inside the anchor, so the tool refused it ('rise of 0') and restored the file; that attempt never ran the tests and its reading is void.",
      "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack at fbdfc7d4f derived the same 38 families as at 2b1bd4490. I re-ran all 38: all exit 0. --ran: '38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN', all with exit codes. Record overwritten at /mnt/project-files/objectstack-seat2/36552-gates-ran.txt, re-read after 10 s, identical. overlap-check --branch=HEAD before the push and again before the body patch: VERDICT clean exit 0. CI on fbdfc7d4f: Lint & Repo Gates, TypeScript Type Check, Test Core, Governed Surface Queue Guard, Lint UI, Type Check UI, Test UI (16/16 shards), Build & E2E UI are success; Build Core skipped; Check Changeset and PR-body guards were in_progress; no failures.",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 this round — fleet-write relay issue_patch on #36616 (PATCH /repos/objectstack-ai/objectstack/issues/36616, run 45111569874, read-back identical at 7733 bytes); post-stamped patch-round report comment POST /repos/objectstack-ai/objectstack/issues/36552/comments. Plus 1 git push (not REST).",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "Carried over from round 1, unchanged: class: a · reach: reproduced only at component level · a lookup column with multiple: true shows 'undefined' in read-only and list mode, because the two read-only LookupField sites in GridFieldWidget.tsx pass no multiple · dedupe words: line-item grid multi lookup readonly undefined, GridField list mode multiple lookup"
      ]
    }
  8. removed
    pm:dispatched
    on Nov 23, 2026
  9. added a commit that references this issue on Nov 23, 2026
    3110de5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxdomain:uienhancementpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions