Repository navigation
fix(plugin-grid): a related tab's phone card follows the relationship's columns and drops the reference back to the page record - #38918
Conversation
…ip's list Claude-Session: https://claude.ai/code/session_01WGufzfcCk7a8bQdgyaxzu7 Co-authored-by: Claude <noreply@anthropic.com>
…ip's list On a phone, a record page's related tab drew its card body from the child object's highlightFields: the relationship's relatedListColumns were ignored, and the lookup back to the page's own record, which the list never expands, drew as an unresolved reference on every card. The related list now hands the grid the list its relationship declares (relatedListColumns, else highlightFields, ADR-0035 §3/§4), minus that key, as the cardFields host prop; every other list keeps the highlightFields card. Claude-Session: https://claude.ai/code/session_01WGufzfcCk7a8bQdgyaxzu7 Co-authored-by: Claude <noreply@anthropic.com>
…ip's list Claude-Session: https://claude.ai/code/session_01WGufzfcCk7a8bQdgyaxzu7 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfcCk7a8bQdgyaxzu7 Final head for review · 2026-12-01T13:38Z · zone osa-ux: Points to judge: (1) root cause: the phone card body read the child's |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm L1 review · PR #38918 (#38895) · head d65d66c · 2026-12-01T13:41ZOne must-fix, on the declaration only. The code is ACCEPT-ready. M1 ·
|
…as Clause-② widening L1 M1 on PR #38918 (comment 7313029866): `cardFields` is a new optional member of the exported `ObjectGridComponentProps`, as `cardFace` was in 36149-side-preview-tighten.md. Claude-Session: https://claude.ai/code/session_01WGufzfcCk7a8bQdgyaxzu7 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfcCk7a8bQdgyaxzu7 Final head for review · 2026-12-01T14:05Z · zone osa-ux: |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm Contract-review-claim: session_01WGufzhGA3zoCFquQgku4pm · head 3d7b4a5 · 2026-12-01T14:08Z |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm Contract reviewServed-tier: This is the declaration face. The review is owed because of the ① Derived judgments
② Semver level
③ Boundary flags
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm L1 delta · PR #38918 · head 3d7b4a5 · 2026-12-01T14:10ZACCEPT.
|
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfcCk7a8bQdgyaxzu7 Landing · 2026-12-01T14:11Z · zone osa-ux · head
State: ready + auto-merge; |
Requested by Yibo Wang · project thread
Fixes #38895
Clause-②: yes (widening) — new optional member only:
ObjectGridComponentProps.cardFieldson@object-ui/plugin-grid; nothing removed or renamedMetadata-protocol: none
维护者速读
What changes
On a phone (and in the side preview's card face), a record page's related tab hands its rows to
object-grid, which draws each row as the list card. Since the phone card started following the child object'shighlightFields, that card body ignored the relationship's ownrelatedListColumns, and it drew the lookup back to the page's own record. The related list never expands that key (its$expanddropsreferenceFieldby design), so the card showed it as a raw id or an unresolved reference, and a product's deal lines never showed the deal.ui/packages/plugin-grid/src/ObjectGrid.tsx: a new HOST prop,cardFields(a React prop on the grid's host channel, besidecardFace; never authored metadata, no spec or node key change). When a host passes it, the card body reads those fields, in order, in place of the object'shighlightFields, with the same rules: the amount is the first that draws as money, the subtitle the next three, and number parts carry their field label. Absent, the card is exactly as before:highlightFields, else the shown columns.ui/packages/plugin-detail/src/RelatedList.tsx: the enlarged tab passescardFields= the columns it already draws (effectiveColumns) whenever the list is declared, that is when the relationship hasrelatedListColumnsor the child declareshighlightFields. Those columns already follow the ADR-0035 §3/§4 override chain (relationshiprelatedListColumns, else the child'shighlightFieldsled by its name field) and already pass the FK, FLS and redaction gates, so the key back to the page is never among them. With neither declared, nothing is passed and the card keeps the grid's shown columns, which are this list's columns already. The value is memoised on a string key, not on the array's identity (ui commandment chore: version packages #10).$expandto themselves; derived columns expand every relation but the parent FK). The raw-id draw had no second cause: it was the unexpanded parent FK, which the card no longer draws.highlightFieldscard from Related-list phone card: let an object say which fields fill the card subtitle (with labels or a format) and an optional title prefix, without changing the wide table #37891 / PR feat(plugin-grid): phone cards follow the object's highlightFields for their amount and subtitle #38214), the card title (the declared name field)..changeset/38895-phone-related-list-card-columns.md:patchfor@object-ui/plugin-gridand@object-ui/plugin-detail.Read first, by risk:
RelatedList.tsx, thedeclaresCardList/cardFieldsblock aboveenlargedGridHost: decides when the card follows the list.ObjectGrid.tsx, thedeclaredCardFieldsline inbuildMobileCardRenderer: the one place the card body source changes.ui/packages/plugin-grid/src/__tests__/relatedTabPhoneCard-38895.test.tsx.Tests
New file
ui/packages/plugin-grid/src/__tests__/relatedTabPhoneCard-38895.test.tsx(no shared harness file exists forObjectGridorRelatedList). It drives the real chain,RelatedList(enlarged) thenobject-gridthen its card renderer, with HotCRM's opportunity line on a product page as the fixture (highlightFieldsleads with the product; the product relationship'srelatedListColumnsleads with the deal), against a data source that honours$expand:relatedListColumns: each card's parts are exactlydeal name · Quantity n · Total $…, the list expands the deal and never the product, and no card carries the product's id;relatedListColumns: the parts are the child'shighlightFieldsminus the product (Quantity 8 · Total $8,000.00);Reproduction on the base tree (test committed before the fix, a8c74c9)
The first part of every card is the product reference back to the page, unresolved.
Ablation, one leg per half, each via scripts/ablation-replace.mjs (mutation landed by anchor count and blob, restored to HEAD blob, git diff HEAD empty)
hostCardFields ?? (objectSchema as any)?.highlightFieldsback to(objectSchema as any)?.highlightFields: 2 failed / 1 passed; first card's parts read[ 'TcoGX1WJ77TN-SKX', … ], the raw product id.cardFieldsspread deleted fromenlargedGridHost: 2 failed / 1 passed, same two readings.Package suites at d65d66c
pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-grid/: Test Files 322 passed (322), Tests 2843 passed (2843).pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-detail/src/__tests__/RelatedList packages/plugin-detail/src/__tests__/RecordPageColumns packages/plugin-detail/src/__tests__/relatedTab: Test Files 65 passed (65), Tests 505 passed (505). The rest ofplugin-detailis left to Test UI (it does not fit one foreground window).pnpm --filter @object-ui/plugin-grid run type-check && pnpm --filter @object-ui/plugin-detail run type-check: exit 0;tsconfig.test.jsonlists the new test file (--listFilesOnly, 1 hit).Acceptance notes
product_title, the same product name on every card; the card asked only for the body, so the title is unchanged here.relatedListColumnsdeclared, the amount is the first money column in the relationship's order (HotCRM's list putsunit_pricebeforetotal_price, so the amount is the sales price and the total is a labelled subtitle part). This is the order the author declared, the same rulehighlightFieldsfollows.Verification
Targeted gates at d65d66c (dispatch-gates --commands, derived from this diff)
39 derived, 39 run, each exit 0, including
pnpm --dir ui exec vitest run scripts/(172 passed, 2 skipped).dispatch-gates --ran: "39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED zero — all 39 recorded an exit code and none of them is 3)".pnpm check:new-line-citations(ui): "0 new citation(s)". Type-check lanes and the full farm are CI's.Two-minute check:
pnpm --dir ui exec vitest run packages/plugin-grid/src/__tests__/relatedTabPhoneCard-38895.test.tsxshows 3 passed; the first case reads the deal's name as each card's first subtitle part.Generated by Claude Code