Skip to content

fix(plugin-grid): a related tab's phone card follows the relationship's columns and drops the reference back to the page record - #38918

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-38895-phone-related-list-card-columns
Dec 1, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-38895-phone-related-list-card-columns

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

Fixes #38895

Clause-②: yes (widening) — new optional member only: ObjectGridComponentProps.cardFields on @object-ui/plugin-grid; nothing removed or renamed
Metadata-protocol: none

维护者速读

  • 手机用户打开记录页的相关列表标签(例如产品页的商机明细)时,每张卡片改为显示该关系声明的列(所属商机、数量、金额),不再在每张卡片上重复当前页面的记录本身(以前显示成一串原始编号);电脑端表格不变。
  • 替 HotCRM 解决产品页商机明细在手机上看不到商机的问题,这是 19.0.0-next.3 引入的显示回归。
  • 出错时只影响手机上相关列表卡片显示哪几个字段,不碰数据;撤回本次改动即恢复原来的卡片。
  • 无

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's highlightFields, that card body ignored the relationship's own relatedListColumns, and it drew the lookup back to the page's own record. The related list never expands that key (its $expand drops referenceField by 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, beside cardFace; 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's highlightFields, 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 passes cardFields = the columns it already draws (effectiveColumns) whenever the list is declared, that is when the relationship has relatedListColumns or the child declares highlightFields. Those columns already follow the ADR-0035 §3/§4 override chain (relationship relatedListColumns, else the child's highlightFields led 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).
  • Lookups render their record name: every lookup the card can now draw is one the list expands (authored columns restrict $expand to 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.
  • Not changed: the desktop table, every non-related list's phone card (the highlightFields card 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: patch for @object-ui/plugin-grid and @object-ui/plugin-detail.

Read first, by risk:

  1. RelatedList.tsx, the declaresCardList / cardFields block above enlargedGridHost: decides when the card follows the list.
  2. ObjectGrid.tsx, the declaredCardFields line in buildMobileCardRenderer: the one place the card body source changes.
  3. 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 for ObjectGrid or RelatedList). It drives the real chain, RelatedList (enlarged) then object-grid then its card renderer, with HotCRM's opportunity line on a product page as the fixture (highlightFields leads with the product; the product relationship's relatedListColumns leads with the deal), against a data source that honours $expand:

  • declared relatedListColumns: each card's parts are exactly deal name · Quantity n · Total $…, the list expands the deal and never the product, and no card carries the product's id;
  • no relatedListColumns: the parts are the child's highlightFields minus the product (Quantity 8 · Total $8,000.00);
  • control: the same tab at 1440 px is the table of the relationship's columns, with no column for the product.
Reproduction on the base tree (test committed before the fix, a8c74c9)
× with relatedListColumns declared ...   AssertionError: expected 'Restricted record' to be 'Globex Line Expansion'
× with no relatedListColumns ...         expected [ 'Restricted record', …(2) ] to deeply equal [ 'Quantity 8', 'Total $8,000.00' ]
Tests  2 failed | 1 passed (3)

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)
  • grid half: hostCardFields ?? (objectSchema as any)?.highlightFields back to (objectSchema as any)?.highlightFields: 2 failed / 1 passed; first card's parts read [ 'TcoGX1WJ77TN-SKX', … ], the raw product id.
  • host half: the cardFields spread deleted from enlargedGridHost: 2 failed / 1 passed, same two readings.
  • fix in place: 3 passed (3).
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 of plugin-detail is 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.json lists the new test file (--listFilesOnly, 1 hit).

Acceptance notes

  • The card title is still the child's declared name field. On HotCRM's product page that is product_title, the same product name on every card; the card asked only for the body, so the title is unchanged here.
  • With relatedListColumns declared, the amount is the first money column in the relationship's order (HotCRM's list puts unit_price before total_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 rule highlightFields follows.
  • Real-app reading at 390 px: NOT MEASURED, reason: a showcase or HotCRM boot plus a Console build did not fit this run; the test drives the same component chain the record page draws.

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.tsx shows 3 passed; the first case reads the deal's name as each card's first subtitle part.


Generated by Claude Code

…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>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 1, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfcCk7a8bQdgyaxzu7

