Repository navigation
feat(spec): Studio metadata-form select choices are translatable (metadataForms options slot) - #37569
Conversation
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 4e7ceb6eb638056c54a36314956642ae2a3065f3 && git checkout 4e7ceb6eb638056c54a36314956642ae2a3065f3
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6 fa2b9fc7dfa26ab486be4a9a604b5d6922da414a && git checkout -B drift-repro 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6 && git merge --no-ff fa2b9fc7dfa26ab486be4a9a604b5d6922da414a
node scripts/docs-audit/affected-docs.mjs --json 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6
|
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Re-run once · 2026-11-26T14:10Z · head 8f1f70f · run 45830682855 One red on this head: Test Core (5/10), job 139947827254. The failing case is The seat judges this a flake, for three reasons:
So the failed jobs are re-run once through the relay. If the case fails a second time, that is a real red and the area thread chases the cause. |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Read: card #36950 (body and both comments), this PR's body, file list and net diff against ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix. One should-fix, owing a delta review. S1 (should-fix) — the changeset says
Nits:
Out-of-diff notes (read, not reviewed):
Implemented-by: VERDICT: PASS |
…; the resolver table names option labels Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Delta round on the record in comment 7195508409 (head The delta is one commit over two prose files, 4 lines in and 4 out: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. S1: closed. What closes it, read on the tree.
The PR body's "Spec, translation slot" bullet carries the corrected wording too, and adds that an alias row is a rename hint and not an accepted spelling. No other file in the diff calls the two spellings accepted: a search of the net diff outside the generated packs finds the word only on the The delta, read in full.
Nits:
Out-of-diff notes (read, not reviewed), both carried from the earlier record and unchanged by the delta:
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head fa2b9fc · card #36950 · area s2-ux-T · 2026-11-26T15:38ZL1 checklist
Tier: H (over 3,000 changed lines). Landing: hand-off to the approver by the next stroke; ⛔ the seat does not merge. |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Tier H hand-off · 2026-11-26T15:39Z · head fa2b9fc · approver 维护者速读
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 45853999754 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 重投 · head fa2b9fc · 2026-11-26T16:33ZThe merge queue dropped this PR (CI_FAILURE) on merge-group run 45853999754, after os-zhuang queued it at this head (2026-11-26T15:56Z). The only red job is
|
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 更正 · 重投 7197819250 · 2026-11-26T17:06ZThe seat's re-queue at 16:34Z was wrong for this PR. Merge-group run 45860023058 was refused by
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 45878070989 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
…e a select's options in Chinese under zh-CN (objectstack-ai#37698) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuPE7uyDAJyqjwwMzomWv5ff)_ Fixes objectstack-ai#37607 Clause-②: no Metadata-protocol: none Skills-docs: none (no page under `skills/**` names the console's curated inspector overlay) ## 维护者速读 - 用户能看到什么变化:中文界面下,Studio 里页面检查器的「类型」「记录操作」下拉,和报表、仪表盘检查器的「默认时间段」下拉,选项现在显示中文(例如「记录页」「抽屉(右侧预览)」「本季度」),不再是英文选项配中文标签。用词和平台中文翻译包、服务器下发的表单完全一致,也和报表/仪表盘页面上时间段筛选按钮的用词一致。英文界面不变。 - 为什么做:objectstack-ai#37569 给平台翻译包加了选项名的位置,但这几个检查器读的是控制台自己的翻译表,没读到。 - 出错会怎样:只影响下拉选项的显示文字,存进去的值不变,不影响数据。 - 要你做什么:无。 ## What changes - **`ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts`**: the `page` rows `type` and `interfaceConfig.recordAction` and the `report` row `dateRange.defaultRange` gain `options: { <value>: … }`, the slot `resolveMetadataFormLabels` reads since objectstack-ai#37569. Each map is the platform pack's map (`packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts`), copied as is. The header now lists option names among the strings the table carries. - **`metadata-form-i18n.ts`**: the `dashboard` row `dateRange.defaultRange` gains the same map. - **`default-period-labels.ts` retired**, with its calls in `ReportDefaultInspector.tsx` and `DashboardDefaultInspector.tsx` (and their now-unused `useObjectTranslation`). It renamed the Default Period options from the console's `dashboard.filters.range.*` rows for zh only; the overlay names them now, and the platform words equal those rows (pinned below). - **New pin `metadata-form-option-names.test.ts`**: - each option map in `ZH_CN_SPEC_FORMS` equals the platform pack's map, byte for byte (`JSON.stringify`), and the table names exactly the three expected rows; - the platform pack names options on no other row of the `page` / `report` / `dashboard` / `view` forms, so a new one is copied rather than missed; - for each of the four selects, every option `getPageForm` / `getReportForm` / `getDashboardForm` renders under `zh-CN` reads the pack's name (this is what pins the dashboard map, which lives in `metadata-form-i18n.ts`); - one named zh option per form (记录页, 抽屉(右侧预览), 本季度, 近 30 天), and an `en-US` control keeping the spec's English. The pack is read from the checkout's source with a run-time `import()` (a data-only module whose one import is type-only). - **`ReportDefaultInspector.defaultPeriodLabels-36835.test.tsx`**: no longer imports the retired helper. A new case pins the zh names `getReportForm('zh-CN')` gives to the zh pack's `dashboard.filters.range.*` / `dashboard.filters.custom` rows the period chip reads, beside the existing en case; the rendered zh case is unchanged and passes through the new route. - **Changeset**: `@object-ui/app-shell` patch. Small calls made here (no card): - The card prefers reading the names from a served or bundled form's slot. The curated inspectors render the console's own copy of the spec form, and this table's documented posture is data-only with no runtime import (it sits on the Pending changes sheet's eager graph), so the route is the card's second one: copy, plus a byte-equality pin against the pack. - `default-period-labels.ts` is retired in full rather than reduced: the slot now covers everything it did (it was zh-only), and the period-chip parity it guarded is kept by the objectstack-ai#36835 test. ## Why Out-of-diff note 1 of the Contract review record 7195508409 on PR objectstack-ai#37569: under zh-CN the curated page, report and dashboard inspectors showed English select options beside Chinese labels, and objectstack-ai#36950's slot did not reach them. ## Verification Head `8df05bb67`: - `pnpm --dir ui exec vitest run` on `metadata-form-option-names.test.ts`, `metadata-form-i18n.test.ts`, `page-schema.test.ts`, `report-schema.test.ts`, `dashboard-schema.test.ts`, `ReportDefaultInspector.test.tsx`, `ReportDefaultInspector.i18nTitle.test.tsx`, `ReportDefaultInspector.defaultPeriodLabels-36835.test.tsx`, `DashboardDefaultInspector.test.tsx`, `DashboardDefaultInspector.layoutColumns-11796.test.tsx`: 10 files, 96 tests passed. - `eslint` on the 6 touched source and test files: 0 errors. - `check:test-source-alias`, `check:changeset-fixed`, `ui` `check:changeset-claims`: exit 0. - `node scripts/pm/overlap-check.mjs`: clean (shares `metadata-form-zh-cn.ts` with objectstack-ai#37366, merges cleanly). ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic (not touched). - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; lint passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` not touched. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUpnvPnJ1hR74pUrVj --> Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
Fixes #36950
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none —
skills/objectstack-i18n/SKILL.mdnames themetadataFormsgroup only, never its leaf keys; the group is platform-owned, so no app author writes the new key维护者速读
What changes
The reading the card asked for (at
021524cd,METADATA_FORM_REGISTRYwalked with the extractor's path rule): of the 18 registered Studio forms, 9 carry a select row withoptions—object,field,hook,report,dashboard,action,page,agent,skill— 38 rows, 187 options (185 distincttype.path.valuekeys:object'sfields.deleteBehavioris listed twice, with the same names). Every one is seen by a builder: the console'sSchemaFormrendersfieldSpec.optionsahead of the schema enum (ui/packages/app-shell/src/views/metadata-admin/SchemaForm.tsx, the enum/select branch), and the server translated onlylabel,helpTextandplaceholderof a form field.packages/spec/src/system/translation.zod.ts). AmetadataForms.<type>.fields.<path>entry acceptsoptions: a record from optionvalueto its translated name, the shapeobjects.<object>.fields.<field>.optionsalready has.choicesandvaluesare refused there, as on the object-field face, and the refusal namesoptionsas the key to write (thealiasesrow of the strict object is the rename hint of that unknown-key refusal, not an accepted spelling).packages/spec/src/system/i18n-resolver.ts).translateFormFieldoverlays eachoptions[]entry'slabelwith the translation keyed by itsvalue, along the locale chain; an option with no translation, or with a non-string value, is passed through unchanged. This is the walkerresolveMetadataFormLabelsuses, which/api/v1/meta/typeslocalizes served forms with.packages/lint/src/i18n-walk.ts).walkFormFieldemitsmetadataForms.<type>.fields.<path>.options.<value>for every option of a row, seeded with its English label, soos i18n extractandpnpm check:i18noffer exactly the keys the resolver reads.node scripts/check-i18n-bundles.mjs --writeadded the 185 keys to all eleven*.metadata-forms.generated.tspacks; the ten translated packs then got hand-written names (ar, de, es-ES, fr, ja-JP, ko, pt-BR, ru, zh-CN, zh-Hant) and a second--writedropped every source-hash row they had seeded. The 17 Default Period choices take the wording of the console's own period chip (ui/packages/i18n/src/locales/*,dashboard.filters.range.*anddashboard.filters.custom), so the period an author picks reads as the period a viewer sees. Loanwords that read the same as English (URL,HTML,JSON,Markdown, and per locale words such as deText, frDate) are spelled so they are not byte-echoes of the source, which the catalog's zero-echo pins require (object-lifecycle-panel-echo-decisions.test.ts,report-form-echo-decisions.test.ts): for example zh-CN网址(URL), deTextfeld, frDate (sans heure).content/docs/references/system/translation.mdxregenerated (gen:docs).Small calls made here (no card): the rename hints for
choices/valuesmirror the object-field face; a non-string option value is passed through untouched rather than stringified, since every option a registered form lists has a string value (the reading found none other).Why
A non-English builder saw a translated field label with English choices under it on every server-rendered Studio form. The bundle had no slot for the names, so no locale could fix it.
Verification
packages/spec/src/system/i18n-resolver.test.ts, new top-level describe "select option names": a choice is renamed by its value and keeps its other keys; a value with no translation keeps its English label; a nested repeater row is reached by its dot path; the input form is not mutated.packages/platform-objects/src/metadata-translations/form-option-labels.test.ts(new): through the SERVED bundle and the real registry, the object form's sharing model reads私有 — 仅所有者in zh-CN; the reading floor (≥30 option rows over ≥8 forms) holds; for each of the ten translated locales every choice of every form select has a non-empty name that differs from its English label.packages/specfull suite green (vitest, 618 s);packages/lint236 files / 9,680 tests green;packages/platform-objectstranslations + metadata-translations 29 files green;packages/clitest/i18n-extract.test.tsgreen;node scripts/check-i18n-bundles.mjsexit 0;pnpm check:i18n-coveragecould not measure here (exit 3: the example apps are not built in this worktree), so CI carries that one;pnpm --filter @objectstack/spec check:generatedexit 0 aftergen:docs.node scripts/pm/overlap-check.mjsexit 0 againstorigin/mainand the open PRs sharing these files (feat(spec)!: form is a metadata type of its own, and the form doors read a form over both types #37422, refactor(spec)!: rename the Studio helper defineForm to defineMetadataForm and its modules to *.metadata-form.ts #37366).Contract review (L2) is owed before landing: the diff changes
packages/spec/src/**and declaresClause-②: yes (widening). Changed lines exceed 3,000, so landing needs an authorized approval.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
Generated by Claude Code