Repository navigation
Commit 0005fec
fix(spec,app-shell): zh-CN view panel reads Chinese on every row of its collapsed sections (#30356)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwB5hMAwYpcBhDQ6HsKVez9s8)_
Fixes #30267
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:中文控制台下,Studio 视图属性面板里「表格选项 / 分页 / 终端用户控制 /
导航与共享」四个折叠区块展开后的行名与说明全部变成中文(实测英文行 70 → 9,剩下 9 个是「允许的可视化」里的类型选项名 Grid /
Kanban 等);英文控制台文字不变。
- 为什么改:这些区块的子项在 spec
表单里没有逐项声明,翻译提取器只认已声明的子项,所以它们从来没有翻译键,任何语言都显示英文;#30039 浏览器验收时发现。
- 风险与回滚:只改表单布局、提示文字与翻译目录,不动数据与接口;面板不再显示两个早已退役的键(导航 `view`、共享
`type`),已存的值保存时原样保留。回滚即还原本 PR。
-
先看:`packages/spec/src/ui/view.form.ts`(逐项声明子字段与提示)、`packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts`(中文译文)、`ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts`(控制台中文副本)。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/app-shell/src/views/metadata-admin/metadata-form-i18n.test.ts`,预期全部通过,其中
objectstack#30267 一组断言四个区块下每一行的名称与说明都含中文、英文对照组不含中文。
- 需要你做的:无,席位落地。
## What changes
`viewForm` declared `selection`, `pagination`, `userFilters`,
`appearance`, `userActions`, `navigation` and `sharing` as `type:
'composite'` with no children. The panel (`SchemaForm`) then derives the
child rows from the JSON Schema, and `os i18n extract` walks only
DECLARED children, so none of those rows had a
`metadataForms.view.fields['PARENT.CHILD']` key. A zh-CN Studio read 70
English rows across the four collapsed sections.
- **`packages/spec/src/ui/view.form.ts`** spells out every live child of
the seven composites (plus hints on `addRecord`'s two existing
children), and gives the rows that had no hint one. Every declared hint
is byte-equal to the schema `.describe()` text the panel already showed,
so an English console reads the same text. `userFilters.fields` is
enumerated as a `repeater` with `widget: 'grid'` and `required: true` on
`field`, which keeps the inline table it rendered as before (the
auto-detected master-detail table), now with translatable column heads.
- **`packages/spec/src/ui/view.zod.ts`**: `UserFilterFieldSchema`'s six
properties carry `.meta({ title })` (Field / Label / Type / Options /
Show Count / Default Values, the strings the panel already printed). The
repeater-title guard requires it for any enumerated repeater.
- **Retired keys no longer offered**: the schema-derived list rendered
the `navigation.view` and `sharing.type` tombstones as editable rows;
the declared lists omit them, as `addRecord` already did for its two
tombstones. A stored value is not dropped by a panel save:
`CompositeField` writes `{ ...obj, [child]: v }` (`SchemaForm.tsx`, the
composite `onChange`), so a key the form does not render is carried
through unchanged, exactly as before.
- **Catalogs**
(`packages/platform-objects/src/apps/translations/*.metadata-forms.generated.ts`):
regenerated with `node scripts/check-i18n-bundles.mjs --write`; every
new leaf is translated in zh-CN, ja-JP and es-ES (the catalog-wide echo
ledgers hold all three translated locales at zero en echoes). The
provenance companions lose the rows of leaves that are now translated,
as the regenerator writes them.
- **Console overlay**
(`ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts`):
copies the platform's zh-CN leaves for every new row, leaf for leaf.
## Tests
- `packages/spec/src/ui/view-form-composite-children.test.ts` (new):
each composite's declared children EQUAL the schema's live keys
(tombstones excluded), so a key added to a block later cannot silently
drop out of the panel; each declared hint equals its schema description;
the repeater's row labels equal the item titles; no retired key is
offered.
-
`packages/platform-objects/src/apps/translations/view-composite-children.test.ts`
(new): population derived from the form; every declared child is a key
in all four catalogs, the en leaf is the form's text, zh-CN never echoes
en.
- `ui/.../metadata-form-i18n.test.ts`: new objectstack#30267 group,
every row label and hint under the four sections contains CJK in zh-CN,
a sample per composite, the two retired rows gone, and an en control
that reads the spec English with no CJK.
- `object-lifecycle-panel-echo-decisions.test.ts`: positive-control
count 701 → 731 (thirty new row labels, authored in all three locales).
- `metadata-form-zod-reconciliation.test.ts`: three `omit` rows for
`view` / `userFilters` (`tabs`, `showAllRecords`, `allowAddTab`). The
walk resolves the block through the view union to the page-shaped
`UserFiltersSchema`; the list arm the form lays out is
`ObjectUserFiltersSchema`, which refuses those keys.
Ablation (each through `scripts/ablation-replace.mjs`, mutation proven
on disk, restored to HEAD):
| Mutation | Pin that went red |
|:--|:--|
| delete the overlay row `'userActions.editInline'` | ui: "every row
label and every hint under the four sections is Chinese", "a sample of
each composite's children" (2 failed / 22) |
| delete the `refresh` declaration from `userActions` | spec:
"userActions: declares exactly the schema's live keys" (1 failed / 20) |
| zh-CN `pagination.pageSize` label back to `Page Size` |
platform-objects: "zh-CN carries its own text for every leaf" (1 failed
/ 7) |
## Acceptance notes
- **Live, example CRM, zh-CN**,
`/studio/com.example.crm/interfaces?surface=view:crm_lead.all`, four
sections expanded, English lines counted per section: 表格选项 5 → 0, 分页 5 →
0, 终端用户控制 44 → 9, 导航与共享 16 → 0 (70 → 9). The 9 left are the
`appearance.allowedVisualizations` option chips (Grid, Kanban, Gallery,
Calendar, Timeline, Gantt, Map, Chart, Tree): enum values the widget
prints raw. The metadata-forms catalog has no channel for a form field's
option labels (the extractor emits `label` / `helpText` /
`placeholder`), so they are reported, not fixed here. en-US after: the
same English rows as before, minus the two tombstone rows; the
`userFilters.fields` table still shows `Field* Label Type Options Show
Count Default Values`.
- File surface beyond the claim's list: `view.zod.ts` (six titles), the
two ledger tests above, and the ja-JP / es-ES catalogs (required by the
echo ledgers).
- Out of scope, unchanged: the authored-label vs translated-rail
mismatch noted in #30265.
## Verification
<details><summary>Commands and readings (final head)</summary>
Head `f5483a169f` (branch merged with `origin/main` c1240a3 first; `git
merge-tree` against main 8c9f48f is clean).
- Full build `npx turbo run build --filter='!@objectstack/docs'` under
`os-verify-lock`: VERDICT command-exit 0 (13m50s).
- `pnpm --filter @objectstack/spec test`: exit 0 (an earlier run on this
branch failed only `metadata-form-zod-reconciliation` → fixed by the
three ledger rows).
- `pnpm --filter @objectstack/spec typecheck`: exit 0 · `pnpm --filter
@objectstack/spec check:generated`: exit 0, all 14 artifacts up to date.
- `pnpm --filter @objectstack/platform-objects test` / `typecheck`: exit
0 / exit 0.
- `pnpm --dir ui exec vitest run
packages/app-shell/src/views/metadata-admin/metadata-form-i18n.test.ts`:
exit 0 (22 tests) · `pnpm --dir ui --filter @object-ui/app-shell
type-check`: exit 0 · eslint on the touched ui and spec/platform-objects
files: exit 0.
- `node scripts/check-i18n-bundles.mjs`: all 11 bundle sets in sync ·
`check:i18n-stale-fill`: OK.
- `dispatch-gates --ran`: 84 derived, 84 run, 0 NOT-MEASURED.
`check-plugin-teardown-shape --self-test` first exited 3 (shallow clone
could not read its pinned fixture commit); after `git fetch origin
621a487…` it exits 0.
```text
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-adoption.mjs :: exit 0
node scripts/check-comment-mask-adoption.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-dev-prereqs.mjs --self-test :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-issue-citations.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/docs-audit/check-affected-docs.mjs :: exit 0
node scripts/docs-audit/check-drift-comment.mjs :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm --filter @objectstack/spec run check:api-surface :: exit 0
pnpm --filter @objectstack/spec run check:authorable-surface :: exit 0
pnpm --filter @objectstack/spec run check:browser-reachable-entries :: exit 0
pnpm --filter @objectstack/spec run check:docs :: exit 0
pnpm --filter @objectstack/spec run check:dual-source-exports :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm --filter @objectstack/spec run check:empty-state :: exit 0
pnpm --filter @objectstack/spec run check:entry-nameability :: exit 0
pnpm --filter @objectstack/spec run check:export-origins :: exit 0
pnpm --filter @objectstack/spec run check:exported-any :: exit 0
pnpm --filter @objectstack/spec run check:liveness :: exit 0
pnpm --filter @objectstack/spec run check:llms-txt :: exit 0
pnpm --filter @objectstack/spec run check:skill-refs :: exit 0
pnpm --filter @objectstack/spec run check:strictness-ledger :: exit 0
pnpm --filter @objectstack/spec run check:variant-docs :: exit 0
pnpm --filter @objectstack/spec run check:yaml-examples :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:dual-build-cjs-loads :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:i18n :: exit 0
pnpm check:i18n-stale-fill :: exit 0
pnpm check:issue-citations :: exit 0
pnpm check:keyed-text-bounds :: exit 0
pnpm check:lean-entry-closure :: exit 0
pnpm check:logger-receiver-detach :: exit 0
pnpm check:merge-driver :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:objectql-double-limit :: exit 0
pnpm check:org-identifier :: exit 0
pnpm check:page-declaration-shape :: exit 0
pnpm check:platform-object-tenancy-census :: exit 0
pnpm check:pm-prior-rulings :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:slot-lookup :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm check:spec-docblock-symbol-anchors :: exit 0
pnpm check:spec-parsed-alias :: exit 0
pnpm check:system-context-census :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
```
</details>
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01WGufzjGQVFPCizmQreyKkv
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent c580081 commit 0005fec
13 files changed
Lines changed: 1024 additions & 74 deletions
File tree
- .changeset
- packages
- platform-objects/src/apps/translations
- spec/src
- system
- ui
- ui/packages/app-shell/src/views/metadata-admin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1154 | 1154 | | |
1155 | 1155 | | |
1156 | 1156 | | |
1157 | | - | |
| 1157 | + | |
| 1158 | + | |
1158 | 1159 | | |
1159 | 1160 | | |
1160 | | - | |
| 1161 | + | |
| 1162 | + | |
1161 | 1163 | | |
1162 | 1164 | | |
1163 | | - | |
| 1165 | + | |
| 1166 | + | |
1164 | 1167 | | |
1165 | 1168 | | |
1166 | | - | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
1167 | 1175 | | |
1168 | 1176 | | |
1169 | | - | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
1170 | 1187 | | |
1171 | 1188 | | |
1172 | 1189 | | |
| |||
1190 | 1207 | | |
1191 | 1208 | | |
1192 | 1209 | | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
1193 | 1236 | | |
1194 | 1237 | | |
1195 | 1238 | | |
1196 | 1239 | | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
1197 | 1248 | | |
1198 | 1249 | | |
1199 | 1250 | | |
1200 | 1251 | | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
1201 | 1296 | | |
1202 | | - | |
| 1297 | + | |
| 1298 | + | |
1203 | 1299 | | |
1204 | 1300 | | |
1205 | | - | |
| 1301 | + | |
| 1302 | + | |
1206 | 1303 | | |
1207 | 1304 | | |
1208 | | - | |
| 1305 | + | |
| 1306 | + | |
1209 | 1307 | | |
1210 | 1308 | | |
1211 | | - | |
| 1309 | + | |
| 1310 | + | |
1212 | 1311 | | |
1213 | 1312 | | |
1214 | | - | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
1215 | 1334 | | |
1216 | 1335 | | |
1217 | | - | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
1218 | 1342 | | |
1219 | 1343 | | |
1220 | 1344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1154 | 1154 | | |
1155 | 1155 | | |
1156 | 1156 | | |
1157 | | - | |
| 1157 | + | |
| 1158 | + | |
1158 | 1159 | | |
1159 | 1160 | | |
1160 | | - | |
| 1161 | + | |
| 1162 | + | |
1161 | 1163 | | |
1162 | 1164 | | |
1163 | | - | |
| 1165 | + | |
| 1166 | + | |
1164 | 1167 | | |
1165 | 1168 | | |
1166 | | - | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
1167 | 1175 | | |
1168 | 1176 | | |
1169 | | - | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
1170 | 1187 | | |
1171 | 1188 | | |
1172 | 1189 | | |
| |||
1190 | 1207 | | |
1191 | 1208 | | |
1192 | 1209 | | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
1193 | 1236 | | |
1194 | 1237 | | |
1195 | 1238 | | |
1196 | 1239 | | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
1197 | 1248 | | |
1198 | 1249 | | |
1199 | 1250 | | |
1200 | 1251 | | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
1201 | 1296 | | |
1202 | | - | |
| 1297 | + | |
| 1298 | + | |
1203 | 1299 | | |
1204 | 1300 | | |
1205 | | - | |
| 1301 | + | |
| 1302 | + | |
1206 | 1303 | | |
1207 | 1304 | | |
1208 | | - | |
| 1305 | + | |
| 1306 | + | |
1209 | 1307 | | |
1210 | 1308 | | |
1211 | | - | |
| 1309 | + | |
| 1310 | + | |
1212 | 1311 | | |
1213 | 1312 | | |
1214 | | - | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
1215 | 1334 | | |
1216 | 1335 | | |
1217 | | - | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
1218 | 1342 | | |
1219 | 1343 | | |
1220 | 1344 | | |
| |||
0 commit comments