Skip to content

fix(ui): Setup record pages show names, not ids, for sharing-rule recipients, conditions and sign-in audit rows - #30496

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-zr7jt1
Nov 5, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-zr7jt1

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

domain:ui#6 · os-sales · session_01L6bhgWs5eCv64CbCPwjWhV

Refs #30209 (rows 2 and the record-label half of row 3; rows 1, 3-rest, 4, 5 and 6 are not in this PR, see Acceptance notes)

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:Setup 的共享规则记录页,「接收方」显示用户/团队/岗位名称而不是 id,「条件」显示成「优先级 等于 紧急」这样的文字而不是 JSON;审计日志列表里登录行的「记录」列显示会话所属用户名,不再是用户 id。
  • 为什么改:管理员排查权限问题时读不懂这些页面(Setup: show what people can really do and what really changed, using names rather than ids #30209 实测)。列表页早已显示名称,记录页没把同行数据交给显示组件,条件字段也没有阅读态。
  • 风险与回滚:只动 ui 显示层,三处改动各自独立,不改任何存储或接口;回滚即还原本 PR。条件无法用可视化表达时仍显示原始 JSON。
  • 先看:ui/packages/plugin-grid/src/RecordPointerCell.tsx(读取等定义返回后再查记录,名称字段是引用时才 $expand)、ui/packages/fields/src/widgets/FilterConditionField.tsx(只读态的文字化)、ui/packages/plugin-detail/src/DetailSection.tsx。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/fields/src/widgets/__tests__/FilterConditionField.readWords-30209.test.tsx packages/plugin-detail/src/__tests__/recordFace.siblingValues-30209.test.tsx packages/plugin-grid/src/__tests__/ObjectGrid.recordPointerCell-12608.test.tsx,预期全部通过;或在控制台打开一条共享规则记录,看「接收方」是人名、「条件」是一句话。
  • 需要你做的:无,席位落地。

What changes

  • Record page faces get the record (@object-ui/plugin-detail). HeaderHighlight and DetailSection hand each read cell dependentValues (the staged record / the record), as the list grid hands its row. The recipient-picker face reads recipient_type from it, so a sharing rule's 接收方 reads the recipient's name instead of the stored id.
  • filter-condition has a read face (@object-ui/fields). The key joins WIDGET_CELL_RENDERER_TYPES and its cell (FilterConditionCell, lazy, stored text until the widget module lands) draws the widget's read-only display. That display now says a representable criteria in words, in the object's field and option labels, joined by the AND / OR word, with booleans as words and both bounds of a range; the words are the filter builder's own filterBuilder.* rows, so no language-pack key is added. A criteria the builder cannot represent still reads as the stored JSON; a non-string value reads as the text cell reads it; a read-only widget no longer refuses to speak without object_name (fields keep their api names).
  • Pointer cells name a lookup-named record (@object-ui/plugin-grid). RecordPointerCell's batched read now waits for the target definition (already in flight) and adds $expand: [nameField] when the object's name field is a reference type the viewer may read (buildExpandFields over that one field, gated by checkField once the policy has answered). sys_session is named by user_id, so the audit list's sign-in rows read "Dev Admin" instead of the user id. Any other name field is read exactly as before, with no $expand.

Tests

  • New ui/packages/fields/src/widgets/__tests__/FilterConditionField.readWords-30209.test.tsx (zh provider): one condition reads 优先级 等于 紧急; an OR group with a boolean reads 优先级 等于 低 或 已完成 等于 是; a nested criteria stays the stored JSON (control).
  • New ui/packages/plugin-detail/src/__tests__/recordFace.siblingValues-30209.test.tsx: a probe face registered under recipient-picker receives the record from the highlights strip and from the details body.
  • ui/packages/plugin-grid/src/__tests__/ObjectGrid.recordPointerCell-12608.test.tsx gains a top-level describe: a session row names its user and the read expands only user_id; a text-named record is read with no $expand (control).
  • Two registry censuses gain the new key's row: cellRenderers.objectLiteral-8596 and summaryChip.badgeFitCensus-8464 (fit side 40 → 41).

Readings (head f122316d, base c5800818)

  • Positive control: with the three source files restored to the base, 5 of the new assertions are red and both controls stay green.
  • Ablations (each restored, git diff HEAD empty): DetailSection dependentValues={data} removed → the details case red (1 failed / 1 passed); the words branch disabled (if (false)) → 2 failed / 1 passed; the $expand spread deleted → 1 failed / 4 passed.
  • Suites: fields, plugin-detail, plugin-grid and the app-shell widget-ref-cells / record-preview directories: the only reds were the four registry censuses, now carrying the new key (rerun 36 files / 453 tests green).
  • Type-check: turbo run type-check --filter=@object-ui/fields --filter=@object-ui/plugin-detail --filter=@object-ui/plugin-grid, 55/55.
  • Gates: the 35 derived dispatch gates exit 0 (vitest run scripts/ rerun alone: 171 files passed); ui check:spec-symbols, check:i18n-keys, check:unreferenced-sources, check:side-effects-array, check:phantom-deps, check:esm-specifiers, check:i18n-drift, check:new-line-citations and root check:doc-authoring exit 0. eslint on the changed files: 0 errors.

Acceptance notes

Re-measured on origin/main c5800818 with app-showcase (objectstack dev --seed-admin) and the console on vite, zh-CN, before any edit:

Row Reading on main This PR Not shipped: reason · owning lane
1 林伟's 权限集 tab: 0, 暂无相关记录 — The tab is page metadata (packages/platform-objects/src/pages/sys-user.page.ts, a record:related_list over sys_user_permission_set). Showing effective access needs a page node that calls the explain door, i.e. a page-component vocabulary entry in packages/spec plus the page edit in packages/platform-objects, then the ui block. ⛔ packages/** in this claim · spec + platform-objects (server) lanes, then ui
2 接收方 zlom5o5m8OyCwF3aBgywwFWOHKJ03mou; 条件 {"priority":"urgent"} 接收方 林伟; 条件 优先级 等于 紧急 —
3 记录 column: sign-in rows 05bdsJ9C… (a sys_session, named by its user_id lookup); other rows already named sign-in rows name the user Object labels: sys_platform_setting_audit (and others) have no zh-CN row in packages/platform-objects translations, so the label is the English source · i18n source, server/platform lane. "One sign-in writes several rows" and a default view that hides them are the audit writer and the object's list views in packages/** · server lane
4 not measured (claim ⛔) — What is secret is a server decision · server lane
5 not measured (claim ⛔, reading only) — security-sensitive picker filtering · security lane
6 queue record shows only its label; members only under Queue Members — sys_queue_member.queue is a text field holding the queue name, not a lookup, so no related list is synthesized and none can be authored without metadata: a lookup, or a sys_queue page with a members list, both in packages/plugins/plugin-sharing · server lane
  • Noted, not filed: on the same pages the Setup navigation and the sys_queue labels ("Queues", "Queue", "Display Label") read English under zh-CN; that is translation coverage in packages/**.
  • Trade-off: a filter-condition cell in a grid column now loads the widget chunk once per page that shows one (stored text until it lands).

Verification

Screenshots (zh-CN console, 1440×900 @2x) on the never-merged evidence branch:

Before (main) After (this PR)
Sharing rule record (row 2) before after
Audit list 记录 column (row 3) before after

Evidence commit 994f8a84 (removed again in 165c14ce, so the PR diff carries no images).

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgWs5eCv64CbCPwjWhV

… condition in words, and name an audit row's session by its user

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgWs5eCv64CbCPwjWhV
…ds, and lookup-named pointer records

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgWs5eCv64CbCPwjWhV
…xt values as text, and enrol the key in the renderer censuses

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgWs5eCv64CbCPwjWhV
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgWs5eCv64CbCPwjWhV
@github-actions github-actions Bot added size/l 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 5, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#6 · os-sales · session_01L6bhgUR8Nu4M7tbtgES7q2

维护者速读

  • 改了什么:共享规则记录页的「接收方」显示用户名而不是 id,「条件」用字段和选项的中文标签读成一句话(如「优先级 等于 紧急」);审计日志列表里登录行的「记录」一列显示会话所属用户的名字。
  • 为什么改:Setup: show what people can really do and what really changed, using names rather than ids #30209 走查第 2 行和第 3 行的记录名一半:管理员在这几处只看到机器 id 和 JSON。
  • 风险与回滚:只改控制台前端:记录页把整条记录交给各字段的只读显示(列表早就这样做),条件字段有了自己的只读显示(按需懒加载),指针单元格在名称字段是查找字段且查看者可读时带上 $expand。没有新语言键,无接口变化。回滚即撤本 PR。
  • 先看:ui/packages/fields/src/widgets/FilterConditionField.tsx 的 describeFilterGroup,ui/packages/plugin-grid/src/RecordPointerCell.tsx 的 nameFieldExpand。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/fields/src/widgets/__tests__/FilterConditionField.readWords-30209.test.tsx packages/plugin-detail/src/__tests__/recordFace.siblingValues-30209.test.tsx,预期全绿。
  • 需要你做的:无,席位落地。
  • 席位意见:可合。其余各行不在本 PR,卡保持打开,按归属拆分。

席位核对 — ACCEPT · head f122316

  • 形态:14 文件 +530/−24(FilterConditionField.tsx 只读句子、新 FilterConditionCell.tsx、fields/index.tsx 注册、DetailSection.tsx 与 HeaderHighlight.tsx 传 dependentValues、RecordPointerCell.tsx 的名称字段展开、测试与普查登记、changeset 三包 patch)。check-governed-merges --pr 30496:NOT governed,554 行 ≤ 3000。Refs #30209(只交第 2 行与第 3 行的记录名一半),draft,目标 main。席位逐行读过源码 diff:条件句只用结构能表示的条件,表示不了的仍显示原 JSON,空值仍是空单元格;字段 schema 没列出的仍用 api 名,选项里没有的值原样显示,不编标签。只读显示不再等 object_name,编辑态的「先选对象」提示保留。指针单元格只在名称字段是引用、且权限答复允许读该字段时才带 $expand,权限未答复时不过滤,服务端照常遮蔽;同一对象的定义读取仍只发一次,批量读取等定义落定后才发。
  • 契约:Clause-② no,Metadata-protocol none,与认领一致:没有新导出的公共类型,没有语言键增删(复用 filterBuilder.* 文案)。
  • 前提实测:dev 报告 6659268469。正对照:源码还原到 c5800818、新测试保留时 5 条新断言红、对照绿;三处消融各自红(去掉 DetailSection 的 dependentValues、句子分支置假、删掉 $expand),均已还原;四个渲染器普查已登记新渲染器,复跑 36 文件 453 测试绿;三包 type-check 55/55;派生门禁 35 条全部 exit 0。
  • 门禁 check-runs:head 上 55 个,44 success,11 skipped(ui-only diff 的预期跳过),0 红;Build & E2E UI(含 eager-closure)绿,覆盖了懒加载的条件显示模块。mergeable_state clean。
  • 接受的偏差:无。
  • 范围外去向:第 1 行(用户记录的权限集页签显示实际访问及来源)要先有 spec 页面组件词表和 platform-objects 页面改动,再到 ui;第 3 行其余(对象 zh-CN 标签、一次登录多行、默认视图)、第 4 行(配置变更的新旧值,密钥仍不显示)和第 6 行(sys_queue_member.queue 是文本字段而非查找,需 plugin-sharing 元数据)属 server 车道;第 5 行(共享规则的对象选择器)未测,归 server 车道并请 security 席一并看。这些都留在本卡,落地时转 domain:server。
  • 落地条款:中继 pr_ready + automerge_enable。合并后卡不关(Refs),席位同一笔摘掉 pm:dispatched、换回 pm:queue、domain:ui 改为 domain:server,并留一条写清交付与剩余归属的 Release 评论。

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 5, 2026 13:48
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 5, 2026 13:48
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 5174603 Nov 5, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-zr7jt1 branch November 5, 2026 14: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/l 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.

1 participant