You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9957484
Browse filesBrowse the repository at this point in the historyBrowse files
feat(plugin-grid): phone cards follow the object's highlightFields for their amount and subtitle (#38214)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoAvhxsnErQnmY8cTbgC3beU)_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 (#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 (#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).
<details><summary>Tests</summary>
- 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.
</details>
<details><summary>Shown red without the fix (ablation, restored to
HEAD)</summary>
- 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.
</details>
<details><summary>Gates</summary>
`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.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L9qibwy7XB37e8e1P6jRJ3
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibwy7XB37e8e1P6jRJ3)_
<!-- signed: repo:objectstack#3 · os-tesla ·
session_01L9qibwy7XB37e8e1P6jRJ3 -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Phone list cards now follow the object's `highlightFields`. When an object declares them, a card's amount is the first of those fields that draws as money, and its subtitle is the next three, in that order, with empty values dropped and each number, currency or percent part under its field label (`Quantity 2 · Sales Price ¥6,000.00 · Discount % 10.00%`). The view's column order no longer decides the card, so an order line that declares `highlightFields: ['total_price', 'quantity', 'unit_price', 'discount']` shows its line total bottom right while its wide table keeps its columns. A highlighted field no column shows is drawn too: the grid's own fetch, the list page's fetch and the related list's fetch now ask for the object's `highlightFields` beside its name field, through the same field-level security gate.
11
+
12
+
This changes the phone card of every object that declares `highlightFields` and shows its fields in a different order, or shows more than two of them: review an object's `highlightFields` order if its phone list now reads differently. An object without `highlightFields` keeps the column-order card. Nothing changes on desktop tables, apart from the fetch asking for the highlighted fields.
0 commit comments