Repository navigation
fix(plugin-detail): a related table in the record preview drawer draws instead of looping on its column cap - #37244
Conversation
…ls column settling its column cap Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…drawer does Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…awn for it The cap's read re-ran in the commit that changed the cap and measured the table data-table still drew for the previous cap (it adopts a new columns prop a render later). In the record preview drawer's narrow details column that read flipped the cap 1 -> 2 -> 1 on every commit until React stopped it with Maximum update depth exceeded. The read now waits for the table to draw the columns it was handed; the table's re-draw reads again. Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for L1 (p1) · area a4-U · 2026-11-25T07:17Z
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — REWORK · L1 · head
|
…awer-related-table-update-loop
…option lag, not a column it hid itself The read skipped any shorter leading run the table drew, so a column hidden from the header menu froze the cap and the overflow cue. It now skips only while the table still draws the hand-over it adopted last. Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
…reads Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Final head for the delta read (rework round 1, p1) · area a4-U · 2026-11-25T09:30Z Against REWORK 7156135650:
|
|
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ 席位核对 — ACCEPT · L1 · head
|
|
repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D Landing (p1) · area a4-U · 2026-11-25T09:48Z · head
State change: ready for review + auto-merge armed; the queue lands it. |
Part of #37212
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Root cause. A related list drawn as a record's body table (the 「详情」 section's master-detail table) leaves out the trailing columns that do not fit whole in its column, through the
bodyTableColumnCapstate inRelatedList. The layout effect that reads the cap lists the cap itself in its deps ("re-read once the table draws the columns that fit"), so every cap change re-reads synchronously, in the same commit chain. Butdata-tableadopts a newcolumnsprop one render later: it copies the prop into its own state in an effect. So the re-read measures the table still drawn for the previous cap. The columns already handed away carry no inline min-width there, so the read also falls back to their stale pre-draw estimates.At the preview drawer's default 460 px width, the details column is a 326 px scroll box. Measured in the browser on the CRM example (opportunity, line items with a lookup, a select, a percent and a text column added):
That repeats every commit until React stops it with
Maximum update depth exceeded(React error 185). data-table's own layout effects run first in each commit, so its error boundary takes the throw and reportsComponent "data-table" failed to render. The full page's details column fits every column, so the cap never moves there.Fix (
ui/packages/plugin-detail/src/RelatedList.tsx, the body-table read):MutationObserverreads again when the table re-draws.Edited files:
ui/packages/plugin-detail/src/RelatedList.tsx,ui/packages/plugin-detail/src/__tests__/RelatedList.bodyTable-27055.test.tsx,.changeset/37212-drawer-body-table-column-cap.md.recordDrawerStack.tsxanddata-table.tsxare untouched.Which builds carry the defect. The cap and its self-triggering read arrived with
d19d87529d(2026-11-20). Master-detail children became 「详情」 body tables by default with9b6db730b2, and the side preview opened 460 wide withaad35e6885.@object-ui/*@18.6.0/@objectstack/console@18.6.0resolve to958ee03594, which has none of these.git merge-base --is-ancestor d19d87529d 958ee03594exits 1. The control leg958ee03594~5exits 0.RelatedList.tsxthere has nobodyTableColumnCap, and its one body-table effect has deps[bodyTableDrawn, isMobile].958ee03594I booted the CRM example and drove the preview drawer with stock line items and with the widened shape, at the default width and at 380 to 800 px. There was no React error 185 at any width: the body table draws every column and scrolls.nextbuild0.0.0-next-20261125013212hasgitHeada1b26ff907(2026-11-25T00:16Z) for@objectstack/console,@object-ui/consoleand@object-ui/plugin-detail.d19d87529dis an ancestor of it (exit 0), and itsRelatedList.tsxanddata-table.tsxare identical to this PR's base.Closing arrangement. This PR is the platform half. The card stays open until a reading on the reporting tenant names its console build (the build's version, or its
gitHeadcontainingd19d87529d). Then, after a console carrying this change is installed there, it needs a second reading that the opportunity line items draw in the preview drawer's 「详情」. The card closes on that reading.Responsibility. Whose code: the platform's own console code (the
@object-ui/plugin-detailrelated list's body table, drawn by@object-ui/componentsdata-tableinside the@object-ui/app-shellrecord preview drawer). Existing platform path: none, since the full page draws the same table fine. Who reaches it: every user who opens a record with a related body table in the preview drawer, on a console built after 2026-11-20, at a width where the cap sits between column counts (the default 460 px with the line items above).Tests
Three cases in a top-level
describein the existing body-table harness,RelatedList.bodyTable-27055.test.tsx: "RelatedList — a body table in the record preview drawer settles its columns (objectstack#37212)". They model the 326 px details column, where a table narrower than its box stretches and the actions cell takes its share. The real data-table is used, so its one-render column lag is the real one, and the rows arrive from the data source as in the drawer.Readings
35079023b0): the drawer case failed with the error boundary's text in the DOM, and the control passed.e1b242fed2(after mergingorigin/main, closure rebuilt):Test Files 2 passed (2),Tests 41 passed (41).scripts/ablation-replace.mjs:c199589f7aa5->4b691f714dd4.Tests 1 failed | 2 passed | 32 skipped (35); the red is the drawer case.c199589f7aa5,git diff HEADempty.c199589f7aa5->09c590c4173a.Tests 1 failed | 2 passed | 32 skipped (35); the red is the hide-then-narrow case.c199589f7aa5,git diff HEADempty.@object-ui/plugin-detailat4008830387:pnpm --filter @object-ui/plugin-detail type-checkexit 0. Whole package (pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-detail/):Test Files 418 passed | 1 skipped (419),Tests 3949 passed | 18 skipped (3967).Acceptance notes
ui/source over Vite against my own CRM backend, line items widened as above), drawer width swept 380 to 800 px:failed to renderat 460 px only.columnsprop a render later (its re-seed runs in an effect). Changing that would move every table's column timing.Verification
Two-minute check:
pnpm --dir ui exec vitest run packages/plugin-detail/src/__tests__/RelatedList.bodyTable-27055.test.tsx -t "settles its columns"expects3 passed.Read first, by risk:
RelatedList.tsx, the two guard lines at the top of the body-tablereadand the adopted-count ref beside the column widths (the only runtime change).describeat the end ofRelatedList.bodyTable-27055.test.tsx(the layout model and the hide-then-narrow case)..changeset/37212-drawer-body-table-column-cap.md.Security: none.
Generated by Claude Code