Repository navigation
Commit 4b59358
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8PeP4DzppH3b1kDPCjihHVx)_
Part of #25922
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:Studio 设计器表里剩余的 `engine.inspector.*`(223 键)以及全部
`engine.packages.*`、`engine.form.*`、`engine.edit.*` 从 app-shell 私有表搬进
`@object-ui/i18n` 的 `studio` 命名空间,共 en 551 键、zh 560 键(多出的 9 个
`engine.packages.form.help.*` 按原样保持仅 zh),文案一字未改,调用点不动。
- 为什么改:执行 #25922 裁决 6431032267(Q2 = A,6431234244 维持),这是 (M) 的第 3
片(S3),派单 6447417545。
- 风险与回滚:与前两片相同,zh 用户首次打开这些编辑器时标签先显示英文、zh 分片到达后同一挂载重渲染为中文;回滚即 revert 本
PR,行原样回到 app-shell。
- 先看:`ui/packages/i18n/src/namespaces/studio/zh.ts` 末尾新加的 S3 段(含仅 zh
行的说明),再看 `inspectors/inspectorStrings.studioNamespace-25922.test.ts`
的四个新家族下限与仅 zh 断言。
- 两分钟验证:`cd ui && pnpm run check:i18n-designer-parity && pnpm exec
vitest run
packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.studioNamespace-25922.test.ts`,应全绿。
- 需要你做的:无,席位落地。
## What changes
- **Slice S3 of the (M) item.** Every remaining `engine.inspector.*` row
and every `engine.packages.*`, `engine.form.*` and `engine.edit.*` row
leaves `ENGINE_STRINGS_EN` / `ENGINE_STRINGS_ZH` in
`ui/packages/app-shell/src/views/metadata-admin/i18n.ts` and is appended
to `STUDIO_EN` / `STUDIO_ZH` in
`ui/packages/i18n/src/namespaces/studio/{en,zh}.ts`, text byte-for-byte
unchanged:
| family | `en` | `zh` |
|---|---|---|
| `engine.inspector.*` (the rest after S2) | 223 | 223 |
| `engine.packages.*` | 133 | 142 |
| `engine.form.*` | 98 | 98 |
| `engine.edit.*` | 97 | 97 |
| **total** | **551** | **560** |
Same AST pass as S2 (each property with its leading comment block; a
mixed group's comment moves only when the group's first row moves); a
heading comment marks the S3 section in each catalogue. After this slice
no `engine.inspector.*` row is left in the app-shell table.
- **zh-only rows stay zh-only.** The nine `engine.packages.form.help.*`
rows have no `en` entry, before and after: their English is the package
schema's own `.describe()` sentence, read through `tOptional`.
`check:i18n-designer-parity` already lists the family in
`ZH_ONLY_FAMILIES`; the zh heading comment says why the rows have no
`en` twin.
- **No runtime change.** `lookupString` already asks the table first and
the namespace second (slice 1), so `t` / `tFormat` / `tOptional` and
every call site are untouched. No new file, so the console's
`i18n-ns-studio-en` / `i18n-ns-studio-zh` chunk groups need no change.
- **Readers.** Every reader of the moved keys is in app-shell. All but
one are Studio surfaces (metadata-admin, inspectors, previews,
studio-design). The exception is `views/RuntimeDraftBar.tsx`
(`engine.edit.*`). It sits outside Studio, but it reads its locale
through `useMetadataLocale()`, which re-renders when the `zh` catalogue
lands, the same path the Studio surfaces take. So it needs no await.
Dynamic keys (`engine.inspector.appNav.type.${…}`,
`engine.packages.source.${…}`, `engine.inspector.view.type.${…}`) all go
through `t()`.
- **Changeset:** `.changeset/25922-studio-i18n-editor-chrome.md`,
`@object-ui/i18n` patch.
- ⛔ Untouched: `ui/packages/i18n/src/locales/*.ts`, `ui/.github/**`,
root `ci.yml`, and every file PR #26800 owns
(`inspectorStrings.i18n-10804`, the three `FlowNodeInspector` tests,
`datasetPickers.authorText-11161`, `FlowPreview.removeNode-11772`,
`flow-problems.removalRefusal-11838`, `previewStrings.i18n-10848`,
`metadataError.heldWidget-11910`). None of them needed a preload for
this slice.
## Why
Ruling 6431032267 Q2 = A (upheld by 6431234244): the designer table
becomes one lazy `@object-ui/i18n` namespace, moved in slices; S3 is the
third row of #26593's slice table.
## Tests
Widened:
-
`ui/packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.studioNamespace-25922.test.ts`:
four new per-family floors (`engine.inspector.` 700, `engine.packages.`
120, `engine.form.` 90, `engine.edit.` 90, beside S2's six), so one
family draining cannot hide behind another. Per family, the namespace
carries every key in `en` and `zh`, and `t()` answers every key with the
namespace's value in `en-US`, `zh-CN` and `de-DE`. New case: the
`engine.packages.form.help.*` rows (at least 9) are absent from `en`,
`tOptional(k, 'zh-CN')` returns the `zh` value, and `tOptional(k,
'en-US')` stays `undefined`.
Forced edits: the zh rows these suites assert synchronously now arrive
in the lazily fetched chunk. Each suite makes `zh` resident with a
top-level `await loadStudioCatalogue('zh')`; no assertion changed. All
files are under `ui/packages/app-shell/src/views/metadata-admin/`:
- 19 dom suites: `AuditPanel.loadFailure`,
`IconPickerWidget.unknownName-12531`, `PackageFormDialog` (+
`.helpTextI18n`, `.idDerive-11792`), `PackagesPage.installedApps-13356`,
`ResourceEditPage.pickerLoadFailure` / `.referencesColumns-25916` /
`.referencesErrorState`, `SchemaForm.deDeveloperize-8218`,
`datasource/DatasourceResourcePage.selectPlaceholderLocale-11252`,
`inspectors/DashboardDefaultInspector`,
`inspectors/FlowReferenceField.flag.i18n-10448`,
`inspectors/HookDefaultInspector.flag.i18n-10448`,
`inspectors/ReportDefaultInspector` (+ `.i18nTitle`),
`inspectors/unknownValueFlag.i18n-9652`,
`previews/previewStrings.i18n-10835`, `selector-placeholder.i18n`.
- 1 unit suite: `artifact-locked-banner.i18n.test.ts`. The `unit`
project runs with `isolate: false`, so in the full run this suite passed
only because an earlier file in the same worker had already loaded `zh`.
Run alone, it failed. I found it by running each of the 34 unit-project
tests that name a zh locale on its own; the other 33 pass alone.
## Acceptance notes
- **Every moved key resolves identically before and after.** This was a
one-off measurement and is not committed. I read the 551 + 560 values by
AST from the base table at `f7c95cd1`. I then compared them with `t()`
and `tOptional()` on this branch after `zh` is resident. The `en` value
was checked in `en-US`, `en`, `de-DE` and `fr`. The `zh` value was
checked in `zh-CN`, `zh` and `zh-TW`. Each lookup checked both `t()` and
`tOptional()`. The nine zh-only rows were also checked in `en-US` and
`de-DE`, where `t()` must echo the key and `tOptional()` must return
`undefined`, as before. That is 3,902 lookups, 0 differing.
- **Ablations** (`scripts/ablation-replace.mjs`, mutation landed by
anchor count and blob, restored byte-identical to `HEAD`):
- With the `?? studioString(key, locale)` arm removed from
`lookupString`, 12 tests go red (11 in the pin across all ten families
plus the zh-only case, and the equivalence check). The equivalence check
reports 3,884 of 3,902 lookups differing. The 18 that hold are the
zh-only rows in `en-US` and `de-DE`, whose expected answer is "not
found" either way.
- With one moved zh row altered (`engine.edit.publish`), the equivalence
check reports exactly 3 differing lookups (`zh-CN`, `zh`, `zh-TW`). The
pin stays green, as designed, because its oracle is the catalogue
itself.
- **Eager bundle: not re-measured locally.** The namespace's only
non-test importer is app-shell's `i18n.ts`, which imports it statically.
So the moved `en` rows sit behind the same import edge before and after,
and the `zh` rows stay in the lazy `i18n-ns-studio-zh` chunk. CI's
`Build & E2E UI` runs the eager-closure budget on the built console.
## Verification
All at `61332921`.
<details><summary>Affected tests</summary>
- Before the forced edits, under `os-verify-lock`, I ran 341 test files:
every app-shell test naming a zh locale, every file naming one of the
four families, the i18n namespace tests and the ui i18n script tests.
322 passed and 19 failed, all of them the zh-synchronous suites above.
- After the edits, I reran the 21 touched or new files: `Test Files 21
passed (21)`, `Tests 205 passed (205)`, VERDICT command-exit 0.
- Unit-project isolation loop: each of the 34 unit tests that name a zh
locale, run alone, exits 0 after the `artifact-locked-banner` preload.
- `pnpm --filter @object-ui/i18n --filter @object-ui/app-shell run
type-check`: VERDICT command-exit 0 (both tsconfigs in each package).
</details>
<details><summary>Gates</summary>
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 34 commands. Each exited 0,
including `pnpm --dir ui exec vitest run scripts/` (`Test Files 178
passed | 2 skipped (180)`). `--ran`: 34 derived, 34 run, 0 NOT-MEASURED.
- ui: `check:i18n-designer-parity`, `check:i18n-dead-keys`,
`check:i18n-drift`, `check:i18n-keys` all exit 0, and `check:i18n-drift`
reports 0 `en` values changed in the locale packs and in the designer
table. `check:new-line-citations`: exit 0 (0 new citations). `node
scripts/check-nul-bytes.mjs`: exit 0.
- Changed lines: 2,770 (+1,454 / −1,316) over 25 files, under the 3,000
threshold.
</details>
## Human Minimum
- [x] 1. No `packages/spec` change.
- [x] 2. No new names; the only new file is the changeset.
- [x] 3. No formatter ran; `pnpm lint` is CI's.
- [x] 4. One card slice, one branch off `main`, one pull request.
- [x] 5. Patch changeset with both declaration lines.
- [x] 6. n/a.
- [x] 7. No hand edits to generated or release-owned files.
- [x] 8. English.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbX9LnJhjTQPJEmoBYi)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4702c46 commit 4b59358
25 files changed
Lines changed: 1454 additions & 1316 deletions
File tree
- .changeset
- ui/packages
- app-shell/src/views/metadata-admin
- datasource
- inspectors
- previews
- i18n/src/namespaces/studio
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
75 | 80 | | |
76 | 81 | | |
77 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
120 | 125 | | |
121 | 126 | | |
122 | 127 | | |
| |||
0 commit comments