Skip to content

Commit 6133292

Browse files
committed
test(ui): S3 designer rows read from the studio namespace — pin widened, zh preloads
Twenty suites that assert the moved zh rows synchronously make the zh catalogue resident first (one of them in the shared-graph unit project, where it passed only when another file had loaded zh). The namespace pin now covers the S3 families and the zh-only package help rows. Patch changeset for @object-ui/i18n. Claude-Session: https://claude.ai/code/session_01JQwxbX9LnJhjTQPJEmoBYi Co-authored-by: Claude <noreply@anthropic.com>
1 parent 64cf834 commit 6133292

22 files changed

Lines changed: 153 additions & 21 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 rest of the Studio inspectors and the package, form and editor strings move into the `studio` namespace
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **Third slice of the move ruled on objectstack#25922** (6431032267, Q2 = A; kept by 6431234244). The remaining `engine.inspector.*` keys and every `engine.packages.*`, `engine.form.*` and `engine.edit.*` key (551 in `en`, 560 in `zh`) now live in `@object-ui/i18n/namespaces/studio` instead of `@object-ui/app-shell`'s private table, text unchanged. The nine `engine.packages.form.help.*` rows stay `zh`-only: their English is the producer's own help text, read through `tOptional`. 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/AuditPanel.loadFailure.test.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ import userEvent from '@testing-library/user-event';
5050
import type { MetadataAuditEntry, MetadataClient } from '@object-ui/data-objectstack';
5151
import { AuditPanel } from './AuditPanel';
5252
import { t } from './i18n';
53+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
54+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
55+
// Resident before any case, so the zh rows below read synchronously.
56+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
57+
await loadStudioCatalogue('zh');
5358

5459
/** The positive claim this card exists to keep off a failed read. */
5560
const EMPTY_TITLE = t('engine.edit.auditEmptyTitle', 'en-US');

‎ui/packages/app-shell/src/views/metadata-admin/IconPickerWidget.unknownName-12531.test.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ import { WIDGETS } from './widgets';
4343
import { t, tFormat } from './i18n';
4444
import { getIcon } from '../../utils/getIcon';
4545
import { ActionDefaultInspector } from './inspectors/ActionDefaultInspector';
46+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
47+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
48+
// Resident before any case, so the zh rows below read synchronously.
49+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
50+
await loadStudioCatalogue('zh');
4651

4752
afterEach(cleanup);
4853

‎ui/packages/app-shell/src/views/metadata-admin/PackageFormDialog.helpTextI18n.test.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
1818
import { render, screen } from '@testing-library/react';
1919
import { ManifestSchema } from '@objectstack/spec/kernel';
2020
import { PackageFormDialog } from './PackageFormDialog';
21+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
22+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
23+
// Resident before any case, so the zh rows below read synchronously.
24+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
25+
await loadStudioCatalogue('zh');
2126

2227
let localeFixture: 'en-US' | 'zh-CN' = 'zh-CN';
2328
vi.mock('./i18n', async (importOriginal) => ({

‎ui/packages/app-shell/src/views/metadata-admin/PackageFormDialog.idDerive-11792.test.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/re
2222
import { ManifestSchema } from '@objectstack/spec/kernel';
2323
import { PackageFormDialog } from './PackageFormDialog';
2424
import { t } from './i18n';
25+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
26+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
27+
// Resident before any case, so the zh rows below read synchronously.
28+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
29+
await loadStudioCatalogue('zh');
2530

2631
let localeFixture: 'en-US' | 'zh-CN' = 'en-US';
2732
vi.mock('./i18n', async (importOriginal) => ({

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
55
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
66
import { PackageFormDialog } from './PackageFormDialog';
77
import { t } from './i18n';
8+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
9+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
10+
// Resident before any case, so the zh rows below read synchronously.
11+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
12+
await loadStudioCatalogue('zh');
813

914
// Which console language the dialog renders in. Only `useMetadataLocale` is
1015
// replaced — the rest of `./i18n` (the `t` resolver and both string tables) is

‎ui/packages/app-shell/src/views/metadata-admin/PackagesPage.installedApps-13356.test.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ import { resolveHref } from '@object-ui/layout';
3232
import { PackagesPage, type InstalledPackageRow } from './PackagesPage';
3333
import { t } from './i18n';
3434
import { initRuntimeConfig, resetRuntimeConfigForTesting } from '../../runtime-config';
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
const CODE: InstalledPackageRow = {
3742
manifest: { id: 'com.acme.code', name: 'Code App', version: '1.0.0', scope: 'project' },

‎ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.pickerLoadFailure.test.tsx‎

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

143143
import { MetadataResourceEditPage, viewRefCatalog } from './ResourceEditPage';
144+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
145+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
146+
// Resident before any case, so the zh rows below read synchronously.
147+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
148+
await loadStudioCatalogue('zh');
144149

145150
function mountEditor() {
146151
render(

‎ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.referencesColumns-25916.test.tsx‎

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

7474
import { MetadataResourceEditPage } from './ResourceEditPage';
75+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
76+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
77+
// Resident before any case, so the zh rows below read synchronously.
78+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
79+
await loadStudioCatalogue('zh');
7580

7681
const START_PATH = '/metadata/object/showcase_account';
7782

‎ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.referencesErrorState.test.tsx‎

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

119119
import { MetadataResourceEditPage } from './ResourceEditPage';
120+
// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
121+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
122+
// Resident before any case, so the zh rows below read synchronously.
123+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
124+
await loadStudioCatalogue('zh');
120125

121126
const START_PATH = '/metadata/object/showcase_account';
122127

0 commit comments

Comments
 (0)