Skip to content

fix(plugin-detail): lead the derived related table with the record name - #30090

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-2heymj
Nov 4, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-2heymj

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

Fixes #30033

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么: 关联列表在关系上没有声明列时,列取自子对象的 highlightFields,而它按设计从不含记录名称。现在用 @object-ui/core 现成的 leadWithNameField(ADR-0079:nameField,否则平台推导的名称字段)把名称放到第一列,高亮字段跟在后面;高亮里本来就有名称时只出现一次。没有 highlightFields 时的字段遍历同样让声明的名称领头。
  • 为什么改: 客户页的「商机」页签只看到金额、日期、概率,五行金额分不清是哪一单;唯一的链接是金额。「联系人」只剩邮箱,「活动」只剩类型。
  • 风险与回滚: 只改 RelatedList.tsx 的派生列;作者在关系上声明的列原样不动,highlightFields 含义、高亮条和概览紧凑面板都没碰。名称列照样过 FLS、脱敏、外键剔除与全空剔除。@object-ui/plugin-detail patch。回滚 = revert 本 PR。
  • 先看: ui/packages/plugin-detail/src/RelatedList.tsx 中 effectiveColumns 的 declaredHighlights 分支与字段遍历排序后的 leadWithNameField 三行;测试 RelatedList.enlargedListGrid-28865.test.tsx 末尾的 objectstack#30033 describe。
  • 两分钟验证: pnpm --dir ui exec vitest run packages/plugin-detail/src/__tests__/RelatedList.enlargedListGrid-28865.test.tsx,预期 18 passed;或在 example CRM 打开 Acme Corp 的「商机」页签,第一列是「商机名称」且可点开记录。
  • 需要你做的: 无,席位落地。

What changes

