Skip to content

Commit 33c3b5e

Browse files
perf(i18n, console)!: the Developer pages' and Connect an AI assistant strings load on demand, off the eager English pack (#32255)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBQpNH669Kx1m7Ee7gTKTkq7)_ Fixes #32225 Clause-②: yes (narrowing) Metadata-protocol: none ## 维护者速读 - 改了什么:控制台「开发者」四个页面(API 控制台、流程运行、公开表单、集成与 API)、「连接 AI 助手」页面和用户记录的「AI 助手」页签所用的 `console.developer.*`、`connectAgent.*` 两组文案,从 11 种语言的语言包里整块剪出,放进新的懒加载命名空间 `@object-ui/i18n/namespaces/developer`,打开这些界面时才下载;marketplace 命名空间与它共用一个新的加载器 `createPackNamespace`。 - 为什么改:每次首屏都要下载的 `i18n-locale-en` 已顶到 60.5 KB 上限(61,881 / 62,000 B),新增英文键的 PR(#32050、#32172、#32124、#32184、#32195)在合并队列里因 `check:eager-closure` 被弹出;现在是 57,330 B,留出 4,670 B 余量,上限一个字节没动。 - 风险与回滚:文案一个字没改,每种语言仍然完整(`@object-ui/i18n/locales` 合并了所有命名空间);读这些键的组件都包在 `DeveloperNamespaceGate` 里,未加载时显示骨架屏,加载失败显示「出错了 / 重试」,绝不显示英文或原始键名。导出的 `en` / `TranslationKeys` 少了这两组键(BREAKING,见 changeset),回滚即 revert 本 PR。 - 先看:`ui/packages/i18n/src/namespaces/packNamespace.ts`(从 marketplace 抽出的通用加载器)、`ui/packages/i18n/src/namespaces/developer/index.ts`(新命名空间)、`ui/packages/app-shell/src/console/connect/DeveloperNamespaceGate.tsx`(加载框)、`ui/apps/console/vite.config.ts`(11 个 `i18n-ns-developer-*` 分块)。 - 两分钟验证:`cd ui && pnpm exec vitest run packages/i18n/src/__tests__/developer-namespace.test.ts packages/app-shell/src/console/connect/DeveloperNamespaceGate-32225.test.tsx apps/console/src/pages/developer/IntegrationsPage.developerNamespace-32225.test.tsx`,预期全绿;`pnpm --dir ui run check:eager-closure` 显示 `i18n-locale-en 56.0 KB / 60.5 KB`。 - 需要你做的:本 PR 共 8,041 行,超过 3,000 行人工合并线(不涉及受管路径),请 os-zhuang 或 hotlong 任一人 Approve;批准后席位转 ready 入合并队列,或由维护者直接合并。 ## What changes - **A second pack-shaped lazy namespace, `developer`.** `console.developer.*` (the four Developer pages) and `connectAgent.*` (the Connect an AI Assistant widget and the AI Assistants tab of a `sys_user` record) are cut whole from all eleven language packs into `ui/packages/i18n/src/namespaces/developer/<tag>.ts`, one literal `() => import()` per platform locale tag, exactly the shape of `marketplace` (#30588 / #30640). `zh-Hant.ts` is generated from `zh-Hans.ts` (`gen:zh-hant`, registered in `scripts/regen-artifacts.mjs`). Call sites are unchanged: they still call `t('console.developer.…')` / `t('connectAgent.…')` on the default namespace, and the catalogues deep-merge into the page's instance. - **One loader for both namespaces.** The marketplace index's runtime (language resolution, the two-catalogue wait, the resident short-circuit under `registerBuiltInLocales()`, the silent `addResourceBundle`, retry) moved verbatim into `namespaces/packNamespace.ts` as `createPackNamespace({ name, groups, probeKey, loaders })`. The resident check now reads any dotted group path, not only a top-level key. `@object-ui/i18n/namespaces/marketplace` exports the same names as before. - **A frame on every reader.** `DeveloperNamespaceGate` (app-shell, exported) renders children once the namespace answers `ready`, a copy-free skeleton while it loads, and the console's resident "Something went wrong / Try again" when a catalogue cannot be fetched. The four Developer pages, `ConnectAgent` and `ManagedPersonAssistants` render their bodies inside it. `PACK_NAMESPACE_FRAMES` in `ui/scripts/check-i18n-call-site-keys.mjs` now lists the developer namespace's two frame directories, so a namespace-only key read anywhere else is refused (class 9). - **Chunks.** Eleven `i18n-ns-developer-<tag>` groups (priority 84) in `ui/apps/console/vite.config.ts`. The loader module stays in `i18n-runtime` on purpose: app-shell registers the connect widgets eagerly. - **The complete door.** `@object-ui/i18n/locales` merges each pack with its marketplace and developer catalogues, so key parity, `registerBuiltInLocales()` and every test that reads a complete language still see every key. - **Budget note, ceiling unchanged.** A dated reading above `'i18n-locale-en': 62_000` in `ui/scripts/check-eager-closure-budget.mjs`. ⛔ The ceiling and its baseline are not moved. - **Changeset** `.changeset/32225-developer-lazy-namespace.md`: `@object-ui/i18n` patch and `@object-ui/console` patch, with the declaration lines and an ADR-0087 not-required marker (runtime-interface-only `TranslationKeys`, the #30640 precedent). `@object-ui/app-shell` is private and gets no row. `Clause-②: yes (narrowing)`, measured: the package entry's `en`, the exported `TranslationKeys` and the pack modules `@object-ui/i18n/locales/<code>` lose the two groups. The claim line said `no`; this is the same narrowing #30640 declared for marketplace. ### Readings (`ui/apps/console/dist/eager-closure.json`, `CI=true vite build`) | | `main` dee2e92 | this branch | change | |---|---:|---:|---:| | `i18n-locale-en` gzip | 61,881 B | 57,330 B | −4,551 B | | headroom under the 62,000 B ceiling | 119 B | 4,670 B | | | eager closure gzip | 2,267,784 B | 2,264,606 B | −3,178 B | | `i18n-runtime` gzip | 7,913 B | 8,997 B | +1,084 B | | `src` gzip | 66,844 B | 67,111 B | +267 B | | eager chunks | 105 | 105 | | The branch reading of `i18n-locale-en` is unchanged after merging `main` e1146e8 (57,330 B, closure 2,264,584 B). `i18n-runtime` grows by the shared loader plus the developer loader; `src` by the frame. ## Tests - `developer-namespace.test.ts` (new): lazy by construction (one literal `import()` per catalogue, one catalogue per built-in language, no static catalogue import, built on `packNamespace.js`), cut and not copied (each catalogue holds the two groups only, no pack holds either, the packs' other `console` groups stay), the complete door (every language carries pack and namespace keys; the entry's `en` is the resident pack alone), and the loader (refuses an unshipped code; loads a catalogue once and answers the same object after). Key parity across languages stays `all-locales-key-parity`'s. - `DeveloperNamespaceGate-32225.test.tsx` (new): zh-CN `ConnectAgent` shows the skeleton, then Chinese, never English or a raw key; ja `ManagedPersonAssistants` the same; a page that does not read the namespace fetches no developer chunk; ar fetch failure shows the resident error and Try again recovers. - `IntegrationsPage.developerNamespace-32225.test.tsx` (new): zh-CN cold mount, skeleton, then Chinese. - Existing suites held to two namespaces: `marketplace-namespace.test.ts`, `zh-hant-generated.test.ts`, `ui/scripts/__tests__/check-i18n-en-drift.test.ts`. - Ablations (`scripts/ablation-replace.mjs`): drop the namespace registration (`addResourceBundle` in `packNamespace.ts`) → red; let the gate render children while loading → red. Both restored, blob == HEAD, `git diff HEAD` empty. <details><summary>Test and gate log</summary> - vitest (`cd ui`): `packages/i18n/`, app-shell `console/connect/` and `marketplace/`, console `pages/developer/`, three `ui/scripts` suites: 188 files, 3028 passed, 16 failed on the first run; the 4 files holding them fixed and re-run 143/143 green. - type-check: `@object-ui/i18n` (both tsconfigs), `@object-ui/app-shell`, `@object-ui/console`: exit 0. eslint on touched files: 0 errors. - `pnpm --dir ui run check:eager-closure`: exit 0 (`i18n-locale-en 56.0 KB / 60.5 KB ceiling, headroom 4.6 KB`). - `check-i18n-call-site-keys`: exit 0, the developer namespace read 255 times, all inside its frames. `check-i18n-en-drift`: exit 0, 0 keys removed. `check-i18n-dead-keys`: report identical to `main` dee2e92 apart from walked-file counts (the three `connectAgent.capabilities.example*` needs-review rows are on `main` too). - `dispatch-gates.mjs --commands` at 7b1de06: 76 derived, 76 run, all exit 0 (`check:dts-closure` and `check:dual-build-cjs-loads` first exited 1 / 3 for missing dists, re-run 0 after a full `pnpm build`, 119/119 tasks); `--ran`: 76 accounted, 0 NOT-MEASURED, 0 UNRUN. - dogfood (title carries `!`): `pnpm --filter @objectstack/dogfood test` under the lock at 7b1de06 after the full build: 446 files passed, 3 skipped; 3712 tests passed, 42 skipped; VERDICT command-exit 0. - Head 04e5c1e merges `main` bb67b98 (no `ui/` change beyond `ui/packages/auth`, no `en` key change): the four namespace and frame test files re-run 109/109, `check-i18n-call-site-keys` exit 0. </details> ## Acceptance notes - Five merge-queue ejections at `i18n-locale-en`: the chunk is now 57,330 B against 62,000 B, 4,670 B of headroom, without moving the ceiling or the baseline. - Every locale moved with the subtree; no string text changed. - No first-load surface reads the moved keys: a cold load of `/home` fetches no `i18n-ns-developer-*` chunk. ## Verification Production preview build of this branch (`vite preview`) over a showcase dev boot, admin sign-in, en-US and zh-CN, each surface opened from a cold load in a fresh context: | surface | en | zh-CN | |---|---|---| | `/home` | no developer chunk | no developer chunk | | Developer › Integrations, API console, Flow runs, Public forms | `i18n-ns-developer-en` | `i18n-ns-developer-zh-Hans` + `-en` | | Account › Connect an AI Assistant | `i18n-ns-developer-en` | `i18n-ns-developer-zh-Hans` + `-en` | | Setup › Users › a user › AI Assistants tab | `i18n-ns-developer-en` | `i18n-ns-developer-zh-Hans` + `-en` | No raw `console.developer.*` / `connectAgent.*` key text on any page, no failed frame, no skeleton left after load; the zh-CN pages read in Chinese (for example 「集成与 API」, 「连接 AI 智能体(MCP)」, 「已授权的 AI 助手」). Shots: project folder `ui-orders/32225-shots/` (14 files). <details><summary>Browser harness notes</summary> The console builds with a relative `base` (`./`), which the preview server does not rewrite for deep links, so the harness mapped `/apps/…/assets/*` requests to `/assets/*`; the chunk names in the table are the requested file names. The "Agent key" default in the API-key name box is a hard-coded initial value in `AgentConnectSection.tsx` on `main`, not a key of this namespace. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WGufzhSZ8Aow2HhBCMAYta <!-- signed: domain:ui#2 · os-support-ai · session_01WGufzge87Pae2h7uSQzX8H --> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
1 parent a923d47 commit 33c3b5e

