Skip to content

Commit 4dd4403

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-5ielpf
2 parents d87310b + f708cf2 commit 4dd4403

17 files changed

Lines changed: 1473 additions & 1343 deletions
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/i18n': patch
3+
---
4+
5+
feat(i18n): the flow designer and the rest of the Studio chrome move into the `studio` namespace
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **Sixth slice of the move ruled on objectstack#25922** (6431032267, Q2 = A; kept by 6431234244). Every row still left in `@object-ui/app-shell`'s private designer table, except `engine.translationPreview.*`, now lives in `@object-ui/i18n/namespaces/studio`, text unchanged: the flow designer (`engine.flowSim.*`, `engine.flowCanvas.*`, `engine.flowRuns.*` and the other `engine.flow*` families), the page-block canvas, the doc and book previews, `engine.studio.inspector.*` and the remaining Studio chrome (538 keys in `en`, 583 in `zh`). The `engine.flowNode.*` and `engine.enum.*` rows stay zh-only, as before: their English is the flow node descriptor or the enum value itself. Studio reads the same strings; a Chinese viewer sees these labels in English for the moment the `zh` catalogue takes to load, as with the earlier slices. No export changes.

‎ui/packages/app-shell/src/views/metadata-admin/CelPredicateField.i18n-10862-s2.test.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ import { fieldRuleRootIssue, validateRlsPredicateEnforceability } from '@objects
3636
import { t, tFormat } from './i18n';
3737
import { CelPredicateField } from './CelPredicateField';
3838
import { lintCelPredicate, type CelSchemaHint } from './celAuthoring';
39+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
40+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
41+
// Resident before any case, so the zh rows below read synchronously.
42+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
43+
await loadStudioCatalogue('zh');
3944

4045
afterEach(cleanup);
4146

‎ui/packages/app-shell/src/views/metadata-admin/flowNodePaletteI18n.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919

2020
import { describe, it, expect } from 'vitest';
2121
import { translateNodeLabel, translateNodeHint } from './i18n';
22+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
23+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
24+
// Resident before any case: this file runs in the `unit` project, whose shared
25+
// module graph would otherwise let it pass only when another file had loaded
26+
// `zh` first.
27+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
28+
await loadStudioCatalogue('zh');
2229

2330
/**
2431
* The framework's own strings for this node type, copied here ONLY as the

‎ui/packages/app-shell/src/views/metadata-admin/i18n.ts‎

Lines changed: 4 additions & 1327 deletions
Large diffs are not rendered by default.

‎ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.nodeTypeOptions-11778.test.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ import { FlowNodeInspector } from './FlowNodeInspector';
2424
import { NODE_PALETTE } from '../previews/flow-canvas-parts';
2525
import { t, type SupportedLocale } from '../i18n';
2626
import type { MetadataSelection } from '../preview-registry';
27+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
28+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
29+
// Resident before any case, so the zh rows below read synchronously.
30+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
31+
await loadStudioCatalogue('zh');
2732

2833
const ACTIONS_ROUTE = '/api/v1/automation/actions';
2934
let engineActions: unknown[] | null = null;

‎ui/packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.studioNamespace-25922.test.ts‎

Lines changed: 65 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
22

33
/**
4-
* objectstack#25922 slices S2 to S5 — the designer rows that moved into
4+
* objectstack#25922 slices S2 to S6 — the designer rows that moved into
55
* `@object-ui/i18n`'s `studio` namespace (every `engine.inspector.*` row;
6-
* `engine.packages.*`, `engine.form.*`, `engine.edit.*`; `engine.studio.*` but
7-
* its inspector; the data source pages, the field types and the metadata
8-
* preview panes), and app-shell's `t()` / `tOptional()` still answer every one
9-
* of them the way they did when the rows sat in its own table.
6+
* `engine.packages.*`, `engine.form.*`, `engine.edit.*`; all of
7+
* `engine.studio.*`; the data source pages, the field types, the metadata
8+
* preview panes, the flow designer and the rest of the Studio chrome), and
9+
* app-shell's `t()` / `tOptional()` still answer every one of them the way they
10+
* did when the rows sat in its own table.
1011
*
1112
* What would break it:
1213
* - a row copied back into the app-shell table with a different value — the
@@ -78,15 +79,66 @@ const FAMILY_FLOOR: Readonly<Record<string, number>> = Object.freeze({
7879
'engine.viewPreview.': 4,
7980
'engine.objectPreview.': 1,
8081
'engine.previewShell.': 1,
82+
// S6 — the rest of the table (engine.translationPreview aside): the flow
83+
// designer, the page-block canvas, the doc and book previews, the Studio
84+
// inspector and the remaining chrome
85+
'engine.studio.inspector.': 30,
86+
'engine.flowSim.': 60,
87+
'engine.flowCanvas.': 20,
88+
'engine.flowRuns.': 18,
89+
'engine.flowPreview.': 15,
90+
'engine.flowScope.': 15,
91+
'engine.flowValidate.': 15,
92+
'engine.flowProblems.': 9,
93+
'engine.flowPalette.': 8,
94+
'engine.flowExpr.': 6,
95+
'engine.flowRef.': 5,
96+
'engine.flowRegion.': 4,
97+
'engine.pageBlockCanvas.': 55,
98+
'engine.list.': 30,
99+
'engine.docPreview.': 25,
100+
'engine.catalog.': 25,
101+
'engine.bookPreview.': 20,
102+
'engine.sharingRule.': 15,
103+
'engine.widgetPicker.': 15,
104+
'engine.layers.': 15,
105+
'engine.diagnostics.': 15,
106+
'engine.directory.': 14,
107+
'engine.draftConflict.': 10,
108+
'engine.validation.': 10,
109+
'engine.position.': 9,
110+
'engine.appNav.': 8,
111+
'engine.embedded.': 7,
112+
'engine.quickfind.': 5,
113+
'engine.badge.': 3,
114+
'engine.fieldsListEditor.': 3,
115+
'engine.typeAction.': 2,
116+
'engine.celTest.': 2,
117+
'engine.sourcePageEditor.': 2,
118+
'engine.condition.': 2,
119+
'engine.celLint.': 1,
120+
'engine.package.': 1,
121+
'engine.breadcrumb.': 1,
122+
'engine.repeater.': 1,
123+
'engine.viewColumnPanes.': 1,
124+
'engine.home.': 1,
125+
'engine.cancel': 1,
126+
'engine.close': 1,
81127
});
82128

83129
/**
84-
* The one zh-only family among the moved rows: the package form's help text,
85-
* whose English is the producer's own `.describe()` sentence and is read
86-
* through `tOptional` (`ZH_ONLY_FAMILIES` in
87-
* `ui/scripts/check-i18n-designer-table-parity.mjs` carries the reason).
130+
* The zh-only families among the moved rows, with the fewest keys each may
131+
* carry. The package form's help text reads its English from the producer's own
132+
* `.describe()` sentence; the flow node labels and hints and the flow enum
133+
* values read theirs from the engine descriptor or the value itself. Each is
134+
* read through `tOptional` or a `lookupString` fallback (`ZH_ONLY_FAMILIES` in
135+
* `ui/scripts/check-i18n-designer-table-parity.mjs` carries the reasons).
88136
*/
89-
const ZH_ONLY_PREFIX = 'engine.packages.form.help.';
137+
const ZH_ONLY_FLOOR: Readonly<Record<string, number>> = Object.freeze({
138+
'engine.packages.form.help.': 9,
139+
'engine.flowNode.': 40,
140+
'engine.enum.': 4,
141+
});
90142

