Repository navigation
fix(app-shell): draw a served report, page or dashboard label as served in the Console header, report index and recent list - #30308
Merged
Conversation
…ed in the Console header and recent list The header's report crumb and page title, the app report index and the recent-items list handed the label a /meta read served to the useObjectLabel catalog lookup as its fallback, so the packaged catalog key won and re-applied the base package's translation over the server's answer for an overridden item. The served label is now drawn as given; the catalog is asked only when no served label is at hand. Claude-Session: https://claude.ai/code/session_01WGufzjFKVx21wuZt6HYZ3J Co-authored-by: Claude <noreply@anthropic.com>
… header, report index and recent list Adds a changeset for the served-label fix. Claude-Session: https://claude.ai/code/session_01WGufzjFKVx21wuZt6HYZ3J Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzjFKVx21wuZt6HYZ3J Co-authored-by: Claude <noreply@anthropic.com>
… served-label rule reads Three suites served an English label in a zh-CN session and relied on the client catalog to translate it over the served one. The Console's catalog is the server's own /i18n/translations answer, and the server translates a /meta label with it, so a zh-CN session holds the translated label; the fixtures now serve that. Claude-Session: https://claude.ai/code/session_01WGufzjFKVx21wuZt6HYZ3J Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#1 · os-support-ai · session_01WGufzfE4V9fzZgJLrLDmMC 维护者速读(席位终稿)
席位核对 · ACCEPT · head
|
This was referenced Nov 5, 2026
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 Yibo Wang · project thread
Fixes #30244
Clause-②: no
Metadata-protocol: none
维护者速读
.custom覆盖包里给已安装包的报表或仪表盘改了名,服务端按 i18n: an override's own label loses to the base's translation on page, dataset, app and book, and a translation in the .custom pair never wins on any type #30193 的顺序返回新名字,Studio 也显示新名字;但 Console 拿着服务端的标签去查词典,词典里基础包的旧译名又把它盖了回去,用户在页眉和最近列表看到的是旧名字。ui/packages/app-shell/src/layout/AppHeader.tsx报表与页面两个分支;②ui/packages/app-shell/src/hooks/useNavTargetLabel.ts仪表盘分支(草稿标签仍走词典);③ui/packages/app-shell/src/hooks/useRecentItemLabel.ts页面与报表分支。pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/AppHeader.servedLabels-11295.test.tsx packages/app-shell/src/hooks/__tests__/useRecentItemLabel.test.tsx packages/app-shell/src/views/__tests__/AppReportIndex-13020.test.tsx,预期 3 个文件 49 个测试全部通过。What changes
/metaread (or the app bundle) served is already translated by the server, by its label order for an overridden item (i18n: an override's own label loses to the base's translation on page, dataset, app and book, and a translation in the .custom pair never wins on any type #30193), so it is drawn as given. The catalog key (useObjectLabel'sreportLabel/pageLabel/dashboardLabel) is asked only when no served label is at hand: the humanized slug, an item served with no label, a pending draft's label. This is the rule the header's dashboard branch already follows (objectui#11295).AppHeader.tsx: the report crumb and the page's phone title.appReportIndex.ts(useAppReportEntries): a report row's label.useRecentItemLabel.ts: a page row and a report row.useNavTargetLabel.ts: the dashboard target, which labels a recent dashboard row and an unlabelled sidebar entry that opens a dashboard. A pending draft's label still goes through the catalog.pageLabel,reportLabelanddashboardLabelstay the catalog lookup for text no server translated, because some of their callers pass exactly that:plugin-dashboard'sDashboardRendererpasses a schema'sheader.title, and every caller ofappLabelpasses a keyed label the client translates. Flipping a helper would have changed those callers too. Their docblocks now say that a caller holding a served label draws it as given. Adding a served variant touseObjectLabelwas weighed and not taken: 148 test files mockuseObjectLabelwith a fixed member list, and the caller-side form needs no new member.RecentApps.labelAtRender-11678,useRecentItemLabel.readsByName-29235,useNavigationSync.standardEntryLocalizes-11201) served an English label in a zh-CN session and let a client catalog key translate over it. The Console's catalog is the server's own/api/v1/i18n/translations/:localeanswer (ui/apps/console/src/loadLanguage.ts), and the server translates a served label with that same catalog, so that world does not occur: measured on the showcase,pages.showcase_task_scheduleis absent from the server's zh-CN catalog and the page is served in English;pages.showcase_capability_mapis present and the page is served as 能力地图. The fixtures now serve what the server serves in that language; each suite's assertion is unchanged.Per-caller reading (what each caller holds)
AppHeaderreport crumbmetadata.reports(/meta/report), translated by the serverAppHeaderpage title/meta/pageby nameuseAppReportEntriesmetadata.reportsuseRecentItemLabelpage / report/metaby nameuseNavTargetLabeldashboard/meta/dashboard;_draftsA language switch does not leave a served label stale:
ConsoleShellclears the adapter cache and remountsMetadataProviderwithkey={language}, and the app bundle reads live inside it, so every served label is read again in the new language.Tests
AppHeader.servedLabels-11295.test.tsx(report crumb and page title, en and zh-CN, renamed / unedited / not served / no catalogue entry); one inuseRecentItemLabel.test.tsx(report, page and dashboard each on its own cell, plus controls); one inAppReportIndex-13020.test.tsx(renamed, unedited, served with no label). Controls: an item the read did not serve, or served with no label, is still named by the catalog key; en with no catalogue entry keeps the humanized slug or machine name.origin/main31260ca8withgit restore --source, markers counted at 0 on disk, restored withgit checkout HEAD --,git statusclean after): 8 failed | 41 passed. The 8 are exactly the renamed cells (report crumb en/zh, page title en/zh, report index, recent report, recent page, recent dashboard); every control stayed green.Test runs
Test Files 3 passed (3),Tests 49 passed (49),VERDICT command-exit 0.Test Files 3 failed (3),Tests 8 failed | 41 passed (49).AppHeader,UnifiedSidebar, Home, the report index or the recent surfaces):Test Files 3 failed | 121 passed (124),Tests 4 failed | 936 passed (940). The 4 reds were the three fixture suites above; after the fixture change:Test Files 3 passed (3),Tests 11 passed (11).Test Files 30 passed (30),Tests 290 passed (290).origin/main(head 0aa33ca), the touched suites plus the whole@object-ui/i18npackage:Test Files 101 passed (101),Tests 1503 passed | 13 skipped (1516).pnpm --filter @object-ui/app-shell run type-checkandpnpm --filter @object-ui/i18n run type-check:VERDICT command-exit 0.eslinton the changed files: 0 errors.Live (showcase, zh-CN)
The CRM example ships no report, so the live leg ran on the showcase (
pnpm dev -- --fresh, the Console fromui/src through Vite). Overrides were written the way Studio's Customize writes them:POST /api/v1/packages/com.example.showcase/ensure-customization(paircom.example.showcase.custom), thenPUT /meta/TYPE/NAME?package=com.example.showcase.custom&mode=draftwithoverrides: { package: 'com.example.showcase', basedOn: '0.1.0' }and a newlabel, then publish.Accept-Language: zh-CNshowcase_hours_by_status(item and list)showcase_ops_dashboardshowcase_capability_mapThe report and the dashboard follow the #30193 order on
main. The page does not yet: the server passes nopackagedBasefor a page (PACKAGED_BASE_ACCESSORSlists object, dashboard, view and report), which is #30062's server half. The page caller takes the same rule anyway; it is unmeasurable until #30062 lands, with the reading above as its before.origin/mainuiAcceptance notes
mainthe server passes nopackagedBasefor an app either, so an overridden app is served the base's translation today and the Console agrees with it. The app callers (about sixteen: the header, the app switcher, the sidebar, Home, AI chat, the no-access state and the report index's other-apps list) passresolveKeyedI18nLabel(app.label, t), which may be a keyed label the client translates, so a served-first rule there has to tell a served string from a keyed label first. Raised to the seat as an open question; it can ride with Declared overrides: a mapping override publishes but is never served, doc and mapping overrides cannot be restored, and an override's label can be hidden by translation #30062.useNavTargetLabeland the recentobjectrow (objectPluralLabel) still ask the catalog over the served label. The server keeps an overridden object's own text (it passespackagedBasefor object and view), so a renamed object would show its base translation in the sidebar and recent list. Reported to the seat for a family card.useNavTargetLabel.ts; the recent list's dashboard row is labelled through it, so it is touched here.Verification
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat 0aa33ca: 35 commands, each run with its exit code captured before any pipe, all 35 exit 0;--ranreconciliation: 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN, exit 0.pnpm --dir ui exec vitest run scripts/ran underos-verify-lock..changeset/30244-served-labels-console-header.md,@object-ui/app-shellpatch, both declaration lines.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzjFKVx21wuZt6HYZ3J