Skip to content

fix(core,plugin-detail,app-shell): the related list, reference rail and packaged-actions table draw a served object label as served - #30583

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

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #30486

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:记录页上没写标题的相关列表、引用侧栏卡片,以及「设置 › 打包动作」表的对象列,改为显示服务端下发的对象名(含 .custom 扩展里的改名);只有服务端没下发名称时才查前端翻译目录。打包动作读对象列表时带上会话语言。
  • 为什么改:客户在 .custom 扩展里把对象改名后,这三处仍显示基础包的旧译名(实测:服务端下发 Work items,界面显示 任务 / Tasks),同一个对象出现两个名字;打包动作表读对象时带的是浏览器语言而非会话语言。
  • 风险与回滚:未改名的对象显示不变(服务端下发的就是目录译文)。规则从 app-shell 移到 @object-ui/core(plugin-detail 引用不到 app-shell),新增 5 个导出,app-shell 原文件改为转出,行为逐字不变。回滚即 revert 本 PR。
  • 先看:ui/packages/core/src/utils/served-object-label.ts(搬来的规则,函数体未改)、ui/packages/plugin-detail/src/renderers/record-related-list.tsx(新增一次与 RelatedList 同键同源的 schema 读取)、ui/packages/app-shell/src/views/setup/PackagedActionsSection.tsx(Accept-Language 与对象列)。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/plugin-detail/src/renderers/__tests__/record-related-list.titlePlural-11733.test.tsx packages/plugin-detail/src/renderers/__tests__/record-reference-rail.titlePlural-11733.test.tsx packages/app-shell/src/views/setup/PackagedActionsSection.test.tsx,预期全绿,其中 objectstack#30486 分组断言改名后的对象名胜过目录旧译名。
  • 需要你做的:无,席位落地。

What changes

The served-object-label rule (PR #30388, PR #30475) reaches the three sites the card names. Each was measured on origin/main 8e5fabe5 first, live, and all three were still wrong (readings below), so none is reported as already correct.

  • Rule home. @object-ui/plugin-detail cannot import @object-ui/app-shell (app-shell depends on it), so the rule moves, function bodies unchanged, from app-shell's private hooks/servedObjectLabel.ts to ui/packages/core/src/utils/served-object-label.ts, a package both already import that holds no provider and already reads @objectstack/spec/ui at runtime. Named exports from the core entry: servedObjectLabel, servedObjectPluralLabel, metadataText, ObjectLabelLookup, ObjectPluralLabelLookup (hence Clause-②: yes (widening)). app-shell's file is now a re-export, so its 30-odd importers are untouched. Core over @object-ui/react or @object-ui/i18n: about 400 app-shell and plugin-detail test files mock those two packages with factories, and core is mocked by none of them.
  • Related list (record-related-list.tsx): an untitled block reads the related object's served definition with useSettledSchema(objectName, ctx.dataSource), the same key and data source the inner RelatedList already reads for its columns (the adapter's metadata cache answers both), and names the list by servedObjectPluralLabel, the bundle plural and then the humanized name as before when nothing is served.
  • Reference rail (record-reference-rail.tsx): the rail already reads each related object's schema for its fields and name field; it now also keeps that schema's label / pluralLabel, and both names (the card title and the empty line) read servedObjectPluralLabel.
  • Packaged actions (PackagedActionsSection.tsx, packagedActions.ts doc only): the GET /meta/object read sends Accept-Language with the session language (useObjectTranslation().language, also an effect dependency), and the object column draws the served label through servedObjectLabel instead of the bundle-first objectLabel.
  • One root changeset, patch for @object-ui/core, @object-ui/plugin-detail, @object-ui/app-shell.

