Repository navigation
fix(showcase): translate the task detail review banner under zh-CN - #29104
Merged
objectstack-fleet[bot] merged 2 commits intoNov 2, 2026
Merged
Conversation
The record:alert on showcase_task_detail had no component id, so the page-component translation route could not address it and its title and body stayed English on a zh-CN session. Give it the id review_alert, translate its title in the zh-CN bundle, carry the body as an inline locale map (body has no key on the page-component copy face), and pin a dismissKey so a translated title does not move the dismissal key. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2gLghEqeDKTbDTC7Zd
…owcase-review-alert-zh Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2gLghEqeDKTbDTC7Zd
Contributor
Author
|
domain:devx#2 · marchtian · session_017ihL2gLghEqeDKTbDTC7Zd 席位核对 — ACCEPT ·
|
objectstack-fleet
Bot
deleted the
claude/issue-28982-showcase-review-alert-zh
branch
November 2, 2026 09:06
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 田騏 · project thread
Fixes #28982
Clause-②: no
Metadata-protocol: none
维护者速读
examples/app-showcase/src/ui/pages/task-detail.page.ts(record:alert 节点的 id、body、dismissKey)→examples/app-showcase/src/system/translations/index.ts(zh-CN 的 pages.showcase_task_detail)→ 新测试文件。pnpm --filter @objectstack/example-showcase exec vitest run test/task-detail-review-alert-zh-cn.test.ts,预期 3 passed;或中文会话打开种子任务「Design system」,提示条显示「待评审」和中文正文。What changes
The Task Detail page (
showcase_task_detail) shows arecord:alertbanner while a task is in review. On a zh-CN session it rendered in English because the node had no componentid, and page component copy is translated throughpages.NAME.components.COMPONENT_ID.KEY.task-detail.page.ts: the banner getsid: 'review_alert'(snake_case, like the page ids elsewhere in the showcase:new_project_form,project_picker).translations/index.ts: the zh-CN bundle gainspages.showcase_task_detail.components.review_alert.title= 待评审. Theenblock carries nopagesentries, and the authored English stays the default text. The showcase shipsenandzh-CNonly (objectstack.config.tssupportedLocales), so no other locale needs the key.bodydoes not go through the bundle, because the bundle has no key for it. The page-component copy face istitle / description / label / placeholder / emptyText(PAGE_COMPONENT_COPY_KEYS,packages/spec/src/system/i18n-resolver.ts), and the bundle schema is strict there. Measured on the built spec: an entry with onlytitleparses, and one withtitleplusbodyis refused withunrecognized_keys("Unrecognized key(s) on this page component translation:body").RecordAlertProps.bodyis declaredI18nLabelSchema, and the renderer reads it throughpickLocalized, so the body is now an inline locale map holding bothenandzh-CN. This follows the recorded precedent forelement:textcontentintranslation.zod.ts: the inline locale map is the ruled route for page prose, and that shape was not added to the bundle.dismissKey: 'showcase_task_review': the dismissal key defaults to the English resolution oftitle. Once the bundle translates the title, a zh-CN session would resolve that key to the translation, so a banner dismissed in one locale would come back in the other. The key is now fixed.Tests
examples/app-showcase/test/task-detail-review-alert-zh-cn.test.ts. It appliestranslateMetadataDocument('page', …)to the page with the app's own bundle, which is the same thing the REST boundary does for each request locale. It asserts the zh-CN title, that the body's locale map comes back intact, the fixeddismissKey, the English title underen, and that the zh-CN bundle still parses underTranslationBundleSchema. Its model iszh-cn-report-blocks-inline-titles.test.ts.ab085a0482and the test kept, the pin goes red (expected undefined to be 'review_alert', 1 failed and 2 passed). Restored fromHEAD,git diff HEADis empty.Acceptance notes
title/bodyunder the bundle key. Onlytitlecan go there (see above). Addingbodyto the page-component face would widen the spec (Metadata-protocol: added), and thecontentprecedent declined that for prose of the same shape. This PR stays inside the current contract.bodycannot be seen byos i18n extractorcheck:i18n-coverage. That extractor question is a known one and is out of scope here.showcase_my_work: theobject-metriclabel and description ("Open Tasks", "In Review", "At-Risk Projects") and thepage:cardtitles "Shortcuts" and "Leadership View".showcase_component_gallery: fourobject-metricblocks and anelement:button"Create Task".showcase_project_detail: therecord:line_itemsandrecord:related_listtitles "Tasks". Severalelement:textcontentstrings on those pages are plain English. Their route is the inline map, not the bundle.Verification
Head
6c6289c0c9(origin/mainmerged once, atc708de67b2). The dependency closure was rebuilt after the merge.Showcase package: typecheck, tests, validate
pnpm --filter @objectstack/example-showcase typecheck && … exec vitest run --maxWorkers=2(run under the verify lock):VERDICT command-exit 0, Test Files 43 passed (43), Tests 514 passed (514)pnpm --filter @objectstack/example-showcase validate: exit 0. No finding namesshowcase_task_detailor the banner.Derived gates (dispatch-gates --commands, 40)
check:i18n-coverage("OK (14 config(s), 426 baselined untranslated string(s), none new)"),check:page-declaration-shape,check:nul-bytesandcheck:examples-live-imports.check:dual-build-cjs-loadsexited 3 (PREREQUISITE NOT MET). It needs dist output from packages outside this diff's closure, so it is NOT MEASURED here and is left to CI.--ranreconciliation: "40 derived famil(ies) accounted for — 39 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)".Changeset: none.
@objectstack/example-showcaseisprivate: trueand publishes nothing, so the PR carriesskip-changeset.🤖 Generated with Claude Code