Repository navigation
Commit 94e29cd
<!-- 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.studio` 的 access、if、data、auto、settings
五个支柱,加上数据源三族(`engine.datasource` / `externalDatasource` /
`datasourcePreview`)和字段类型三族(`engine.fieldType` / `fieldTypeDesc` /
`fieldCategory`),共 en、zh 各 549 键,从 app-shell 私有表搬进 `@object-ui/i18n` 的
`studio` 命名空间,文案一字未改,调用点不动。
- 为什么改:执行 #25922 裁决 6431032267(Q2 = A,6431234244 维持),这是 (M) 的第 4
片(S4),派单 6450441124;`engine.studio.rules` 按席位改单留给 S5。
- 风险与回滚:与前几片相同,zh 用户首次打开这些页面时标签先显示英文、zh 分片到达后同一挂载重渲染为中文;回滚即 revert 本 PR。
- 先看:`ui/packages/i18n/src/namespaces/studio/en.ts` 末尾的 S4 段,再看钉测试新增的 11
个家族下限。
- 两分钟验证:`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 S4 of the (M) item.** These rows leave `ENGINE_STRINGS_EN` /
`ENGINE_STRINGS_ZH` in
`ui/packages/app-shell/src/views/metadata-admin/i18n.ts` and are
appended to `STUDIO_EN` / `STUDIO_ZH` in
`ui/packages/i18n/src/namespaces/studio/{en,zh}.ts`, text byte-for-byte
unchanged:
| family | keys per language |
|---|---|
| `engine.studio.access.*` | 130 |
| `engine.studio.if.*` | 58 |
| `engine.studio.data.*` | 50 |
| `engine.studio.auto.*` | 46 |
| `engine.studio.settings.*` | 40 |
| `engine.datasource.*` | 58 |
| `engine.externalDatasource.*` | 50 |
| `engine.datasourcePreview.*` | 10 |
| `engine.fieldType.*` | 49 |
| `engine.fieldTypeDesc.*` | 49 |
| `engine.fieldCategory.*` | 9 |
| **total** | **549** (same set in `en` and `zh`; none zh-only) |
The five pillars are the seat's amended scope. `engine.studio.rules.*`
is deferred to S5, because #26731 adds a `rules` row. The "about 500 key
lines of other `engine.*`" are the data source pages and the field
types: 225 keys per language, 450 key lines. I picked them because, when
I read the open PRs' patches to both homes, no open PR touched these
families. The open PRs that do touch those two files (#26804, #26827,
#26819, #26831) hold only `engine.studio.{inspector,held,refusal}`,
`engine.inspector.*` and `engine.translationPreview.*`. Stopping at 450
also keeps the PR under the 3,000-line threshold.
- Same AST pass as S2 and S3; a heading comment marks the S4 section in
each catalogue.
- **No runtime change.** `lookupString` already asks the table first and
the namespace second, so `t` / `tFormat` / `tOptional` and every call
site are untouched. No new source file, so the console chunk groups need
no change.
- **Readers.** Every non-test reader of the moved families is in
app-shell under `views/metadata-admin/` or `views/studio-design/`, so
all are Studio surfaces. None calls `t()` at module scope:
`flowPresets.ts` and `field-types.ts` hold keys, not strings. Dynamic
keys (`engine.fieldType.${…}`, `engine.fieldTypeDesc.${…}`,
`engine.fieldCategory.${…}`) all go through `t()`. No stop-and-report.
- **Changeset:** `.changeset/25922-studio-i18n-pillars-datasources.md`,
`@object-ui/i18n` patch.
- ⛔ Untouched: `ui/packages/i18n/src/locales/*.ts`, `ui/.github/**`,
root `ci.yml`, `engine.studio.{rules,inspector,held,refusal}`,
`engine.inspector.*`, `engine.translationPreview.*`.
## Why
Ruling 6431032267 Q2 = A (upheld by 6431234244): the designer table
becomes one lazy `@object-ui/i18n` namespace, moved in slices.
## Tests
- **Pin widened:**
`inspectors/inspectorStrings.studioNamespace-25922.test.ts` gains a
floor for each of the eleven S4 families. For each family, `t()` must
answer every key with the namespace value in `en-US`, `zh-CN` and
`de-DE`.
- **Forced edits: zh preloads.** Each of these suites reads a moved S4
zh row synchronously, so it now makes `zh` resident with a top-level
`await loadStudioCatalogue('zh')`. No assertion changed:
- Seven dom suites: `datasource/DatasourceResourcePage.locale-13460`,
`previews/adminPreviews.i18n-10862-s2`,
`previews/externalDatasourcePanel.i18n-10862-s3`,
`previews/federationTabs.i18n-10862-s4`,
`studio-design/ObjectFormDesigner.typeName-13148`,
`studio-design/StudioDesignSurface.emptyPackage`,
`studio-design/StudioDesignSurface.railLabels`.
- One unit suite:
`metadata-admin/studioAutomationCopy.plainLanguage-11659.test.ts`. It
runs in the `unit` project (`isolate: false`), so it passed in the full
run only because an earlier file had already loaded `zh`. Run alone, it
failed.
- **Forced edits: tests that leaned on the table.**
- `studio-design/AddFieldPopover.studioNamespace-25922.test.tsx` (slice
1) used `engine.studio.data.addField` as "a key still in the app-shell
table". That key moved, so the test now uses `engine.studio.cancel`,
which the same popover renders and which stays in the table.
- `previews/__tests__/block-config-i18n.test.ts` floored the app-shell
table at 1,500 keys. The table now holds 1,152, so the 3,000-key floor
applies to both homes together, and the table only has to be non-empty.
### The sweep, and the S3 leftovers
Every app-shell test that names zh was run with
`namespaces/studio/index.ts`'s `zh` loader delayed 4000 ms, using
`scripts/ablation-replace.mjs` and restored byte-identical. That is 403
files (the S3 list plus every other app-shell test naming zh). Each of
the 52 unit-project files was also run alone under the delay.
- With this branch applied, 1 file goes red:
`i18n/src/__tests__/studio-namespace-lazy.test.tsx`. It fails by
construction, because its `findByText` waits 1 s and the delay is 4 s.
- Measured on `main` without the S4 move, 3 files go red under the
delay: `PackageFormDialog.validationTiming`,
`ResourceEditPage.discardDraftLabel-12690` and
`ResourceEditPage.environmentOverlay-12141`. All three are S3 rows. The
S3 sweep had no delay, so these racers passed locally. The seat routed
their preloads to #26855 and #26839, so this PR leaves them alone. Until
those land, they can show red here.
## Acceptance notes
- **Every moved key resolves identically before and after.** This is a
one-off measurement and is not committed:
- The 549 + 549 base values were read by AST from the table at
`e9e344a9`.
- They were compared with `t()` and `tOptional()` on this branch after
`zh` is resident: `en-US`, `en`, `de-DE` and `fr` against the base `en`
value, and `zh-CN`, `zh` and `zh-TW` against the base `zh` value.
- Result: 3,843 lookups, 0 differing.
- **Ablations** (mutation landed by anchor count and blob, then restored
byte-identical to `HEAD`):
- With the `?? studioString(key, locale)` arm removed from
`lookupString`, 23 tests go red: the pin's `t()` case for all 21
families, its zh-only case, and the equivalence check. The equivalence
check reports 3,843 of 3,843 lookups differing.
- With one moved zh row altered (`engine.datasource.title`), the
equivalence check reports exactly 3 differing lookups (`zh-CN`, `zh`,
`zh-TW`). The pin stays green, as designed.
- **Eager bundle:** not re-measured locally, as in S2 and S3. CI's
`Build & E2E UI` measures it.
## Verification
All at the tree of `7c7bbb87`.
<details><summary>Tests and gates</summary>
- The 11 changed test files at normal speed: `Test Files 11 passed
(11)`, `Tests 211 passed (211)`.
- `pnpm --filter @object-ui/i18n --filter @object-ui/app-shell run
type-check`: VERDICT command-exit 0.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 34 commands, and each exited 0,
including `pnpm --dir ui exec vitest run scripts/` (`Test Files 178
passed | 2 skipped (180)`). `--ran` shows 34 derived, 34 run and 0
NOT-MEASURED. These gates ran with two more test files in the diff than
`7c7bbb87` has: the S3-leftover preloads, which I later handed to
#26839. Re-deriving on the final diff gives the same 34 commands.
- ui `check:i18n-designer-parity`, `check:i18n-dead-keys`,
`check:i18n-drift` (0 `en` values changed) and `check:i18n-keys`: all
exit 0. `check:new-line-citations`: exit 0. `node
scripts/check-nul-bytes.mjs`: exit 0.
- Changed lines: 2,597 (+1,341 / −1,256) over 15 files, under the
3,000-line 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 942ffb2 commit 94e29cd
15 files changed
Lines changed: 1341 additions & 1256 deletions
File tree
- .changeset
- ui/packages
- app-shell/src/views
- metadata-admin
- datasource
- inspectors
- previews
- __tests__
- studio-design
- 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 | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
44 | 57 | | |
45 | 58 | | |
46 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
681 | 684 | | |
682 | | - | |
683 | | - | |
| 685 | + | |
| 686 | + | |
684 | 687 | | |
685 | 688 | | |
686 | 689 | | |
| |||
691 | 694 | | |
692 | 695 | | |
693 | 696 | | |
| 697 | + | |
| 698 | + | |
694 | 699 | | |
695 | 700 | | |
696 | 701 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
47 | 53 | | |
48 | 54 | | |
49 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
0 commit comments