Skip to content

fix(plugin-grid): a phone list card never repeats a formula title in its subtitle - #37079

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-37010-card-subtitle-formula-name
Nov 24, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-37010-card-subtitle-formula-name

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #37010
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:手机上打开工单、线索这类以公式字段作标题的列表时,卡片副标题不再重复标题里的内容,而是显示紧急程度、客户等下一批信息。
  • 为什么做:手机列表卡片的标题与副标题重复,用户在一张卡上看不到记录的其他关键信息。
  • 出错会怎样:最坏情况是手机卡片副标题少显示或多显示一列,数据与保存都不受影响,可直接撤回本改动。
  • 要你做什么:无

What changes

buildMobileCardRenderer in ui/packages/plugin-grid/src/ObjectGrid.tsx: when the object's declared name field is a formula, the card's subtitle skips every shown column whose field the formula reads, and takes the next shown columns instead. The reads are the formula's record.FIELD references as collectPredicateFieldRefs (@object-ui/core) names them, the same reader this grid's projection already uses for a CEL expression's reads (objectGridQueryInputs.ts); a read through a lookup (record.account.name) names the lookup, so its column is skipped too. This holds whether or not the formula column itself is shown. A name field that is not a formula reads nothing, so its card is unchanged. Status chip and amount line are untouched.

Case list, as filed: title CASE-00037 - Demo case 29 — critical problem, subtitle 紧急 · Polar Cargo (was CASE-00037 · Demo case 29 — critical problem).

Changeset: .changeset/37010-phone-card-formula-title-subtitle.md, @object-ui/plugin-grid patch.

Read first (by risk):

  1. ObjectGrid.tsx, the titleReads block and the subtitleColumns filter in buildMobileCardRenderer.
  2. __tests__/phoneCardFormulaTitle-37010.test.tsx.

Two-minute check: cd ui/packages/plugin-grid && pnpm exec vitest run --root ../.. packages/plugin-grid/src/__tests__/phoneCardFormulaTitle-37010.test.tsx shows 3 passed.

Tests

New file ui/packages/plugin-grid/src/__tests__/phoneCardFormulaTitle-37010.test.tsx, through the real ObjectGrid card renderer at 375 px with the object schema served by the data source:

  • formula name field over the two leading columns: subtitle is 紧急 · Polar Cargo;
  • the formula column shown as well: the subtitle still skips the formula's parts;
  • CONTROL: a text name field (subject) keeps CASE-00037 · 紧急.

Acceptance notes

  • Reader choice: the platform's AST member reader for a formula's reads is analyzeRelationshipTraversals (@objectstack/formula), which planObjectFormulas in @object-ui/core uses. @object-ui/plugin-grid does not depend on @objectstack/formula, and adding it (its package.json and pnpm-lock.yaml) is outside this card's claimed file surface. This PR uses collectPredicateFieldRefs, already a dependency of this grid for the same question. The two readers differ only on spellings a name formula does not use in practice (a record.FIELD inside a string literal, a data.FIELD root); either difference can only skip a column, never draw a wrong value.
  • Seat decision on that reader question: option A, collectPredicateFieldRefs, the reader this grid's projection already uses, with no new dependency.
  • Overlap with feat(app-shell): every metadata list on ObjectGrid; 新建 on a read-only base lands in its .custom pair #36978 (also edits ObjectGrid.tsx): scripts/pm/overlap-check.mjs VERDICT clean exit 0, against origin/main and against feat(app-shell): every metadata list on ObjectGrid; 新建 on a read-only base lands in its .custom pair #36978.

Verification

All readings at head 84c9eec38eb.

New test file

phoneCardFormulaTitle-37010.test.tsx: Test Files 1 passed, Tests 3 passed.

Ablation (one run)

scripts/ablation-replace.mjs replaced the anchor !titleReads.has(c.accessorKey) with a marker. Anchor count went 1 to 0, blob 5fbd40d54cf4 to 52c21da6b1a0. Result: 2 failed and 1 passed (the control). Both failures received CASE-00037 · Demo case 29 — critical problem, which is the filed defect. After restore the blob equals the HEAD blob (5fbd40d54cf4) and git diff HEAD is empty. The first attempt was a no-op that the tool refused (the replacement was a substring of the anchor), so no test ran then. It was redone with a distinct marker.

Package @object-ui/plugin-grid

type-check (tsc --noEmit && tsc -p tsconfig.test.json) passed. vitest: Test Files 311 passed, Tests 2763 passed.

Derived gates

dispatch-gates --commands derived 39 commands. On the first pass 37 exited 0.

  • pnpm --dir ui exec vitest run scripts/ exited 1. Four tests in three files hit the 15000 ms timeout while the box was contended, and none of them touch this diff. Those three files were re-run under the lock: 231/231 passed.
  • pnpm check:type-check-debt exited 3 (lock queue-timeout, NOT MEASURED). The re-run under the lock exited 0.

--ran reconciliation on the first-pass codes: 39 derived, 38 run, 1 NOT-MEASURED, 0 UNRUN.


Generated by Claude Code

…name field reads

A list card whose object names its records with a formula name field built
from shown columns repeated those columns in its subtitle. The subtitle now
skips every shown column whose field the name field's formula reads and takes
the next shown columns instead; a name field that is not a formula is unchanged.

Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ
Co-authored-by: Claude <noreply@anthropic.com>
…ield; add the changeset

Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ
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 Nov 24, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head 84c9eec38eba672e0bf092cef29bad0e5e6e02e1 · 2026-11-24T19:27Z

Card #37010.

  • Shape. 3 files (+182/−3): ui/packages/plugin-grid/src/ObjectGrid.tsx, one new test file, one changeset (@object-ui/plugin-grid patch, Clause-②: no, Metadata-protocol: none). Not governed; no contract face (no spec, schema, skill or public export touched).
  • Fix, read against the code. In buildMobileCardRenderer, when the object's declared name field is a formula, its expression reads are collected with collectPredicateFieldRefs (ui/packages/core/src/utils/predicate-fields.ts:202, already a dependency and the reader this grid's projection uses for CEL reads; an absent expression is skipped by predicateSource), and the subtitle filter drops every shown column in that set before taking two. A lookup read (record.account.name) names the lookup, so its column is skipped too. A non-formula name field yields an empty set, so the card is unchanged there. Status chip and amount line untouched.
  • Seat decision recorded in the body: the reader is collectPredicateFieldRefs, not @objectstack/formula's AST reader (option A, no new dependency); the two differ only on spellings a name formula does not use, and a difference can only skip a column, never draw a wrong value. Accepted.
  • Tests. Three cases through the real ObjectGrid card at 375 px: formula title over the leading columns, formula column also shown, and a text-name-field control. Ablating the titleReads filter turns the two formula cases red with the filed defect text; restored blob-equal. Package vitest 2763 passed, type-check exit 0.
  • Accepted note: when every shown body column is one the title reads, the subtitle is shorter or empty — the title already carries those values; not a defect.
  • Gates. Check-runs at this head: 40 success, 13 expected skip (UI-only head), 0 failed, 0 pending. Landing K: counted by hand (UI-only head), 5 first-parent commits on main since the merge base 159113f4fe.
  • No must-fix, no should-fix.

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

Development

Successfully merging this pull request may close these issues.

Phone list card repeats the title in its subtitle when the name field is a formula over the view's leading columns

2 participants