48 files changed

Lines changed: 4670 additions & 3371 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@object-ui/i18n': patch
3+
'@object-ui/console': patch
4+
---
5+
6+
perf(i18n, console)!: the console's Developer pages and its Connect an AI assistant strings load on demand, off the English pack every page load pays for
7+
8+
Clause-②: yes (narrowing)
9+
Metadata-protocol: none
10+
11+
<!-- adr-0087: not-required (runtime-interface-only ui/packages/i18n/src/locales/en.ts#TranslationKeys) the key type of the console's own translation catalogue: no Zod schema, no spec declaration and no stored metadata reads it, so the compiler is the channel that reaches every caller -->
12+
13+
The `console.developer.*` and `connectAgent.*` groups left the language packs (all eleven) for a new lazy namespace, `@object-ui/i18n/namespaces/developer`: one partial pack per platform locale table tag, fetched when a surface that reads them mounts and merged into the page's i18next instance. Call sites are unchanged — they still ask `t('console.developer.…')` / `t('connectAgent.…')` of the default namespace. The readers are the console's four Developer pages (API console, flow runs, public forms, integrations), the Connect an assistant page's widget and the AI Assistants tab of a user record; each renders under a frame that shows a skeleton until its strings are in, never English in a translated console nor a raw key.
14+
15+
The marketplace namespace and the new one share one runtime, `createPackNamespace` (`@object-ui/i18n`'s `namespaces/packNamespace.ts`); `@object-ui/i18n/namespaces/marketplace`'s exports are unchanged.
16+
17+
Every string is still in every language and no text changed: `@object-ui/i18n/locales` (the all-packs door) hands out each language complete, its pack merged with every namespace catalogue, so key parity and `registerBuiltInLocales()` still cover the moved keys.
18+
19+
**BREAKING** (`@object-ui/i18n`, TypeScript and the pack modules): the package entry's `en`, the exported `TranslationKeys` (`typeof en`) and the pack modules `@object-ui/i18n/locales/<code>` no longer hold the `console.developer.*` and `connectAgent.*` keys. A `t()` call that names one still compiles, since its key is a `string`. A component outside the console's Developer pages and app-shell's connect widgets that reads one of those keys calls `useDeveloperNamespace()` (from `@object-ui/i18n/namespaces/developer`) and renders it once the answer is `ready`; code that reads the catalogue objects directly reads them from `@object-ui/i18n/locales`, whose languages are complete.

‎scripts/regen-artifacts.mjs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,18 @@ export const NOT_DRIVER_MANAGED = Object.freeze([
940940
+ 'its source, so a conflict is resolved by taking either side and running '
941941
+ '`pnpm --filter @object-ui/i18n gen:zh-hant`.',
942942
},
943+
// objectstack#32225: the developer namespace's Traditional Chinese catalogue, same command.
944+
{
945+
path: 'ui/packages/i18n/src/namespaces/developer/zh-Hant.ts',
946+
gen: 'gen:zh-hant',
947+
owner: '@object-ui/i18n',
948+
why:
949+
'generated WHOLE from the namespace\'s `zh-Hans.ts` by the same `gen:zh-hant` run that writes '
950+
+ 'the pack, and not routed for the same reason as the marketplace catalogue above: no `check:` '
951+
+ 'script proves its currency. The proof is the same package test, which walks every generated '
952+
+ 'target. Line-aligned with its source, so a conflict is resolved by taking either side and '
953+
+ 'running `pnpm --filter @object-ui/i18n gen:zh-hant`.',
954+
},
943955
]);
944956

945957
/** Marker file (inside the git dir, never the worktree) listing paths the driver deferred. */

‎ui/apps/console/src/pages/developer/ApiConsolePage.tsx‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
import { useState, useCallback, useMemo } from 'react';
3131
import { useSearchParams } from 'react-router-dom';
32-
import { useAdapter } from '@object-ui/app-shell';
32+
import { useAdapter, DeveloperNamespaceGate } from '@object-ui/app-shell';
3333
import { useObjectTranslation } from '@object-ui/i18n';
3434
import {
3535
Badge,
@@ -149,7 +149,19 @@ function MethodPicker({
149149
);
150150
}
151151

152+
/**
153+
* Its strings are the lazy `developer` i18n namespace's, so the page body
154+
* renders under `DeveloperNamespaceGate` (objectstack#32225).
155+
*/
152156
export function ApiConsolePage() {
157+
return (
158+
<DeveloperNamespaceGate>
159+
<ApiConsolePageBody />
160+
</DeveloperNamespaceGate>
161+
);
162+
}
163+
164+
function ApiConsolePageBody() {
153165
// objectui#13460 — the page's copy reads `console.developer.apiConsole.*`;
154166
// each inline `defaultValue` is the `en` pack's value, held byte-identical to
155167
// it by `pnpm check:i18n-keys`, so a provider-less mount still reads English.

‎ui/apps/console/src/pages/developer/FlowRunsPage.tsx‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import { useEffect, useMemo, useState, useCallback } from 'react';
2020
import { useDisplayLocale, useObjectTranslation } from '@object-ui/i18n';
21-
import { ConsolePageHeader, useAdapter, useMetadata, FlowRunner, type ScreenFlowState } from '@object-ui/app-shell';
21+
import { ConsolePageHeader, useAdapter, useMetadata, FlowRunner, type ScreenFlowState, DeveloperNamespaceGate } from '@object-ui/app-shell';
2222
import { createAuthenticatedFetch } from '@object-ui/auth';
2323
import {
2424
Card,
@@ -206,7 +206,19 @@ function FlowPicker({
206206
);
207207
}
208208

209+
/**
210+
* Its strings are the lazy `developer` i18n namespace's, so the page body
211+
* renders under `DeveloperNamespaceGate` (objectstack#32225).
212+
*/
209213
export function FlowRunsPage() {
214+
return (
215+
<DeveloperNamespaceGate>
216+
<FlowRunsPageBody />
217+
</DeveloperNamespaceGate>
218+
);
219+
}
220+
221+
function FlowRunsPageBody() {
210222
const { t } = useObjectTranslation();
211223
const adapter = useAdapter();
212224
const client: any = adapter?.getClient?.();
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
/**
4+
* objectstack#32225 — the Developer pages' strings (`console.developer.*`, and
5+
* the Integrations page's agent section's `connectAgent.*`) are a lazy
6+
* namespace, and a page never shows them in English or as raw keys while it
7+
* loads.
8+
*
9+
* Both groups left the language packs for `@object-ui/i18n/namespaces/developer`.
10+
* Each Developer page renders its body under app-shell's
11+
* `DeveloperNamespaceGate`: a copy-free skeleton (`developer-namespace-loading`)
12+
* until the namespace is in, then the page, in the console's language from the
13+
* first frame that has text.
14+
*
15+
* Every text node the page ever adds is recorded (a MutationObserver attached
16+
* before the first render), so "never English, never a raw key" holds over the
17+
* whole sequence, not only its end.
18+
*
19+
* ## The registry is put back in its production state
20+
*
21+
* The DOM setup calls `registerBuiltInLocales()`, which registers every
22+
* language COMPLETE — the namespace included — so the page would never need a
23+
* fetch. This file re-registers each language as its pack alone, at module
24+
* scope: the registry a console that awaited `preloadBootstrapLocale()` holds.
25+
*
26+
* Harness: `IntegrationsPage.pageHeader-12553.test.tsx`'s router and empty
27+
* reads, under a real `I18nProvider`.
28+
*/
29+
30+
import '@testing-library/jest-dom/vitest';
31+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
32+
import { act, cleanup, render, screen } from '@testing-library/react';
33+
import { MemoryRouter, Route, Routes } from 'react-router-dom';
34+
35+
import { I18nProvider } from '@object-ui/i18n';
36+
import { builtInLocales } from '@object-ui/i18n/locales';
37+
import { BUILT_IN_LANGUAGE_CODES, registerBuiltInLocale } from '@object-ui/i18n/locales/registry';
38+
import en from '@object-ui/i18n/locales/en';
39+
import zhHans from '@object-ui/i18n/locales/zh-Hans';
40+
import zhHant from '@object-ui/i18n/locales/zh-Hant';
41+
import ja from '@object-ui/i18n/locales/ja';
42+
import ko from '@object-ui/i18n/locales/ko';
43+
import de from '@object-ui/i18n/locales/de';
44+
import fr from '@object-ui/i18n/locales/fr';
45+
import es from '@object-ui/i18n/locales/es';
46+
import ptBr from '@object-ui/i18n/locales/pt-BR';
47+
import ru from '@object-ui/i18n/locales/ru';
48+
import ar from '@object-ui/i18n/locales/ar';
49+
import { IntegrationsPage } from './IntegrationsPage';
50+
51+
const PACKS: Record<string, Record<string, unknown>> = {
52+
en, 'zh-Hans': zhHans, 'zh-Hant': zhHant, ja, ko, de, fr, es, 'pt-BR': ptBr, ru, ar,
53+
};
54+
for (const code of BUILT_IN_LANGUAGE_CODES) registerBuiltInLocale(code, PACKS[code]);
55+
56+
const ENGLISH = builtInLocales.en.console.developer.integrations;
57+
const RAW_KEY = /\b(?:console\.developer|connectAgent)\.[A-Za-z]/;
58+
59+
beforeEach(() => {
60+
// The object list and the agent section's discovery read: both answer empty.
61+
vi.stubGlobal(
62+
'fetch',
63+
vi.fn(async () => new Response(JSON.stringify({ data: [] }), { status: 200 })),
64+
);
65+
});
66+
afterEach(() => {
67+
cleanup();
68+
vi.unstubAllGlobals();
69+
});
70+
71+
describe('a Developer page waits for its strings (objectstack#32225)', () => {
72+
it('zh-CN: Integrations & APIs shows the skeleton, then Chinese, and never English or a raw key', async () => {
73+
const zh = builtInLocales['zh-Hans'].console.developer.integrations;
74+
const container = document.createElement('div');
75+
document.body.appendChild(container);
76+
const texts: string[] = [];
77+
const observer = new MutationObserver((records) => {
78+
for (const r of records) {
79+
if (r.type === 'characterData') texts.push(r.target.textContent ?? '');
80+
for (const node of Array.from(r.addedNodes)) texts.push(node.textContent ?? '');
81+
}
82+
});
83+
observer.observe(container, { childList: true, subtree: true, characterData: true });
84+
render(
85+
<I18nProvider config={{ defaultLanguage: 'zh-CN', detectBrowserLanguage: false }} persistLanguage={false}>
86+
<MemoryRouter initialEntries={['/apps/demo/developer/integrations']}>
87+
<Routes>
88+
<Route path="/apps/:appName/developer/integrations" element={<IntegrationsPage />} />
89+
</Routes>
90+
</MemoryRouter>
91+
</I18nProvider>,
92+
{ container },
93+
);
94+
// The first frame holds no namespace text — in no language, and not as a
95+
// key — only the skeleton.
96+
texts.push(container.textContent ?? '');
97+
expect(container.textContent ?? '').not.toMatch(RAW_KEY);
98+
expect(container.textContent ?? '').not.toContain(ENGLISH.title);
99+
expect(screen.getByTestId('developer-namespace-loading')).toBeInTheDocument();
100+
101+
expect(await screen.findByText(zh.title)).toBeInTheDocument();
102+
expect(screen.getByText(zh.subtitle)).toBeInTheDocument();
103+
// The agent section's `connectAgent.*` text arrived with the same catalogue.
104+
expect(container.textContent ?? '').not.toMatch(RAW_KEY);
105+
106+
await act(async () => {
107+
await Promise.resolve();
108+
});
109+
for (const r of observer.takeRecords()) {
110+
for (const node of Array.from(r.addedNodes)) texts.push(node.textContent ?? '');
111+
}
112+
const shown = texts.join('\n');
113+
expect(shown).not.toContain(ENGLISH.title);
114+
expect(shown).not.toContain(ENGLISH.subtitle);
115+
expect(shown).not.toMatch(RAW_KEY);
116+
});
117+
});

‎ui/apps/console/src/pages/developer/IntegrationsPage.tsx‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import { useEffect, useMemo, useState } from 'react';
1919
import { useNavigate, useParams } from 'react-router-dom';
20-
import { ConsolePageHeader } from '@object-ui/app-shell';
20+
import { ConsolePageHeader, DeveloperNamespaceGate } from '@object-ui/app-shell';
2121
import { useObjectTranslation } from '@object-ui/i18n';
2222
import {
2323
Card,
@@ -70,7 +70,19 @@ function CopyButton({ value, ariaLabel }: { value: string; ariaLabel: string })
7070
);
7171
}
7272

73+
/**
74+
* Its strings are the lazy `developer` i18n namespace's, so the page body
75+
* renders under `DeveloperNamespaceGate` (objectstack#32225).
76+
*/
7377
export function IntegrationsPage() {
78+
return (
79+
<DeveloperNamespaceGate>
80+
<IntegrationsPageBody />
81+
</DeveloperNamespaceGate>
82+
);
83+
}
84+
85+
function IntegrationsPageBody() {
7486
// objectui#13460 — the page's copy reads `console.developer.integrations.*`;
7587
// each inline `defaultValue` is the `en` pack's value, held byte-identical to
7688
// it by `pnpm check:i18n-keys`, so a provider-less mount still reads English.

‎ui/apps/console/src/pages/developer/PublicFormsPage.tsx‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676

7777
import { useEffect, useState } from 'react';
7878
import { useHref } from 'react-router-dom';
79-
import { useAdapter } from '@object-ui/app-shell';
79+
import { useAdapter, DeveloperNamespaceGate } from '@object-ui/app-shell';
8080
import { useObjectTranslation } from '@object-ui/i18n';
8181
import {
8282
Card,
@@ -207,7 +207,19 @@ function FormsPicker<V extends string>({
207207
);
208208
}
209209

210+
/**
211+
* Its strings are the lazy `developer` i18n namespace's, so the page body
212+
* renders under `DeveloperNamespaceGate` (objectstack#32225).
213+
*/
210214
export function PublicFormsPage() {
215+
return (
216+
<DeveloperNamespaceGate>
217+
<PublicFormsPageBody />
218+
</DeveloperNamespaceGate>
219+
);
220+
}
221+
222+
function PublicFormsPageBody() {
211223
// objectui#13460 — the page's copy reads `console.developer.publicForms.*`
212224
// (and `common.*` for Refresh / Actions / Cancel / Save); each inline
213225
// `defaultValue` is the `en` pack's value, held byte-identical to it by

‎ui/apps/console/vite.config.ts‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,27 @@ export default defineConfig({
12801280
{ name: 'i18n-ns-marketplace-ko', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]marketplace[\\/]ko\.ts$/, priority: 84 },
12811281
{ name: 'marketplace-namespace-gate', test: /[\\/]packages[\\/]app-shell[\\/]src[\\/]console[\\/]marketplace[\\/](?:MarketplaceNamespaceGate\.tsx|marketplaceFrameHolding\.ts)$/, priority: 84, includeDependenciesRecursively: false },
12821282
//
1283+
// The `developer` namespace (objectstack#32225): `console.developer.*` and
1284+
// `connectAgent.*`, moved out of the packs for the same reason. Every
1285+
// catalogue is `import()`ed by `packages/i18n/src/namespaces/developer/index.ts`
1286+
// when a surface that reads them mounts, so one group per catalogue for
1287+
// the rule above. The loader module takes no group of its own: its one
1288+
// importer is app-shell's `DeveloperNamespaceGate`, which the two
1289+
// `console/connect/` widgets render and app-shell registers eagerly, so
1290+
// the loader (with `../packNamespace.ts`) is honestly eager and sits in
1291+
// `i18n-runtime` below; only the catalogues are lazy.
1292+
{ name: 'i18n-ns-developer-en', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]developer[\\/]en\.ts$/, priority: 84 },
1293+
{ name: 'i18n-ns-developer-zh-Hans', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]developer[\\/]zh-Hans\.ts$/, priority: 84 },
1294+
{ name: 'i18n-ns-developer-zh-Hant', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]developer[\\/]zh-Hant\.ts$/, priority: 84 },
1295+
{ name: 'i18n-ns-developer-es', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]developer[\\/]es\.ts$/, priority: 84 },
1296+
{ name: 'i18n-ns-developer-ar', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]developer[\\/]ar\.ts$/, priority: 84 },
1297+
{ name: 'i18n-ns-developer-fr', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]developer[\\/]fr\.ts$/, priority: 84 },
1298+
{ name: 'i18n-ns-developer-pt-BR', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]developer[\\/]pt-BR\.ts$/, priority: 84 },
1299+
{ name: 'i18n-ns-developer-ru', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]developer[\\/]ru\.ts$/, priority: 84 },
1300+
{ name: 'i18n-ns-developer-de', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]developer[\\/]de\.ts$/, priority: 84 },
1301+
{ name: 'i18n-ns-developer-ja', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]developer[\\/]ja\.ts$/, priority: 84 },
1302+
{ name: 'i18n-ns-developer-ko', test: /[\\/]packages[\\/]i18n[\\/]src[\\/]namespaces[\\/]developer[\\/]ko\.ts$/, priority: 84 },
1303+
//
12831304
// ⛔ `i18n-runtime` takes `includeDependenciesRecursively: false`
12841305
// for the reason `data-adapter` below does (objectui#9345, read out
12851306
// there in full): it outranks `framework` (83 over 80), and since