91143
const familyKeys = (prefix: string): string[] => Object.keys(EN).filter((key) => key.startsWith(prefix));
92144

@@ -110,9 +162,9 @@ describe('moved designer rows answer from the studio namespace (objectstack#2592
110162
expect(wrong).toEqual([]);
111163
});
112164

113-
it('the zh-only package help rows stay optional lookups: zh answers, en finds nothing', () => {
114-
const keys = Object.keys(ZH).filter((key) => key.startsWith(ZH_ONLY_PREFIX));
115-
expect(keys.length).toBeGreaterThanOrEqual(9);
165+
it.each(Object.entries(ZH_ONLY_FLOOR))('%s: the zh-only rows stay optional lookups: zh answers, en finds nothing', (prefix, floor) => {
166+
const keys = Object.keys(ZH).filter((key) => key.startsWith(prefix));
167+
expect(keys.length).toBeGreaterThanOrEqual(floor);
116168
expect(keys.filter((key) => key in EN)).toEqual([]);
117169
expect(keys.filter((key) => tOptional(key, 'zh-CN') !== ZH[key])).toEqual([]);
118170
expect(keys.filter((key) => tOptional(key, 'en-US') !== undefined)).toEqual([]);

‎ui/packages/app-shell/src/views/metadata-admin/previews/AppNavCanvas.labelMaps-11128.test.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ import { render, screen, cleanup, fireEvent } from '@testing-library/react';
3232
import { I18nProvider } from '@object-ui/i18n';
3333
import { tFormat } from '../i18n';
3434
import { AppPreview } from './AppPreview';
35+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
36+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
37+
// Resident before any case, so the zh rows below read synchronously.
38+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
39+
await loadStudioCatalogue('zh');
3540

3641
afterEach(cleanup);
3742

‎ui/packages/app-shell/src/views/metadata-admin/previews/AppNavCanvas.untitledCard-11862.test.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ import { I18nProvider } from '@object-ui/i18n';
3030
import { MetadataCtx } from '@object-ui/react';
3131

3232
import { AppNavCanvas } from './AppNavCanvas';
33+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
34+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
35+
// Resident before any case, so the zh rows below read synchronously.
36+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
37+
await loadStudioCatalogue('zh');
3338

3439
afterEach(cleanup);
3540

‎ui/packages/app-shell/src/views/metadata-admin/previews/DocPreview.test.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ vi.mock('../useMetadata', async (importOriginal) => {
3939

4040
import { DocPreview } from './DocPreview';
4141
import { localeRefusal, patchAddLocale, patchRemoveLocale, resolvePlacements, toBookOptions } from './doc-draft';
42+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
43+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
44+
// Resident before any case, so the zh rows below read synchronously.
45+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
46+
await loadStudioCatalogue('zh');
4247

4348
const STUB_NS = 'doc-preview-test';
4449

‎ui/packages/app-shell/src/views/metadata-admin/previews/FlowPreview.headerPills-11779.test.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ vi.stubGlobal(
3232

3333
import { FlowPreview } from './FlowPreview';
3434
import { t } from '../i18n';
35+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
36+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
37+
// Resident before any case, so the zh rows below read synchronously.
38+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
39+
await loadStudioCatalogue('zh');
3540

3641
afterEach(cleanup);
3742

0 commit comments

Comments
 (0)