Skip to content

feat(plugin-grid): phone cards follow the object's highlightFields for their amount and subtitle - #38214

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-0tu6wm
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-0tu6wm

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Fixes #37891
repo:objectstack#3 · os-tesla · session_01L9qibwy7XB37e8e1P6jRJ3

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:在手机上看列表和相关列表时,卡片按对象声明的「最重要字段」显示:右下角是其中第一个金额(订单明细显示这一行的合计,不再是单价),副标题依次显示后面最多三个字段,数字类带名称,例如「数量 2 · 单价 ¥6,000.00 · 折扣 10.00%」;电脑上的宽表格不变。
  • 为什么做:HotCRM 订单明细的手机卡片只写「1 · 2」、右下角是单价,要改只能动宽表格的列顺序;你 11 月 28 日选了「按对象的最重要字段」,不加新配置。
  • 出错会怎样:声明了「最重要字段」的对象,手机卡片都会跟着变(事先粗量约 222 处里 180 处,大多在 HotCRM),哪个对象读着不对,调它的「最重要字段」顺序即可;整个改动可以直接撤回。
  • 要你做什么:无。

What changes

Governing ruling: the maintainer chose option A on #37891 (ruling record 7235312203, 2026-11-28T06:25Z, anchor 7235198146): phone cards follow the object's highlightFields (ADR-0085 §1), no new key, no line-number title prefix. Built as the claim (7235321485) and its surface amendment (seat, 2026-11-28T06:31Z) say.

  • ui/packages/plugin-grid/src/ObjectGrid.tsx (buildMobileCardRenderer): when the object declares highlightFields, the card body is that list, in order (title excluded): the amount is the first entry that draws as money (Phone grid card: the amount slot ignores a formula column returning currency, so an order line's card shows its unit price instead of its total #37890's drawsAsMoney), the subtitle the next three, skipping the status field and the title formula's reads, empty values dropped (0 is a value), and a number, currency or percent part (a formula or summary by its value type) is drawn under its field label (grid-card-subtitle-label). A highlighted field the view shows is drawn through its column draft; one it does not show through the synthesized draft. Masked fields stay masked: never the amount, never a part. An object without highlightFields keeps the column-order card (two unlabelled parts).
  • ui/packages/plugin-grid/src/objectGridGenerateColumns.tsx: the synthesized path's per-field draft is now its own callback, synthesizeFieldColumn (same body: renderer, translated label, FLS), which generateColumns calls and the card reuses. No behaviour change for columns.
  • Fetches, beside the declared name field and through the same gates (declared, FLS-readable, not draft-only/withheld/redacted), on every viewport so a width change never refetches:
    • ui/packages/plugin-grid/src/objectGridRowLoad.ts getSelectFields (the grid's own fetch);
    • ui/packages/plugin-list/src/ListView.tsx harvest (the list page's fetch);
    • ui/packages/plugin-detail/src/RelatedList.tsx selectFields (the related list's fetch; derived-columns lists still send no projection).
  • Changeset: @object-ui/plugin-grid, @object-ui/plugin-list, @object-ui/plugin-detail patch, naming the phone-card change.

Tests

  • plugin-grid phoneCardAmount-34615.test.tsx, new top-level describe (HotCRM order-line fixture at 390 px): amount = highlighted total (CN¥10,800.00) though the table shows the unit price first; subtitle Quantity 2 · Sales Price CN¥6,000.00 · Discount % 10.00%; a text part drawn bare; an empty part dropped; a highlighted field no column shows is drawn and is in the grid's $select; CONTROL no highlightFields keeps 1 · 2 and the unit price, no labels; CONTROL a password field first in highlightFields is neither amount nor part and its value is never printed.
  • plugin-list ListView.harness.test.tsx, new top-level describe: a highlighted field no column shows is in $select and not drawn; CONTROL no highlightFields sends the old projection.
  • plugin-detail RelatedList.selectFls-10186.test.tsx, new top-level describe: a declared, readable highlighted field is requested, an undeclared one never; an FLS-denied one is not requested; CONTROL no highlightFields keeps the projection.

Acceptance notes

  • The fetches ask for highlightFields on desktop too (a few extra columns per row), as they already ask for the name field, so crossing the 768 px breakpoint never refetches.
  • The status chip is unchanged: drawn when a column shows the status field; the status field is never a subtitle part.
  • The related list's non-enlarged mobile gallery (object-gallery) path is untouched (Phone related-list card draws a currency formula column as a bare unlabeled number (12,000 beside 销售单价 6,000.00; desktop shows 总计 12,000.00) #37008 owns its labels).
  • No "×" joiner and no title prefix, by the ruling. The HotCRM highlightFields re-order (order line, quote line, and a review of its other objects) follows in its own card after this lands, per the anchor's 裁后执行.
  • Measured before the ruling (anchor 7235198146, static simulation): 180 of 222 shipped phone-card surfaces change, 134 of 138 on HotCRM; platform objects only gain a third part.

Verification

Two-minute check: cd ui && pnpm exec vitest run packages/plugin-grid/src/__tests__/phoneCardAmount-34615.test.tsx -t highlightFields, expect the objectstack#37891 describe green (7 cases).

First files to read (by risk): ui/packages/plugin-grid/src/ObjectGrid.tsx (the card body and the label rule); ui/packages/plugin-grid/src/objectGridGenerateColumns.tsx (the extracted draft, must be byte-equivalent for columns); ui/packages/plugin-detail/src/RelatedList.tsx (the projection arm and its gates).

Verification record: every reading below is on objectstack-ai/objectstack, base origin/main 4f7aa88, through os-verify-lock.sh, after rebuilding the closure (turbo run build --filter='@object-ui/plugin-grid^...' --filter='@object-ui/plugin-list^...' --filter='@object-ui/plugin-detail^...', 58/58).

Tests
  • The three changed test files at 32340f2+: Test Files 3 passed (3), Tests 168 passed (168); the plugin-grid file alone at the fixture fix: Tests 18 passed (18).
  • Full suites pnpm --dir ui exec vitest run packages/plugin-grid/ packages/plugin-list/ packages/plugin-detail/ at 5f2eee0 (head 512ad74 changes only test docblock comments): Test Files 933 passed | 1 skipped (934), Tests 8897 passed | 18 skipped (8915), VERDICT command-exit 0.
  • type-check in plugin-grid, plugin-list, plugin-detail: exit 0 each.
Shown red without the fix (ablation, restored to HEAD)
  • The five source files restored from base 4f7aa88 (tree only; objectstack#37891 marker count 0 on disk in each), the three test files run: Tests 9 failed | 159 passed (168). Red: all six grid cases with highlightFields (the masked control too, on its amount half: the base tree shows the unit price), both RelatedList projection cases, the ListView projection case. Green: the three no-highlightFields controls.
  • Restored with git checkout HEAD -- PATHS: marker counts back (2/1/1/1/1), git diff HEAD empty, each blob equal to its HEAD blob.
Gates

node scripts/pm/dispatch-gates.mjs --commands at 512ad74: 39 families derived, all 39 run locally, all exit 0 (two first hit a 240 s per-gate timeout, exit 124, and were re-run to exit 0: pnpm check:query-options-erasure, pnpm --dir ui exec vitest run scripts/ = 172 files passed). --ran: 39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED.

overlap-check before each push: VERDICT clean, exit 0 (#38169 and #37924 share files and merge cleanly).

PR check-runs at 512ad74 (pr-state): 42 success, 13 expected skip, 0 failed, 0 pending; mergeable_state clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L9qibwy7XB37e8e1P6jRJ3


Generated by Claude Code

…amount and subtitle

When an object declares highlightFields (ADR-0085), the phone card takes its
amount from the first of them that draws as money and its subtitle from the
next three, in that order, with number, currency and percent parts under their
field label. Fields no column shows are drawn through the synthesized column
draft and fetched beside the name field by the grid, ListView and RelatedList.
An object without highlightFields keeps the column-order rule.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibwy7XB37e8e1P6jRJ3
@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 Nov 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T07:52Z

L1-a: ACCEPT at 512ad745483fd3478aef0be8f48d802145c1ce69

  • Face: L1 only. The diff is source and tests in three @object-ui plugins, with one patch changeset. It declares Clause-②: no and Metadata-protocol: none, and touches no spec or governed path. synthesizeFieldColumn is a return value of the internal useObjectGridGenerateColumns hook, not an entry export.

  • The fix follows Tesla's ruling A (7235312203).

    • With highlightFields declared, the card's amount is the first highlighted field that draws as money. The subtitle is the next three, in order, and number, currency and percent parts carry their field label.
    • A highlighted field that no column shows is drawn through the synthesized column draft, so it gets the field's renderer, its translated label, and FLS. null means the field is left out.
    • The mask check reads the card's own column map.
    • An object with no highlightFields keeps the shown-columns card: same slice of 2, no labels.
  • The fetches. All three ask for the highlighted fields on every viewport, so crossing the breakpoint never refetches:

    • the grid's own row load, after isProjectableField and passesProjectionGate;
    • the list page, through addSpeculative, like every other binding there;
    • the related list, declared, readable and not redacted, through the name field's gates.

    Each is a union, so a field that is also a column is not selected twice.

  • The deviation outside the claim, objectGridGenerateColumns.tsx: accepted. It moves the synthesized per-field draft into synthesizeFieldColumn with the body unchanged. The only difference is return in place of push, and generateColumns now calls it, so the synthesized columns are the same. It is in the same package, the card needs exactly this draft, and drafting it a second time would let the card and the table diverge.

  • Tests. There are three test files: 168/168 pass. The 9 ablation reds turn green on restore, and the three controls with no highlightFields stay green.

  • Prose. The changeset's sentences match the diff, including the line telling readers to review the highlightFields order on objects whose phone list now reads differently. The HotCRM reorder is the seat's follow-up card.

  • CI at this head: 15 skipped, 44 success, 0 failed.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Landing · 2026-11-28T07:53Z · zone o3-ux (seat card thread)
Head-sha: 512ad745483fd3478aef0be8f48d802145c1ce69

  • L1 ACCEPT 7236217101 at this head (L1-a). L1 only: Clause-② no, Metadata-protocol none. Built as the maintainer ruled (option A, ruling 7235312203): phone cards follow highlightFields, no line-number prefix, no "×".
  • Accepted deviation (L1-a): objectGridGenerateColumns.tsx, outside the named files: the per-field column draft is extracted into synthesizeFieldColumn unchanged (push becomes return), so the card draws an unshown highlighted field with the grid's own renderer and FLS; synthesized columns are unchanged.
  • Claim 7235321485, amended 7235352037 (the list and related-list fetches). Report 7236180767.
  • check-governed-merges.mjs --pr 38214: NOT governed, +436 / −48.
  • K: 5 < 15, counted by hand.
  • Checks at this head: 44 success, 15 skipped, 0 failed. mergeable_state clean.
  • Carried: the HotCRM highlightFields re-order is filed by the seat in hotcrm, Blocked-by this card.
  • Action: ready for review and auto-merge (queue).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 28, 2026 07:53
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit 9957484 Nov 28, 2026
60 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-0tu6wm branch November 28, 2026 08:48
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…'s columns and drops the reference back to the page record (objectstack-ai#38918)

<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwB7Un8hgmYaC4XFXQuvaosiq)_

Fixes objectstack-ai#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 objectstack-ai#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 objectstack-ai#37891 / PR objectstack-ai#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.

<details><summary>Reproduction on the base tree (test committed before
the fix, a8c74c9)</summary>

```
× 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.
</details>

<details><summary>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)</summary>

- 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).
</details>

<details><summary>Package suites at d65d66c</summary>

- `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).
</details>

## 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

<details><summary>Targeted gates at d65d66c (dispatch-gates --commands,
derived from this diff)</summary>

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.
</details>

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](https://claude.ai/code/session_01WGufzfcCk7a8bQdgyaxzu7)_

<!-- signed: repo:objectstack@os-support-ai · os-support-ai ·
session_01WGufzfcCk7a8bQdgyaxzu7 -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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