Repository navigation
fix(app-shell): draw a served app label as served on every Console surface that names an app - #30443
Queued
objectstack-fleet[bot] wants to merge 4 commits into
Queued
objectstack-fleet[bot] wants to merge 4 commits into
objectstack-fleet[bot] wants to merge 4 commits into
Conversation
…rface that names an app Claude-Session: https://claude.ai/code/session_01L6bhgX1ZNco5W3wXZFLVbh Co-authored-by: Claude <noreply@anthropic.com>
…hangeset Claude-Session: https://claude.ai/code/session_01L6bhgX1ZNco5W3wXZFLVbh Co-authored-by: Claude <noreply@anthropic.com>
…bel (removed in the next commit) Claude-Session: https://claude.ai/code/session_01L6bhgX1ZNco5W3wXZFLVbh Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgX1ZNco5W3wXZFLVbh Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#5 · os-sales · session_01L6bhgVwQZbHRRM9CaXeKif 维护者速读
席位核对 — ACCEPT · domain:ui#5 · head
|
objectstack-fleet
Bot
added this pull request to the merge queue
Nov 5, 2026
Any commits made after this event will not be merged.
This branch has not been deployed
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
domain:ui#5 · os-sales · session_01L6bhgVwQZbHRRM9CaXeKif
Fixes #30311
Clause-②: no
Metadata-protocol: none
维护者速读
.custom配对包里给已安装应用改名后,服务端(fix(metadata-protocol,rest): a .custom pair's declared override is labelled in the ruled order on every /meta read #30353)已按裁定顺序返回新名字,但前端又用基础包的apps.NAME.label译文盖回去,中文下仍显示旧名。ui/packages/app-shell的读取顺序;草稿预览(?preview=draft)、键式标签、无标签应用仍走前端词条,未改名的应用显示不变。回滚即撤本 PR,无数据迁移。ui/packages/app-shell/src/hooks/useServedAppLabel.ts(新 helper 的取值顺序),再看layout/AppSwitcher.tsx一处调用点。pnpm --dir ui exec vitest run packages/app-shell/src/hooks/__tests__/useServedAppLabel-30311.test.tsx,预期 18 条全绿;修复前的取值顺序下其中 5 条是红的。What changes
useServedAppLabel(ui/packages/app-shell/src/hooks/useServedAppLabel.ts).appLabel(app)draws a servedlabel(a string, or an inline locale map resolved bymetadataText) as given;appDescription(app)does the same fordescription. The bundle (useObjectLabel().appLabel/appDescription, theapps.NAME.labellookup) is asked only for text no server translated: an item stamped_draft: trueby?preview=draft, a keyed{ key, defaultValue }label (still resolved throught, as before), or an app with no label / description.useObjectLabel().appLabel({ name, label: resolveKeyedI18nLabel(app.label, t) })now callsuseServedAppLabel().appLabel(app): 17 call sites in 11 files, taken from the tree atfdd06415(AppSwitcherx3,AiChatPagex4,HomePagex2,UnifiedSidebar,AppHeaderhidden-app menu,AppNoAccessEmptyState,AppCardlabel and description,HomeAppsStrip,MarketplacePage,MarketplacePackagePage,AppReportIndexView).useNavTargetLabel.tsandui/packages/i18n/**are untouched (claim fences); the hook only imports the exportedmetadataText..changeset/30311-served-app-labels.md(@object-ui/app-shellpatch).Why
Since #30353 the server serves an overridden app's label in the ruled order (the
.custompair's own text over the base package's translation). The Console handed that served label to the bundle lookup as its fallback, so the base package'sapps.NAME.labeltranslation won it back and a renamed app kept its old name on zh-CN. The object / view half of #30311 landed in #30388 with the same served-first rule; this is the app half.Tests
ui/packages/app-shell/src/hooks/__tests__/useServedAppLabel-30311.test.tsx(new, 18 cases): the real hook over the realuseObjectLabelinside a realI18nProviderwith a packaged catalogue, en and zh-CN: a renamed served label and description draw as served; an unedited one shows the server's translation; an inline locale map resolves in the active language; controls for a_draftitem, a keyed label, an absent / empty label and a translation-only description keep the bundle. Plus a census: no non-test source underapp-shell/srcother than the hook destructuresappLabel/appDescriptionfromuseObjectLabel()(with a positive control that the walk reaches the hook andAppSwitcher.tsx, and that the pattern matches the banned shape).Acceptance notes
71a58ff3and removed again in the next commit. The PR squash-merges, so they never reachmain; the links below point at that commit.resolveKeyedI18nLabel(app.label, t)without the bundle, so it showed the served name before this PR and is unchanged.Verification
Live, showcase --fresh, zh-CN, Console from ui/ src through Vite, 1440 wide
Override written the way the platform takes it:
POST /api/v1/packages/com.example.showcase/ensure-customization(paircom.example.showcase.custom, created), thenPUT /api/v1/meta/app/showcase_app?package=com.example.showcase.custom&mode=draftwith the served app body,label: Showcase Hub (renamed-30311)andoverrides: { package: 'com.example.showcase', basedOn: '0.1.0' }, thenPOST /api/v1/meta/app/showcase_app/publish?package=com.example.showcase.custom(seq 2).GET /meta/app/showcase_appthen servesShowcase Hub (renamed-30311)under bothAccept-Language: zh-CNanden; the zh-CN catalogue keepsapps.showcase_app.label= 功能展示.origin/mainapp-shell sources (fdd06415, restored into the tree, Vite--force)/apps/showcase_apppage text matchesScreenshots (commit
71a58ff3):before app ·
after app ·
before Home ·
after Home
Tests, ablation, typecheck, lint (sources at 6f7c06c)
Test Files 1 passed (1),Tests 18 passed (18), lock VERDICT command-exit 0.scripts/ablation-replace.mjs, anchor 1 to 0, restored blob == HEAD,git diff HEADempty): the hook's served-text rung replaced byreturn undefined(the old bundle-first order) turns exactly the 5 predicted cells red: renamed label en / zh-CN, inline locale map, renamed description en / zh-CN;Tests 5 failed | 13 passed (18).AppSwitcher.tsxback onuseObjectLabel()turns the census red naminglayout/AppSwitcher.tsx;Tests 1 failed | 17 passed (18); restored, blob == HEAD.ui/that names one of the 11 changed modules orappLabel(310 files):Test Files 310 passed (310),Tests 2598 passed (2598), lock VERDICT command-exit 0.turbo run type-check --filter=@object-ui/app-shell:Tasks: 68 successful, 68 total, VERDICT command-exit 0.react-hooks"Cannot create components during render" inAppCard.tsxandHomeAppsStrip.tsx) are onorigin/mainunchanged.ui/scripts/check-new-cross-file-line-citations.mjs: 0 new, exit 0.Derived gates (dispatch-gates --commands, head 6f7c06c)
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderives 36 commands from 14 paths; each was run with its exit code captured before any pipe: all 35 node / pnpm check commands exit 0, andpnpm --dir ui exec vitest run scripts/ran underos-verify-lockwith--maxWorkers=2(result in the os-dev-report on #30311). The two evidence commits add and remove the same files, so the derived set is unchanged at the final head.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_01L6bhgX1ZNco5W3wXZFLVbh
Generated by Claude Code