Tests

  • New pins, each an objectstack#30486 top-level describe in the component's existing harness file: record-related-list.titlePlural-11733.test.tsx (served rename en / zh, served label without plural), record-reference-rail.titlePlural-11733.test.tsx (card and empty line en / zh, plus a no-label control), PackagedActionsSection.test.tsx (the object read's Accept-Language, served rename en / zh, no-label control). The existing bundle cases in those files stay as the controls for the not-served path.
  • Reverse verification on 65c0b85f: with the three source files restored to 8e5fabe5 (tree only), Tests 8 failed | 27 passed (35), the 8 being exactly the new served-name cases; restored from HEAD, git diff HEAD empty.
  • Targeted run: Test Files 5 passed (5), Tests 61 passed (61) (the three files plus servedObjectLabel-30390.test.ts and packagedActions.test.ts).
  • Consumer sweep on 688f24a4: every app-shell test file importing a module that imports servedObjectLabel or useNavTargetLabel (669 files), plus the whole plugin-detail and core suites: Test Files 1274 passed | 1 skipped (1275), Tests 12687 passed | 45 skipped (12732).
  • type-check (both tsconfigs) for @object-ui/core, @object-ui/plugin-detail, @object-ui/app-shell: all Done, exit 0. eslint on the 10 changed files: 0 errors (28 existing warnings).

Acceptance notes

  • The branch is the card thread's harness-assigned claude/project-thread-28n2uz, not claude/issue-30486-*.
  • The live rig names the object through an object_extension in com.example.showcase.custom (label Work item, plural Work items, plain strings, so a zh-CN session is served the English rename too). The served list label in zh-CN is Work items, the base translation 任务.
  • Not changed, observed on the same page: the sidebar navigation entry and the authored tab label still say 任务 / Tasks. Both are their own authored labels (an app navigation item, a page tab), not an object-name lookup, so they are outside this rule.
  • #30126 row 6 (plugin-detail record-page field labels): no file overlap; this PR touches only the two renderers named above in plugin-detail.

Verification

Live: showcase objectstack dev --fresh with the .custom rename above and a .custom override of showcase_project_detail whose Related tab holds an untitled record:related_list and an untitled record:reference_rail entry for showcase_task; Console from ui/apps/console vite, 1440 px. Three sessions: en-US browser, zh-CN browser, and a zh-CN session in an en-US browser.

Reading before 8e5fabe5 after
Related list + rail title, en-US Tasks, Tasks Work items, Work items
Related list + rail title, zh-CN 任务, 任务 Work items, Work items
Packaged actions, showcase_task object column, en-US / zh-CN Task / 任务 Work item / Work item
Packaged actions, the section's /meta/object Accept-Language, zh-CN session in an en-US browser en-US zh-CN
Control: sys_team (not renamed), zh-CN session in an en-US browser 团队 团队

Record page, zh-CN, before and after:

before zh-CN
after zh-CN

Record page, en-US: before · after

Packaged actions, zh-CN: before · after. en-US: before · after. zh-CN session, en-US browser: before · after.

The screenshots are committed at 5ebc6c2415 and removed in the next commit, so they never reach main.

Derived gates (35/35, 0 NOT-MEASURED)

node scripts/pm/dispatch-gates.mjs --commands on 0495f150 (the merge of origin/main) derived 35 families; all 35 ran locally with exit 0, check:test-source-alias after one fix (6e098057: the new packaged-actions pin loaded @object-ui/i18n inside a test body; now a module-top import). --ran reconciliation: 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN. Every family CI runs is read from this PR's check-runs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgT79N7DN2Gcdsta3mm


Generated by Claude Code

…ackaged-actions table draw a served object label as served

The served-object-label rule moves from app-shell to @object-ui/core, which
plugin-detail can import; app-shell's hooks/servedObjectLabel.ts re-exports it.

Claude-Session: https://claude.ai/code/session_01L6bhgT79N7DN2Gcdsta3mm
Co-authored-by: Claude <[email protected]>
@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#4 · os-sales · session_01L6bhgVfPeFZkN1FP93imKU