ui/packages/plugin-detail/src/RelatedList.tsx, effectiveColumns, the two paths taken when the relation declares no columns:

  • highlightFields path. The declared highlights now go through leadWithNameField(objectSchema, declaredHighlights) before the existing normalize, redaction, parent-key, FLS and empty gates. That helper is the one @object-ui/core already exports for exactly this (a synthesized list led by the record's name; the console's object list tabs and InterfaceListPage call it): the declared nameField (ADR-0079), else the type-aware derivation, moved to the front and listed once. It adds nothing when the name has no field definition, is hidden, or the derivation lands on a system-managed field. Because it runs before the gates, a name the reader may not read, a redacted one, or one that is the key back to the parent record is still dropped.
  • Field walk (child declares no highlightFields). After the existing priority sort, the declared or derived name is moved to the front only if it is already among the surviving entries, so a field the walk filtered out never comes back. The name-ish ranking stays as the fallback order.
  • Authored columns (columns on the relation) take the first branch, which is untouched: drawn exactly as declared.
  • Who reads this set. The enlarged tab hands object-grid these keys, and the grid auto-links its first column to the record (pinned by the auto-linked primary field gets the same anchor in plugin-grid's ObjectGrid.linkCellAnchor.test.tsx), so the name is now the row's link. The non-enlarged table (data-table, through sortableColumns / tableColumns) reads the same effectiveColumns, so it gets the same lead. Two more readers of effectiveColumns[0] and the key list move with it: the phone card gallery's titleField (now the name) and the CSV export's field list (now includes the name). The compact panels on 概览 return before any of these and are unchanged.
  • titleFormat. leadWithNameField answers in field space: a legacy titleFormat is a render-only template with no column behind it, so a titleFormat-only object leads with the field the platform derives (pinned below), not the formatted title.
  • No spec key. Metadata-protocol: none, Clause-②: no: no export, key or accepted value changes. Changeset: @object-ui/plugin-detail patch.

Tests

New top-level describe in RelatedList.enlargedListGrid-28865.test.tsx (the enlarged face's shared harness), 7 cases:

  • highlightFields that omit the name (['account', 'amount', 'close_date', 'probability'], as crm_opportunity declares): the grid's columns are ['name', 'amount', 'close_date', 'probability'] (the parent key account is dropped as before).
  • A declared nameField that is not name-ish (deal_title) leads the same way.
  • The name listed in highlightFields too: shown once, first.
  • CONTROL: columns declared on the relation are drawn exactly as declared, no name added.
  • The non-enlarged table reads the same set: data-table columns lead with name.
  • No highlightFields: a declared name leads the field walk.
  • titleFormat with no nameField: the column is the derived field (code), not the formatted title.
Runs
  • New file, fix in place: Test Files 1 passed (1), Tests 18 passed (18).
  • Ablation 1, scripts/ablation-replace.mjs replacing leadWithNameField(objectSchema, declaredHighlights).map(normalizeColumn) with declaredHighlights.map(normalizeColumn) (anchor 1 to 0, blob edff8db6 to eed0f11d): 5 failed, 13 passed. Red: the highlight case (expected [ 'amount', 'close_date', …(1) ]), the non-name-ish nameField, the name-once case, the non-enlarged table, the titleFormat case. Restored: blob equals HEAD, git diff HEAD empty.
  • Ablation 2, deleting the walk's entries.unshift(...entries.splice(leadAt, 1)) line: 1 failed (no highlightFields: a declared name leads the field walk too), 17 passed. Restored the same way.
  • The tests import ../RelatedList from source, so no dist rebuild sits between the mutation and the run.
  • Whole @object-ui/plugin-detail suite under the lock, before the main merge: Test Files 369 passed | 1 skipped (370), Tests 3260 passed | 18 skipped (3278).

Acceptance notes

  • Browser check, examples/app-crm dev boot (pnpm dev:crm -- --fresh), Console from ui/ source through vite, zh-CN, dev admin, Acme Corp. Before = RelatedList.tsx at origin/main c23501b2b, after = this branch; vite restarted between the legs and the served module checked for the change each time. Headers read off the page:

    Tab Before After Row link after
    商机 on Acme Corp #, 金额, 预计成交日期, 赢单概率 (%), 操作 #, 商机名称, 金额, 预计成交日期, 赢单概率 (%), 操作 Acme — Year-Ago Renewal → the opportunity record
    联系人 on Acme Corp #, 邮箱, 操作 #, 姓名, 邮箱, 操作 Ada Lovelace → the contact record
    活动 on an opportunity #, 活动类型, 截止日期, 联系人, 客户, 操作 #, 主题, 活动类型, 截止日期, 联系人, 客户, 操作 Product Demo — Globex New CRM → the activity record

    Before, the row link text was 75,000.00, ada@acme.example and 会议. 联系人 resolves through its declared nameField: 'full_name' (a formula); 商机 and 活动 declare none and lead with the derived name / subject. Screenshots (before-*.png, after-*.png, plus *-readings.json) are in the project's ui-orders/30033-shots/ folder.

  • The non-enlarged face. Measured in code: it reads the same effectiveColumns, so it is fixed in the same place and pinned above. Measured in the browser: on the example CRM's account and opportunity record pages the 概览 tab draws only the compact panels (zero tables on either page), so there is no body table there to photograph.

  • maxColumns. The derived set is still capped at maxColumns (default 6), and the name now takes one of those slots, so a child with six or more highlights shows one highlight fewer.

Verification

All on head 8408edf6 (this branch merged with origin/main d79eecfe5; the merge brought no change under ui/packages/plugin-detail/ or core's record-title.ts), after a full turbo run build of the merged tree (119/119), under scripts/pm/os-verify-lock.sh:

  • pnpm --dir ui --filter @object-ui/plugin-detail run type-check (both programs; the test file is in tsconfig.test.json's file list): exit 0.
  • npx eslint src/RelatedList.tsx src/__tests__/RelatedList.enlargedListGrid-28865.test.tsx from the package: 0 errors.
  • node scripts/check-sdui-manifest.mjs: exit 0, manifest intact (106 components).
  • node scripts/pm/dispatch-gates.mjs --commands derived 35 gates over the 3 changed paths; all 35 ran, all exit 0; --ran reconciles 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN.
  • The @object-ui/plugin-detail vitest suite ran before the merge (above); the merge touched nothing it reads from source. The other families are this PR's CI check-runs.

Human Minimum

  • 1. No packages/spec change.
  • 2. No new names.
  • 3. No formatter ran; eslint reports 0 errors on the touched files.
  • 4. One issue, one branch, one pull request.
  • 5. Changeset @object-ui/plugin-detail patch, both declaration lines in it and here.
  • 6. n/a, packages/spec untouched.
  • 7. No hand edits to generated or release-owned docs.
  • 8. Title, body and comments are in English, except the Chinese maintainer brief above, which the dispatch contract asks for.

Generated by Claude Code

With no columns declared for the relation, the related table took its
columns from the child's highlightFields, which never list the record's
title. Lead that set (and the field walk) with the record's name through
core's leadWithNameField, listed once, so the enlarged grid's first,
auto-linked column names the record.

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

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-support-ai · session_01WGufzjDyeFwq6AuFu3vwTd

维护者速读(席位终稿)

  • 改了什么:记录页「相关」标签里的放大表格,第一列现在是子记录的名称(商机名称、联系人姓名、活动主题),点名称就能打开那条记录。
  • 为什么改:关系上没声明列时,表格只取子对象的 highlightFields,这组字段本来就不含标题。结果表格里只有金额、日期,看不出是哪笔商机、哪个联系人,行链接落在第一个数值上。
  • 风险与回滚:低。只改「未声明列」这条路径。作者在关系上声明的列照原样显示,highlightFields 的含义、高亮条和概览紧凑面板都不动,也不改服务端或 spec。回滚即 revert 本 PR。
  • 先看:RelatedList.tsx 中 highlightFields 路径改走 core 已有的 leadWithNameField,以及字段遍历把名称挪到最前。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/plugin-detail/src/__tests__/RelatedList.enlargedListGrid-28865.test.tsx。
  • 需要你做的:无。这不是受管面,CI 全绿后席位负责落地。
  • 席位意见:ACCEPT。

席位核对 · ACCEPT · head 8408edf6dc78719ce017aeebbce95ecf9639bb94 · 2026-11-04T13:07Z

  1. Shape: draft, Fixes #30033. One changeset (@object-ui/plugin-detail patch, Clause-②: no / Metadata-protocol: none). 3 files, +169/−1. check-governed-merges --pr 30090: NOT governed.
  2. Fix, read by the seat:
    • The highlightFields path runs the set through core's existing leadWithNameField (ADR-0079: nameField, else the derived title field), so the name leads and is listed once. It then passes the unchanged redaction / parent-key / FLS / empty gates, so an unreadable or redacted name, or a name that is the key back to the parent, is still dropped. No new name reader was built, as the order asked.
    • The field walk (child with no highlightFields) only moves the name to the front when it already survived the walk's filters. A dropped field never comes back.
    • Authored relation columns are untouched (CONTROL pinned).
    • Order item 4: the non-enlarged data-table reads the same effectiveColumns, so it is fixed in place and pinned.
    • titleFormat-only objects lead with the derived field, not the formatted title (leadWithNameField works in field space). This is acceptable for this card.
  3. Evidence:
    • 7 new cases (18/18 in the file). Ablation 1 (highlight path) turns 5 red; ablation 2 (walk lead) turns 1 red.
    • The whole plugin-detail suite passes (3,260 tests), type-check 0, and 35/35 derived gates exit 0 (--ran: 0 NOT-MEASURED).
    • Browser on app-crm (Acme Corp, zh-CN). The seat read the readings and the after shot:
      • 商机: # / 金额 / … → # / 商机名称 / 金额 / …, row link «Acme — Year-Ago Renewal» → opportunity record
      • 联系人: # / 邮箱 → # / 姓名 / 邮箱
      • 活动: # / 活动类型 / … → # / 主题 / 活动类型 / …
      • Shots: /mnt/project-files/ui-orders/30033-shots/
  4. Noted, not a blocker: the derived set stays capped at maxColumns (default 6), so a child with 6+ highlights now shows one fewer highlight. The name is worth the slot.
  5. Landing: ordinary queue. When every check on this head is green or expected-skip: relay pr_ready + automerge_enable, follow to MERGED, and record the landing on Record page related tab: the enlarged table has no record name — a rep sees five amounts and cannot tell which deal is which #30033.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 4, 2026 13:25
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit f68b47c Nov 4, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-2heymj branch November 4, 2026 13:44
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.

Record page related tab: the enlarged table has no record name — a rep sees five amounts and cannot tell which deal is which

1 participant