Repository navigation
fix(core,plugin-detail,app-shell): the related list, reference rail and packaged-actions table draw a served object label as served - #30583
Merged
Conversation
…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 <noreply@anthropic.com>
…able draw the served object label Claude-Session: https://claude.ai/code/session_01L6bhgT79N7DN2Gcdsta3mm Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgT79N7DN2Gcdsta3mm Co-authored-by: Claude <noreply@anthropic.com>
…ctions language pin Claude-Session: https://claude.ai/code/session_01L6bhgT79N7DN2Gcdsta3mm Co-authored-by: Claude <noreply@anthropic.com>
… (removed in the next commit) Claude-Session: https://claude.ai/code/session_01L6bhgT79N7DN2Gcdsta3mm Co-authored-by: Claude <noreply@anthropic.com>
…the previous commit) Claude-Session: https://claude.ai/code/session_01L6bhgT79N7DN2Gcdsta3mm Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#4 · os-sales · session_01L6bhgVfPeFZkN1FP93imKU 维护者速读
席位核对 — ACCEPT · head a833e1d
Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Sales · project thread
Fixes #30486
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
.custom扩展里的改名);只有服务端没下发名称时才查前端翻译目录。打包动作读对象列表时带上会话语言。.custom扩展里把对象改名后,这三处仍显示基础包的旧译名(实测:服务端下发 Work items,界面显示 任务 / Tasks),同一个对象出现两个名字;打包动作表读对象时带的是浏览器语言而非会话语言。@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/main8e5fabe5first, live, and all three were still wrong (readings below), so none is reported as already correct.@object-ui/plugin-detailcannot import@object-ui/app-shell(app-shell depends on it), so the rule moves, function bodies unchanged, from app-shell's privatehooks/servedObjectLabel.tstoui/packages/core/src/utils/served-object-label.ts, a package both already import that holds no provider and already reads@objectstack/spec/uiat runtime. Named exports from the core entry:servedObjectLabel,servedObjectPluralLabel,metadataText,ObjectLabelLookup,ObjectPluralLabelLookup(henceClause-②: yes (widening)). app-shell's file is now a re-export, so its 30-odd importers are untouched. Core over@object-ui/reactor@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.record-related-list.tsx): an untitled block reads the related object's served definition withuseSettledSchema(objectName, ctx.dataSource), the same key and data source the innerRelatedListalready reads for its columns (the adapter's metadata cache answers both), and names the list byservedObjectPluralLabel, the bundle plural and then the humanized name as before when nothing is served.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'slabel/pluralLabel, and both names (the card title and the empty line) readservedObjectPluralLabel.PackagedActionsSection.tsx,packagedActions.tsdoc only): theGET /meta/objectread sendsAccept-Languagewith the session language (useObjectTranslation().language, also an effect dependency), and the object column draws the served label throughservedObjectLabelinstead of the bundle-firstobjectLabel.patchfor@object-ui/core,@object-ui/plugin-detail,@object-ui/app-shell.Tests
describein 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'sAccept-Language, served rename en / zh, no-label control). The existing bundle cases in those files stay as the controls for the not-served path.65c0b85f: with the three source files restored to8e5fabe5(tree only),Tests 8 failed | 27 passed (35), the 8 being exactly the new served-name cases; restored fromHEAD,git diff HEADempty.Test Files 5 passed (5),Tests 61 passed (61)(the three files plusservedObjectLabel-30390.test.tsandpackagedActions.test.ts).688f24a4: every app-shell test file importing a module that importsservedObjectLabeloruseNavTargetLabel(669 files), plus the wholeplugin-detailandcoresuites: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
claude/project-thread-28n2uz, notclaude/issue-30486-*.object_extensionincom.example.showcase.custom(labelWork item, pluralWork items, plain strings, so a zh-CN session is served the English rename too). The served list label in zh-CN isWork items, the base translation任务.任务/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.#30126row 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 --freshwith the.customrename above and a.customoverride ofshowcase_project_detailwhose Related tab holds an untitledrecord:related_listand an untitledrecord:reference_railentry forshowcase_task; Console fromui/apps/consolevite, 1440 px. Three sessions: en-US browser, zh-CN browser, and a zh-CN session in an en-US browser.8e5fabe5showcase_taskobject column, en-US / zh-CN/meta/objectAccept-Language, zh-CN session in an en-US browsersys_team(not renamed), zh-CN session in an en-US browserRecord page, zh-CN, before and after:
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
5ebc6c2415and removed in the next commit, so they never reachmain.Derived gates (35/35, 0 NOT-MEASURED)
node scripts/pm/dispatch-gates.mjs --commandson0495f150(the merge oforigin/main) derived 35 families; all 35 ran locally with exit 0,check:test-source-aliasafter one fix (6e098057: the new packaged-actions pin loaded@object-ui/i18ninside a test body; now a module-top import).--ranreconciliation: 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