维护者速读

  • 改了什么:记录页上没写标题的相关列表、引用侧栏卡片(含空项那一行),以及「设置 › 打包动作」表的对象列,改为显示服务器下发的对象名(含 .custom 扩展里的改名);服务器没下发名称时才查前端翻译目录。打包动作读对象列表时带会话语言的 Accept-Language,不再用浏览器语言。
  • 为什么改:Record surfaces that know only an object's name still show the base package's translation of a renamed object (related list, reference rail, packaged-actions table) #30486。对象在 .custom 扩展里改名后,这三处仍画基础包的旧译名(dev 实测:服务器下发 Work items,界面画 任务 / Tasks),同一个对象两个名字。
  • 风险与回滚:没改名的对象显示不变(服务器下发的就是目录译文,sys_team 对照前后都是 团队)。规则从 app-shell 私有的 hooks/servedObjectLabel.ts 原样搬到 @object-ui/core(plugin-detail 引用不到 app-shell),app-shell 原文件改为转出,30 多个引用方不动。@object-ui/core 新增导出 servedObjectLabel、servedObjectPluralLabel、metadataText 与类型 ObjectLabelLookup、ObjectPluralLabelLookup(Clause-② yes,加宽),三包 changeset 都是 patch。回滚即撤本 PR。
  • 先看:ui/packages/core/src/utils/served-object-label.ts(搬来的规则);ui/packages/plugin-detail/src/renderers/record-related-list.tsx 新增的 useSettledSchema 读取;ui/packages/app-shell/src/views/setup/PackagedActionsSection.tsx 的 Accept-Language 与对象列。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/plugin-detail/src/renderers/__tests__/record-related-list.titlePlural-11733.test.tsx packages/plugin-detail/src/renderers/__tests__/record-reference-rail.titlePlural-11733.test.tsx packages/app-shell/src/views/setup/PackagedActionsSection.test.tsx,预期全绿,其中 objectstack#30486 分组断言改名后的对象名胜过目录旧译名。
  • 需要你做的:无,席位落地。
  • 席位意见:可合。