Final head for review · 2026-12-01T13:38Z · zone osa-ux: d65d66c2 (PR #38918, Fixes #38895), draft, mergeable_state clean, check-runs 42 success / 15 skipped / 0 failed. 272 lines across 4 files (ObjectGrid.tsx, RelatedList.tsx, a new card-named test, a changeset), Clause-②: no, Metadata-protocol: none, not governed. Claim 7311136581, os-dev report 7312907712.

Points to judge: (1) root cause: the phone card body read the child's highlightFields alone and ignored the columns the related list hands down (relatedListColumns, else highlightFields, with the parent FK already dropped), so it drew the FK; the raw id came from the FK being kept out of $expand on purpose. (2) Fix: a host prop cardFields on ObjectGrid (a React prop beside cardFace, not a spec or node key) that RelatedList's enlarged tab fills from its effective columns; non-related lists, the desktop table and the card title are unchanged. Please say whether the new host prop counts as a public-surface widening of @object-ui/plugin-grid for Clause-②. (3) Pin red on the base (2 of 3), both halves ablated red. Real-app reading at 390 px NOT MEASURED; the test drives the real RelatedList → object-grid → card chain with HotCRM's opportunity-line fixture.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

L1 review · PR #38918 (#38895) · head d65d66c · 2026-12-01T13:41Z

One must-fix, on the declaration only. The code is ACCEPT-ready.

M1 · Clause-② should read yes (widening)

  • ObjectGridComponentProps is exported from @object-ui/plugin-grid's index (export type { ObjectGridComponentProps, … }), and that package is published (no "private"). The new optional host prop cardFields therefore widens a published face.
  • There is a direct precedent on main. .changeset/pre/36149-side-preview-tighten.md declared Clause-②: yes (widening) — new optional members only: … ObjectGridComponentProps.cardFace on @object-ui/plugin-grid. That is the sibling prop of this one. 35707-translation-fault-warning.md did the same for an optional DatasetToolsDeps.logger.
  • The level stays patch, with Metadata-protocol: none.
  • Fix:
    • Change the changeset line to Clause-②: yes (widening) — new optional member only: ObjectGridComponentProps.cardFields on @object-ui/plugin-grid, and patch the PR-body line to match. This moves the head.
    • A Clause-②: yes alone owes a declaration-face L2 at TIER_DEFAULT (contract-review.md, L2 归属). On the green fix head I write that record and the L1 delta. Announce the head.

What I checked (pass)

  • l1-face.mjs --pr 38918: CLEAN, with 42 checks success and 0 failed or pending.
  • RelatedList.tsx.
    • cardFields is the list this relationship declares, taken from effectiveColumns: relatedListColumns, else the child's highlightFields.
    • Those columns pass through the same gates as the columns, so the key back to the page's own record is never included.
    • With neither declared, the card keeps the shown columns.
    • It is memoised on a string key, so the enlargedGridHost memo does not churn.
  • ObjectGrid.tsx. hostCardFields ?? highlightFields is read exactly as highlightFields was: existing fields only, de-duplicated. The table keeps its columns, and other lists are unchanged.
  • Tests. The pin drives the real chain, RelatedList → object-grid → card. The 390 px reading in the real app was not measured. A phone-width look at a related tab after landing is worth it.
  • Scope. The 4 files are inside claim 7311136581. Fixes #38895 is right. Apart from M1, the changeset reads true sentence by sentence.

…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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfcCk7a8bQdgyaxzu7

Final head for review · 2026-12-01T14:05Z · zone osa-ux: 3d7b4a51 (PR #38918, Fixes #38895), answering L1 M1 (comment 7313029866). Delta from d65d66c2: the changeset's line now reads Clause-②: yes (widening), new optional member only, ObjectGridComponentProps.cardFields on @object-ui/plugin-grid (precedent cardFace in the 36149 changeset); the PR body line matches (relay issue_patch, read-back identical). Claim amendment 7313094399. Check-runs 43 success / 17 skipped / 0 failed; one PR-body guards run shows cancelled because the body edit superseded it, and its re-run on the same head is success. mergeable_state clean. Owed now: L1 delta and the TIER_DEFAULT declaration-face L2.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

Contract-review-claim: session_01WGufzhGA3zoCFquQgku4pm · head 3d7b4a5 · 2026-12-01T14:08Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 3d7b4a518cce0a8986ae9adc720fc6a01c1542a3
Local-runs: none

This is the declaration face. The review is owed because of the Clause-②: yes (widening) line alone: the diff touches no published schema and no governed path. I read the net diff against main, the card #38895 and its comments, the claim 7311136581 with amendment 7313094399, dev report 7312907712, and the check-runs on this head.

① Derived judgments

  • Right. One public-surface change: ObjectGridComponentProps, exported from @object-ui/plugin-grid's index (published), gains the optional host prop cardFields?: readonly string[]. It is additive. A host that omits it gets today's behaviour: the object's highlightFields, else the shown columns. No member is removed, renamed or narrowed.
  • Right. cardFields is a host prop, not authored metadata. The spec, the view schema and the accept set of anything a metadata author writes are unchanged, so Metadata-protocol: none holds.
  • Right. RelatedList in @object-ui/plugin-detail passes the new prop. That is an internal composition, and none of plugin-detail's exported types changes.
  • Right. The prop's reading matches highlightFields: only fields the object has, de-duplicated, and in priority order. The card's amount is the first money field and its subtitle the next three. Only the card reads the prop; the table keeps its columns.

② Semver level

  • patch on @object-ui/plugin-grid and @object-ui/plugin-detail is right for an additive optional member in a pre-release line. This matches the sibling precedent cardFace (.changeset/pre/36149-side-preview-tighten.md, yes (widening), patch).
  • The changeset and PR-body lines both read Clause-②: yes (widening) — new optional member only: ObjectGridComponentProps.cardFields on @object-ui/plugin-grid; nothing removed or renamed. They agree with each other and with the diff.

③ Boundary flags

  • The dev's open_questions is empty. The out-of-scope note is accepted and needs no card: HotCRM's card title repeats product_title, which is the app's own nameField, and the highlightFields projection still $selects the parent FK, which is harmless.
  • SQL push-down: none applies. The diff adds no query, no id materialisation and no in-app join; it chooses which already-fetched fields a card draws.
  • Check-runs on this head: 43 success and 17 skipped. The one cancelled PR-body guards run (13:43:04Z) was cancelled by the body edit, and its re-run on the same head (13:43:43Z) is success.

No must-fix, no should-fix.

Implemented-by: claude/issue-38895-phone-related-list-card-columns
Reviewed-by: session_01WGufzhGA3zoCFquQgku4pm

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

L1 delta · PR #38918 · head 3d7b4a5 · 2026-12-01T14:10Z

ACCEPT.

  • M1 is closed. The delta d65d66c2..3d7b4a51 is the one changeset line, now Clause-②: yes (widening) — new optional member only: ObjectGridComponentProps.cardFields on @object-ui/plugin-grid. The PR-body line matches, and claim amendment 7313094399 records it.
  • The declaration-face record at TIER_DEFAULT is 7313807485: PASS, no must-fix and no should-fix.
  • The code is unchanged since L1 7313029866, so that reading stands.
  • l1-face flags only the cancelled PR-body guards run, which the body edit cancelled. Its re-run on this head is success.
  • The PR is not governed, so the zone lands it. The 390 px look after landing is still worth doing.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfcCk7a8bQdgyaxzu7

Landing · 2026-12-01T14:11Z · zone osa-ux · head 3d7b4a51 · ACCEPT → PR #38918 comment 7313827218 (L1 delta on 7313029866); declaration-face L2 7313807485 PASS

reading value
check-governed-merges.mjs --pr 38918 NOT governed (0 of 4 paths on the register); 272 lines, card total under 3000
Clause-② yes (widening), new optional member ObjectGridComponentProps.cardFields only; TIER_DEFAULT declaration-face review on record
K read by hand (UI-only run): merge base ad83af43, 0 first-parent commits to origin/main (< 15)
check-runs at head 43 success · 17 expected skip · 0 failed (one superseded PR-body guards run cancelled, its re-run success); mergeable_state clean

State: ready + auto-merge; Fixes #38895 closes the card on merge. Real-app 390 px reading not measured; owed as a look after landing.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 1, 2026 14:11
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 878aebd Dec 1, 2026
61 of 62 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-38895-phone-related-list-card-columns branch December 1, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants