Skip to content

fix(app-shell): the curated page, report and dashboard inspectors name a select's options in Chinese under zh-CN - #37698

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-gvxx96-37607
Nov 26, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-gvxx96-37607

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #37607

Clause-②: no
Metadata-protocol: none
Skills-docs: none (no page under skills/** names the console's curated inspector overlay)

维护者速读

  • 用户能看到什么变化:中文界面下,Studio 里页面检查器的「类型」「记录操作」下拉,和报表、仪表盘检查器的「默认时间段」下拉,选项现在显示中文(例如「记录页」「抽屉(右侧预览)」「本季度」),不再是英文选项配中文标签。用词和平台中文翻译包、服务器下发的表单完全一致,也和报表/仪表盘页面上时间段筛选按钮的用词一致。英文界面不变。
  • 为什么做:feat(spec): Studio metadata-form select choices are translatable (metadataForms options slot) #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 feat(spec): Studio metadata-form select choices are translatable (metadataForms options slot) #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 报表检视器「期间与导出」:默认期间下拉显示原始值(this_month),没有选项名 #36835 test.

Why

Out-of-diff note 1 of the Contract review record 7195508409 on PR #37569: under zh-CN the curated page, report and dashboard inspectors showed English select options beside Chinese labels, and #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 refactor(spec)!: rename the Studio helper defineForm to defineMetadataForm and its modules to *.metadata-form.ts #37366, merges cleanly).

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic (not touched).
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec not touched.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj


Generated by Claude Code

…e a select's options in Chinese under zh-CN

The console's metadataForms overlay named a select's row but not its
options, so under zh-CN the page Type and Record action selects and the
report and dashboard Default Period selects listed English choices beside
Chinese labels. The overlay now carries those four rows' option names in
the options slot resolveMetadataFormLabels reads, copied from the
platform's zh-CN pack and pinned byte-equal to it
(metadata-form-option-names.test.ts). The console-side Default Period
renaming (default-period-labels.ts) is retired; #36835's pin now also
holds the zh names to the period chip's rows.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 8df05bb67b49100e56e9e8f00aec7af9b671b41f
Local-runs: none

Inputs: card #37607 (body, triage comment 7196185847, claim comment 7203073274), the PR body, its 8-file list, the net diff against merge-base c2bfa3ef7c, and the 51 check-runs on this head (none failed; Test UI shards ran metadata-form-option-names.test.ts, 8 tests, and ReportDefaultInspector.defaultPeriodLabels-36835.test.tsx, 4 tests, both green).

① Derived judgments

  • Accept-set: none changed — right. The diff touches no packages/spec/src/**, no governed path and no served form. The metadataForms rows gain options maps in the slot resolveMetadataFormLabels already reads (since feat(spec): Studio metadata-form select choices are translatable (metadataForms options slot) #37569); the console bundle's type is TranslationData['metadataForms'] from @objectstack/spec/system and Type Check UI is green, so the console accepts the shape the spec already declares.

  • Public surface: none changed — right. @object-ui/app-shell is private: true. Its exports map has only . (dist index) and ./styles.css. Nothing on the head names default-period-labels, localizeDefaultPeriods, withDefaultPeriodLabels or defaultPeriodLabelKey outside the changeset prose, so the deleted module had no reader left and was never on the exported surface.

  • The byte-identity pin reads the pack itself — right. PLATFORM_PACK resolves six levels up from ui/packages/app-shell/src/views/metadata-admin/ to the repo root, then to packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts. That file is on the head, and the test imports it with a top-level await import(). There is no second copy: a missing or moved pack throws and errors the suite. Changes in the pack fail as follows:

    • Changed word or key order: for page type, page interfaceConfig.recordAction and report dateRange.defaultRange, JSON.stringify equality fails. For dashboard, the map lives in metadata-form-i18n.ts and the render case fails, because getDashboardForm('zh-CN') has to give the pack's word for every option it offers.
    • Dropped map: toBeDefined fails.
    • New option row on page, report, dashboard or view: the "no other row" case fails.
    • New table row: the "exactly three rows" check on ZH_CN_SPEC_FORMS fails.
    • New spec option the pack names but the copy lacks: the render case fails, because the label falls back to English and no longer equals the pack's word.

    I read the pack on the head and checked the four maps by eye against the diff. They match, and the report and dashboard maps in the pack are identical. The pack's options hits under view are section keys (table_options), not option rows.

  • No picker, locale or option left untranslated or double-sourced — right.

    • Pickers: the render case asserts source[value] is defined for every option each of the four pickers offers, so no option of these selects falls through to English.
    • Locales: the retired helper gated on isZhLocale(locale). The overlay's bundleLocale gates on the same predicate and maps it to zh-CN, so every zh locale the helper renamed for is still renamed.
    • Sources: each Default Period select now reads one source, the overlay inside getReportForm / getDashboardForm. Both inspectors feed that form to mergeServerFields as bundledForm, as before. The console pack's dashboard.filters.range.* rows stay as the period chip's source only.
  • English path unchanged — right. For a non-zh locale localizeMetadataForm returns the form untouched, and so did the retired helper. The en-US control (Record page, This quarter, Last 30 days) and the 报表检视器「期间与导出」:默认期间下拉显示原始值(this_month),没有选项名 #36835 en cases pin it.

  • Inspector code — right. Dropping useObjectTranslation and appT from both useMemo deps is sound: the names are now static data keyed by locale, which stays a dep. The data-only, no-runtime-import posture of metadata-form-zh-cn.ts (Pending changes sheet eager graph) holds, because the diff adds only literals to it.

② Semver level

.changeset/37607-curated-inspector-option-names.md: '@object-ui/app-shell': patch. That matches the diff: a user-visible zh-CN display fix in a private package, with nothing published added or removed. A patch changeset on this package is the repo's existing convention (for example .changeset/37440-draft-publish-pins.md), and Check Changeset is green.

Clause-②: no — confirmed. No published accept-set, schema or exported surface moves. Metadata-protocol: none is confirmed too: no type, protocol or served shape changes. The declaration lines match in the PR body and the changeset.

③ Boundary flags

  • Dev call 1, copy instead of read (card route 2): accepted. The card allows a copy if a pin keeps it byte-equal to the pack, and the pin above does. The reason given is that the table is data-only with no runtime import, because the eager graph reads it. The headers of metadata-form-zh-cn.ts and metadata-form-i18n.ts on the head state the same posture.
  • Dev call 2, retire in full instead of reduce: accepted. The helper was zh-only and renamed only dateRange.defaultRange, and the overlay now covers exactly that under the same isZhLocale gate. Nothing of it is left uncovered.
  • open_questions: none in the claim or the PR body.
  • SQL push-down: not applicable. The diff is form-label data, two inspector memo bodies and tests, with no data access, id materialisation or join.
  • Author: the PR's user.login is objectstack-fleet[bot], so no author note.
  • N1, nit: the dashboard select's parity with the period chip is pinned only through the pack. The 报表检视器「期间与导出」:默认期间下拉显示原始值(this_month),没有选项名 #36835 test's new zh case pins getReportForm('zh-CN')'s Default Period names to the console's chip rows (dashboard.filters.range.*, dashboard.filters.custom). The dashboard select is pinned only to the platform pack's separate dashboard row. Today the two pack maps are identical, so nothing diverges. But a platform edit to the dashboard row alone would move the dashboard select away from the chip it sits beside, and no test would fail. Before this PR both selects read the chip rows by construction. The PR body's line "the period-chip parity it guarded is kept by the 报表检视器「期间与导出」:默认期间下拉显示原始值(this_month),没有选项名 #36835 test" holds for the report select only. Accepted as a deviation. A one-line getDashboardForm('zh-CN') loop in the same case would close it, in this PR or a follow-up.

Implemented-by: claude/project-thread-gvxx96-37607
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head 8df05bb · card #37607 · area s2-ux-T · 2026-11-26T21:28Z

L1 checklist

  • Shape and relation. l1-face.mjs --pr 37698 read 13 items and flagged none; every check on this head is success or an expected skip; mergeable_state clean. Eight files under ui/packages/app-shell, +222 / −135, and a patch changeset on the private @object-ui/app-shell.
  • Fixes #37607 is right. In the Chinese console the page inspector's type and record-action pickers and the report and dashboard Default Period pickers now show the platform zh-CN pack's option names, copied into the console's override table (the card's second route); default-period-labels.ts is retired and nothing on the head still reads it.
  • Contract review. Record 7203741536 on this head: PASS, no must-fix, no should-fix. The copy is pinned byte-equal against the real pack, a new option row or a changed word fails a test, and the English path is unchanged. Adopted. Nit N1 (the dashboard picker is pinned to the pack but not to the period chip's words) goes to follow-up card review follow-ups of PR #37698: dashboard Default Period zh names not pinned to the period chip words #37703.
  • Declarations. Clause-②: no, Metadata-protocol: none. True.
  • Governance. check-governed-merges.mjs: not governed, 357 changed lines. Tier S.

Tier: S. Landing: ready + auto-merge by this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 21:28
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit e491fce Nov 26, 2026
52 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-gvxx96-37607 branch November 26, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console: the curated page, report and dashboard inspectors show select options in English under zh-CN; their form overlay has no option slot

2 participants