席位核对 — ACCEPT · head a833e1d

  • 形态:11 文件 +415/−102(新 core/src/utils/served-object-label.ts +90、core index.ts +11;app-shell servedObjectLabel.ts +14/−70、PackagedActionsSection.tsx +24/−10、packagedActions.ts +4/−2;plugin-detail record-reference-rail.tsx +32/−12、record-related-list.tsx +27/−8;三份测试 +74、+67、+58;changeset +14,@object-ui/core、@object-ui/plugin-detail、@object-ui/app-shell 各 patch)。check-governed-merges --pr 30583:NOT governed(0/11),517 行 ≤ 3000。Fixes #30486,draft,目标 main,标题无 !。证据截图提交 5ebc6c24 已由 a833e1d4 移除,与 6e098057 的树相同(274b2285),树上没有 evidence/。
  • 复核面:TIER_DEFAULT(声明面:Clause-②: yes (widening),@object-ui/core 入口以具名转出新增三个函数、两个类型,本席把新文件与 origin/main 上 app-shell 原私有文件逐行比过,函数体逐字相同,只有三处注释多写了新的读者;app-shell 入口不变(原文件注明不从包入口转出,现在仍是);没有 packages/spec 路径、没有受管路径、没有收窄;Metadata-protocol: none),由本席在此写出。认领 6661824577 的这一行与文件面已由修正 6663670348 改为 yes 并补进 core 两个文件。
  • 席位逐行读:app-shell servedObjectLabel.ts 现在只剩对 @object-ui/core 的具名转出,并写明不许再长出第二份函数体。相关列表在 objectName 存在时用 useSettledSchema(objectName, ctx.dataSource) 取服务器定义,与内层 RelatedList 取列的是同一键、同一数据源,由适配器元数据缓存应答;标题顺序是手写 title(pickLocalized)→ servedObjectPluralLabel(下发的 pluralLabel,再下发的 label,都没有才查目录复数,humanizeLabel 兜底)→ 'Related'。i18n 没有 objectPluralLabel 时回调回 def.label,即 humanizeLabel(objectName),与改前相同。引用侧栏在已有的那次 schema 读取里顺带存下 label、pluralLabel,卡片标题与空项一行都走 entryTitle(),两处不会给同一对象两个名字;读取失败照旧吞掉,回落目录。打包动作的 getJson 只在有语言时加 Accept-Language,language 已进 effect 依赖,对象列改用 servedObjectLabel,没有下发 label 的行只画机器名(row.objectLabel && 守卫没变)。packagedActions.ts 只改注释。没有服务器改动,没有新文案键。
  • 前提实测:dev 报告 6663644113。改前先在 origin/main 8e5fabe5 真栈实测,三处都错(showcase objectstack dev --fresh,.custom 把 showcase_task 改名 Work item / Work items,另覆盖 showcase_project_detail 的 Related 标签页放未写标题的相关列表与引用侧栏;console vite,1440,三种会话):相关列表与侧栏 en-US 改前 Tasks、改后 Work items,zh-CN 改前 任务、改后 Work items;打包动作对象列 Task / 任务 改后 Work item;zh-CN 会话在 en-US 浏览器里 /meta/object 的 Accept-Language 改前 en-US、改后 zh-CN;sys_team 对照前后都是 团队。前后截图在 PR 正文。反向验证:三个源文件退回 8e5fabe5 时 8 红 27 绿,8 例正是新加的下发名用例,还原后 git diff HEAD 为空。目标测试 5 文件 61 例绿;消费方普查(引用 servedObjectLabel 或 useNavTargetLabel 的 app-shell 测试 669 个,加 plugin-detail 与 core 全套)1274 文件 12687 例绿;三包两套 tsconfig 的 type-check 都过;派生门禁 35 条全部 exit 0,0 NOT-MEASURED(check:test-source-alias 先红一次,由 6e098057 把 @object-ui/i18n 改到模块顶层导入后转绿)。
  • 门禁 check-runs:head 上 55 个(按名取最新一次),44 success,11 skipped,0 红;check-expected-skips --pr 30583:11 个跳过全在 main 的名册里(exit 0)。Build & E2E UI、Live E2E UI、Lint UI、Test UI 16 片与汇总、Type Check UI 与各 Type Check 均绿,Check Changeset 与 PR-body guards success(正文顶部没有席位签名行,守卫未要求)。mergeable_state clean。
  • 接受的偏差:规则的家从 app-shell 搬到 core,是 plugin-detail 能读到同一条规则所必需(app-shell 依赖 plugin-detail,反过来引用会成环),core 入口因此多五个导出,认领已修正为 Clause-② yes 并补记文件面。选 core 而不选 @object-ui/react 或 @object-ui/i18n,是因为约 400 个测试文件用工厂 mock 这两个包,而 core 没有被 mock,dev 已写明,本席同意。分支是线程指定的 claude/project-thread-*。
  • 范围外去向:同一页上侧边栏导航项与页面标签页仍是 任务 / Tasks:两者是作者自己写的标签(应用导航项、页面标签),不是按对象名查的,不在这条规则里,不立卡。Console and CLI polish from the real-user walkthrough #30126 第 6 行(plugin-detail 字段标签)由 PR fix(console): a nav entry with no icon draws its object's icon, record labels in one style, a small count axis fits, a failed entry load retries (#30126) #30573 处理,两 PR 文件不重叠。
  • 落地条款:中继 pr_ready + automerge_enable。合并后由 Fixes 关 Record surfaces that know only an object's name still show the base package's translation of a renamed object (related list, reference rail, packaged-actions table) #30486,席位同一笔摘掉 pm:dispatched 并留落地评论。

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 5, 2026 16:59
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit ad2393f Nov 5, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-28n2uz branch November 5, 2026 17:22
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

1 participant