‎ui/packages/app-shell/src/console/connect/ConnectAgentWidget.tsx‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ import {
101101
} from './connectClientPreference.js';
102102
import { isPublicHttpsAddress } from './deploymentReach.js';
103103
import { AuthorizedAccessList } from './AuthorizedAccessList.js';
104+
import { DeveloperNamespaceGate } from './DeveloperNamespaceGate.js';
104105
import { useConnectedAccess, type ConnectedEntry } from './connectedAccess.js';
105106

106107
const SERVER_URL = (import.meta.env.VITE_SERVER_URL || '').replace(/\/$/, '');
@@ -257,7 +258,19 @@ function mcpServersJson(type: string | null, url: string): string {
257258
return JSON.stringify({ mcpServers: { objectstack: server } }, null, 2);
258259
}
259260

261+
/**
262+
* The Connect an assistant page's widget. Its strings are the lazy `developer`
263+
* namespace's, so the body renders under `DeveloperNamespaceGate`.
264+
*/
260265
export function ConnectAgent() {
266+
return (
267+
<DeveloperNamespaceGate>
268+
<ConnectAgentBody />
269+
</DeveloperNamespaceGate>
270+
);
271+
}
272+
273+
function ConnectAgentBody() {
261274
const { t } = useObjectTranslation();
262275
const [loading, setLoading] = useState(true);
263276
const [mcpUrl, setMcpUrl] = useState<string | null>(null);

0 commit comments

Comments
 (0)