Skip to content

Commit a931063

Browse files
feat(console-ai): the AI assistant is one right-side drawer, opened from the top-bar robot and maximized in place (#34665)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBLW6dHPW6sSheA32XPKZzPV)_ Fixes #34608 Clause-②: yes (widening — new @object-ui/i18n locale keys only) Metadata-protocol: none ADR: the ui ADR-0057 amendment this implements is #34640 (Amendment A3, docs only, Tier H). ## 维护者速读 - 改了什么:AI 助手只剩右侧抽屉这一个容器。顶栏机器人在当前页开关抽屉,URL 不变;右下角浮动按钮去掉。抽屉的「放大」是原地铺满整个窗口,左侧多一列历史,同一个按钮收回;侧栏宽度时历史在「History」按钮后面。Home 也有同一个抽屉。Home 的「用 AI 搭建 / 问 AI」和应用管理的「用 AI 编辑」改为打开抽屉。旧的 `/ai`、`/ai/build/<id>` 链接(包括分享链接)打开抽屉并铺满,显示链接指向的会话。应用内搭建者的空状态同时给出「问数据」和「改应用」的引导。 - 为什么改:#34608 的裁定「同意」:一个右侧抽屉,原地放大可收回,入口只有顶栏机器人,旧链接重定向到打开的抽屉。新搭建仍然先不绑定应用(ADR-0057 A1 保留)。 - 风险与回滚:只改控制台前端(app-shell、console、i18n 新键),不动元数据、契约和服务端。`/ai` 路由保留,书签和分享链接继续可用。抽屉显示哪个会话存在本标签页的 sessionStorage,不进 URL。回滚即 revert 本 PR。改动行数 3214,超过 3000 行的人工合并阈值,主要是重写抽屉主体和删除浮动按钮的旧测试。 - 先看:① `ui/packages/app-shell/src/layout/useConsoleChatDock.tsx`(抽屉托管:开关、放大、目标、交接、快捷键);② `layout/ChatDock.tsx` 的 `ChatDockPanel`(同一个 aside 切换 `fixed inset-0`,历史按钮)和 `layout/ChatDockConversation.tsx`(按目标解析会话、历史列);③ `console/ai/AiAddressRedirect.tsx` 和 `ui/apps/console/src/App.tsx` 的 `/ai` 路由。 - 两分钟验证:在仓根执行 `pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/ConsoleLayout.robotTogglesDrawer-34608.test.tsx packages/app-shell/src/layout/__tests__/ChatDock.test.tsx packages/app-shell/src/console/ai/__tests__/AiAddressRedirect-34608.test.tsx packages/app-shell/src/console/ai/__tests__/AiChatPage.appContextComposer-11658.test.tsx`,预期全部通过(对应验收 1 到 4)。 - 需要你做的:先审批 ADR PR #34640(Tier H)。本 PR 超过人工合并阈值,需要你来合并。 ## Before and after | | Before (`origin/main` 97defd6) | After | |---|---|---| | Top-bar robot | `<Link to="/ai">`: leaves the page for the full-page chat | Toggles the drawer on the current page; `aria-pressed` follows it; the URL does not change | | Bottom-right floating button | Shown while the dock is closed; carried the plan-pending marker | Removed; the robot carries the marker | | Maximize | Navigated to `/ai` or `/ai/build?package=PKG` | The same `<aside>` becomes `fixed inset-0 z-40` in place (no remount); the same button restores | | History | Only on the `/ai` page | Rail: behind a "History" button. Full window: a column beside the chat. Phone sheet: a "History" button | | Home | Floating button to the full page; no dock | Hosts the same drawer | | `/ai`, `/ai/:agent`, `/ai/:agent/:id` | The full-page chat | Open the drawer on that address, filling the window, over the declared home | | "Build with AI" / "Ask AI" (Home), "Edit with AI" (app management) | Navigated to `/ai/build…` / `/ai/ask` | Open the drawer on that agent / package / fresh thread | | Builder empty state inside an app | Change guidance only; change starters | Names data questions and changes; the first two starters are data questions | | Share in the dock | No-op (`onShare` unwired) | Opens the share dialog | ## What changes **The drawer host.** New `layout/useConsoleChatDock.tsx`, mounted by both `ConsoleLayout` and `HomeLayout`. It owns: - The dock state: `useChatDockState` with the per-tab expanded flag and a new per-tab full-window flag. - The drawer's target, a `ChatDockTarget` (`agent`, `conversationId`, `packageId`, `fresh`) kept in sessionStorage. Absent means the ambient thread, so the existing app binding (A2) is unchanged. - A Builder handoff held in memory with a sequence number (objectui#12493). - The ⌘/Ctrl+Shift+I toggle and the assistant-bus open request. - Leaving the page (pathname or search changes) drops full window back to the rail. It returns the rail (for `AppShell`'s `rightRail`), the phone sheet, and a `ChatDockControl` handle provided through `ChatDockControlProvider`. **Opening the drawer.** New `layout/chatDockControl.tsx`: `useChatDockControl()` and `useOpenAssistant()`. `useOpenAssistant` opens the drawer in place inside a host. Outside one (a page no host wraps) it navigates to the old address, which the console routes back into the drawer. `ChatPane`'s agent launcher, package switcher, "New app" and "Open in Builder" go through it. Inside the drawer a nested provider maps those calls onto the drawer's target. **The target grammar.** New React-free `layout/chatDockTarget.ts`: `parseAiAddress`, `aiAddressOf`, the target and full-window storage helpers (no-ops inside a frame, objectstack#26470), `sameDockTarget`, and `readBuilderHandoffState` (moved from `AiChatPage`). **The panel.** `layout/ChatDock.tsx`: - `useChatDockState` gains `fullWindow` and `setFullWindow`. Setting it expands the drawer; `toggle` and `collapse` clear it. It persists with `persistFullWindow`. - `ChatDockPanel`: with `fullWindow` the same `<aside>` switches to `fixed inset-0 z-40` with no width or resize handle. The expand button (`chat-dock-maximize`, "Expand" / "Restore side panel") calls `setFullWindow`. A History toggle shows at rail width. - `ChatDockMobileSheet`: the deferred maximize bridge is removed; it gets a History toggle. - `onMaximize` and `onBoundPackageChange` are removed. The Live Canvas `maximize()` / `restore()` latch is unchanged. **The body.** `layout/ChatDockConversation.tsx` resolves its agent and conversation from the target: - A named agent through `resolveAgentParam`. A legacy bare conversation id is resolved to its agent through `fetchConversation`. - A maker opening a bare `ask` is converged to `build` (cloud#1674). - `forceNew` for a fresh target. The minted id is written back to the target once the first send creates it. - A1.b bind-on-create re-keys the scope and names the package on the target. - The handoff is seeded once per sequence. - Full window draws `ConversationsSidebar` as a column. Rail and sheet draw it as an overlay over the still-mounted pane. - The share dialog and the build debug drawer are wired. **History.** `console/ai/ConversationsSidebar.tsx` gets a hosted mode (`onSelectConversation`, `onNewConversation`, `activeConversationId`): rows, "New" and deleting the open thread call back instead of navigating. **Entries.** - New `layout/AssistantTopBarButton.tsx` replaces AppHeader's robot link. With a host it is a toggle; without one it is still a link to `/ai`. - `HomePage` and `AppManagementPage` use `useOpenAssistant`. - `ConsoleChatbotFab.tsx` and its two test files are deleted. **Addresses.** New `console/ai/AiAddressRedirect.tsx` writes the parsed target, the expanded flag and the full-window flag, then replaces the visit with `useHomePath()`, passing a handoff on as navigation state. `ui/apps/console/src/App.tsx` routes the three `/ai` paths to it inside `RequireAiSurface`. The lazy `DefaultAiChatPage` and `components/aiChatPage.ts` are removed. `AiChatPage` stays exported; the console no longer routes to it. **Guidance.** `agentEmptyState`'s edit-mode description reads `console.ai.empty.editApp.askOrChangeDescription`. The new exported `editAppDataSuggestions(t)` puts two data questions ahead of the change starters when editing. **i18n.** New keys in all 11 packs: `console.ai.dock.history`, `.backToChat`, `.expand`, `.restore`, `console.ai.empty.editApp.askOrChangeDescription`. No key removed or changed. ## Tests New: - `layout/__tests__/ConsoleLayout.robotTogglesDrawer-34608.test.tsx` (replaces `ConsoleLayout.fabYieldsToOpenDock-10899`): real `ConsoleLayout`, host, dock state and robot. The robot opens the drawer on `/apps/crm/opportunity` with the URL unchanged, closes it again, and no floating button exists. **Acceptance 1.** - `layout/__tests__/ChatDock.test.tsx`: expand asks for full window, the full panel is `fixed inset-0` with no resize handle and a "Restore side panel" button that restores. The same `<aside>` and the same body element survive the switch (no remount). The rail's History toggle and the full window's column (no toggle). The sheet has no expand button and has a History toggle. `useChatDockState` full-window semantics and persistence. **Acceptance 2.** - `console/ai/__tests__/AiChatPage.appContextComposer-11658.test.tsx`: inside an app the build pane's first two suggestions are data questions, then the change starters, and the empty description names data. A control with no app. **Acceptance 3.** - `console/ai/__tests__/AiAddressRedirect-34608.test.tsx`: `/ai/build/c-42` lands home with the target, expanded and full window armed. `?package=&new=1` is kept. Bare `/ai` clears an old target. The declared home is honoured. A handoff rides navigation state and never storage. **Acceptance 4.** - `layout/__tests__/ChatDock.appBinding-10926.test.tsx`: a build target naming app X opened with no app in view resumes the thread the in-app dock bound to X. A target naming a conversation shows that conversation. **Acceptance 4.** - `layout/__tests__/chatDockTarget.test.tsx`: address parsing (mount prefix, `?agent=`, escapes), `aiAddressOf` round trip, storage round trip, malformed storage, frame isolation. - `console/ai/__tests__/ConversationsSidebar.test.tsx`: the hosted mode. - `console/ai/__tests__/editModeEmptyState.test.ts`: the description and `editAppDataSuggestions`. Re-pointed: - The plan-pending marker pins (`launcherPlanApprovalMarker-11666`, `AiChatPage.planApprovalReachesLaunchers-11666`) now target the robot. - `ConsoleLayout.previewFrameDock-26470` presses the robot. - `ConsoleLayout.dockBinding-10926`'s two maximize-routing cases became "the target is held per tab and survives a remount" and "back to ambient clears it". - Dock-state stubs gained `fullWindow`. - The console `App.*` tests stub `AiAddressRedirect` where they stubbed `DefaultAiChatPage`. Deleted: `ConsoleChatbotFab.test.tsx`, `ConsoleChatbotFab.yieldsCorner-12248.test.tsx` (the component is gone), `ConsoleLayout.aiEntryAsksUnsaved-13253.test.tsx` (maximize no longer leaves the page, so there is nothing to confirm). ## Acceptance notes - The order lists acceptance 4 as "an old `/_console/ai/build/<id>` link shows that conversation". The redirect is pinned on the route table's paths (the router basename strips `/_console`), and the drawer resolving the conversation is pinned on the real body. - Moving between apps with a target set (L1 S1, read live on 910dbeb, comment below): the target is per tab and never infers the app, so it follows you. A history row names its agent and conversation only (the server stores no package on a thread), so a build row picked inside CRM shows with the "New app" chip and stays on that thread after you move to Setup. A target that names a package (the drawer's app switcher, "Edit with AI") keeps naming it: after moving from CRM to Setup the chip still reads "CRM" and the empty state "Editing “CRM”". With no target the drawer shows the ambient thread of the app in view: "Editing “CRM”" in CRM, and the unbound "Build with AI" thread in Setup (a built-in app, not authorable). Before A3, A2 bound the in-app dock to the app in view in every case; this PR keeps that only for the ambient thread. - What the drawer shows lives in sessionStorage per tab, not in the URL. ui ADR-0054 C3 asks for URL reflection where deep-linking matters. The `/ai…` addresses are that door, as Amendment A3 records. - Cold boot on an old link: `useHomePath()` answers `/home` until the app list loads, so the drawer opens over the launcher rather than the declared app. Both host the same drawer. - `data-fab-yield` attributes in `plugin-detail` (`InlineEditSaveBar`) and `RecordAttachmentsPanel` no longer have a reader. Left in place. A follow-up can remove them. - `console.ai.dock.maximize` and `console.ai.empty.editApp.description` are no longer read. They are kept, because the scope is new keys only. The dead-key report lists the first as needs-review. - Studio's copilot maximize still navigates to `/ai/build?package=…`. It now lands on Home with the drawer maximized on that package's thread. #34610 replaces it with an in-place widen (A3, "One container"). - The `AiChatPage` page component stays exported (17 test files render it). Unrouting it is a follow-up. - The composer hint already read 「问问数据,或让我改改这个应用…」 / "Ask about your data, or ask me to change this app…". I left it as it was. - Neighbours: no change to `ChatbotEnhanced.tsx` or `PendingDraftsBar.tsx` (#34609, #34539). ## Verification Head 910dbeb. Run in a 4-vCPU cloud container. Tests: - `pnpm --dir ui exec vitest run packages/app-shell/src/console/ai packages/app-shell/src/console/home packages/app-shell/src/layout packages/app-shell/src/chrome packages/app-shell/src/views/studio-design/__tests__/studioCopilotOpenFullPage-12842.test.tsx packages/app-shell/src/__tests__/print-stylesheet-4462.test.ts`: 265 of 266 files passed and 1746 tests passed. `chatDockTarget.test.ts` failed to collect under the node project (`window is not defined`). It is renamed to `.tsx` in 9c18bb8 and passes (with `ChatDock.test.tsx` and `ChatDock.appBinding-10926`: 3 files, 34 tests). - `pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/ChatDock packages/app-shell/src/layout/__tests__/ConsoleLayout packages/i18n apps/console/src/__tests__/App …`: 134 of 135 files passed. `zh-hant-generated` failed because `zh-Hant.ts` is generated output. It was regenerated with `pnpm --filter @object-ui/i18n gen:zh-hant` in 9c18bb8 and passes (10 tests). - After 910dbeb: `KeyboardShortcutsDialog.wiredOnly-11674` and every `ConsoleLayout.*` test: 10 files, 45 tests, all passed. - The full app-shell suite was not run: about 2200 files, more than 40 minutes on this box. The affected directories above were run instead. Type-check and lint: - `tsc --noEmit` and `tsc -p tsconfig.test.json` in `ui/packages/app-shell`: exit 0. - `tsc --noEmit` in `ui/apps/console` after `pnpm --filter @object-ui/app-shell build`: exit 0. - `npx eslint` on every changed ui file: 0 errors. The warnings are pre-existing kinds; the one new `react-hooks/refs` warning was removed. - `node ui/scripts/check-i18n-call-site-keys.mjs`: exit 0. `node ui/scripts/check-i18n-en-drift.mjs`: exit 0. `node ui/scripts/check-i18n-dead-keys.mjs`: exit 0 (a report; it lists `console.ai.dock.maximize` as needs-review). Derived gates (`node scripts/pm/dispatch-gates.mjs --commands`, 41 commands, run at d82cadc while 9c18bb8's rename and regeneration landed; neither touches what a gate reads except test-source-alias, re-run at 910dbeb): - `node scripts/check-adr-0087-registration.mjs --base origin/main`: exit 0 - `node scripts/check-adr-0087-registration.mjs --self-test`: exit 0 - `node scripts/check-changeset-no-major.mjs --base origin/main`: exit 0 - `node scripts/check-closing-keyword-parity.mjs`: exit 0 - `node scripts/check-closing-keyword-parity.mjs --self-test`: exit 0 - `node scripts/check-comment-mask-corpus.mjs`: exit 0 - `node scripts/check-empty-changeset.mjs --base origin/main`: exit 0 - `node scripts/check-empty-changeset.mjs --self-test`: exit 0 - `node scripts/check-sdui-manifest.mjs`: exit 0 - `node scripts/check-sdui-manifest.mjs --self-test`: exit 0 - `node scripts/ci/snapshot-next.mjs --self-test`: exit 0 - `node scripts/pm/check-governed-queue-guard.mjs --self-test`: exit 0 - `node scripts/pm/release-rehearsal-clone.mjs --self-test`: exit 0 - `node scripts/release-pending-publish.mjs --self-test`: exit 0 - `pnpm --dir ui exec vitest run scripts/`: exit 0 - `pnpm --filter @objectstack/spec run check:duration-unit-keys`: exit 0 - `pnpm check:adr-anchors`: exit 0 - `pnpm check:changeset-gate-self-tests`: exit 0 - `pnpm check:closed-ceremony-text`: exit 0 - `pnpm check:cross-package-test-inputs`: exit 0 - `pnpm check:dispatcher-error-vocabulary`: exit 0 - `pnpm check:driver-memory-census`: exit 0 - `pnpm check:engine-double-contract`: exit 0 - `pnpm check:error-status-conformance`: exit 0 - `pnpm check:gitlink-declared`: exit 0 - `pnpm check:merge-driver`: exit 0 - `pnpm check:nul-bytes`: exit 0 - `pnpm check:published-files`: exit 0 - `pnpm check:query-options-erasure`: exit 0 - `pnpm check:refd-timer-probe`: exit 0 - `pnpm check:registry-log-declared`: exit 0 - `pnpm check:rest-log-spy-declared`: exit 0 - `pnpm check:role-word`: exit 0 - `pnpm check:skill-identifier-liveness`: exit 0 - `pnpm check:test-source-alias`: exit 1 on the first run (five edited layout tests reach `import('@objectstack/lint')` through `ConsoleLayout`'s draft bar). Fixed in 910dbeb with a module-top import; re-run exit 0. - `pnpm check:tier-file-adoption`: exit 0 - `pnpm check:type-check-coverage`: exit 0 - `pnpm check:type-check-debt`: exit 0 - `pnpm check:undeclared-dep-imports`: exit 0 - `pnpm check:watch-hint-literal`: exit 0 - `pnpm check:where-matcher`: exit 0 The gate report puts the change at 3214 changed lines, over the 3000-line human-merge threshold. <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufzidTEhaEGRzboS7xTa --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent b1da9f5 commit a931063

58 files changed

Lines changed: 2038 additions & 1192 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/console': patch
4+
'@object-ui/i18n': patch
5+
---
6+
7+
feat(console-ai): the AI assistant is one right-side drawer, opened from the top-bar robot, with no full page
8+
9+
Clause-②: yes (widening — new @object-ui/i18n locale keys only)
10+
Metadata-protocol: none
11+
12+
The console's AI assistant now has one container, the right-side drawer (ui ADR-0057, amended).
13+
14+
- The robot in the top bar opens and closes the drawer on the page you are on. The URL does not change. The floating button in the bottom-right corner is gone. While a proposed plan waits for approval, the robot carries the marker that button used to carry.
15+
- The drawer's expand button makes it fill the window in place, with the conversation history as a column beside the chat. The same button puts it back as a side panel. Moving to another page puts it back too. At side-panel width the history is behind a "History" button. On a phone the drawer is a bottom sheet with the same "History" button.
16+
- Home hosts the same drawer. "Build with AI" and "Ask AI" on Home, and "Edit with AI" in app management, open the drawer instead of a page. A new build still starts unbound to any app (ADR-0057 A1).
17+
- The old `/ai`, `/ai/AGENT` and `/ai/AGENT/CONVERSATION` addresses still work. That includes bookmarks, shared links, `?package=` and `?new=`. They open the drawer on the conversation they name, filling the window, over the home page. A Builder handoff still travels only as navigation state.
18+
- Inside an app, a builder's empty state offers data questions as well as changes, as the composer hint already did. Its description and its first suggestions name both.
19+
- The drawer's share button now opens the share dialog. Before, it did nothing in the drawer.
20+
21+
`@object-ui/i18n`: new keys `console.ai.dock.history`, `console.ai.dock.backToChat`, `console.ai.dock.expand`, `console.ai.dock.restore` and `console.ai.empty.editApp.askOrChangeDescription`, in every locale pack. No key was removed or changed. The console no longer reads `console.ai.dock.maximize` or `console.ai.empty.editApp.description`. Retiring them is a separate change.

‎ui/apps/console/src/App.tsx‎

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { DevModal } from './dev/DevModal';
2424
import { DevLookup } from './dev/DevLookup';
2525
import { DevRowActions } from './dev/DevRowActions';
2626
import {
27+
AiAddressRedirect,
2728
ConsoleShell,
2829
RequireAiSurface,
2930
RequireOrganization,
@@ -94,20 +95,12 @@ const DocsSlug = lazy(() => import('./pages/DocsSlug'));
9495
const DocPage = lazy(() => import('./pages/DocPage'));
9596

9697
/*
97-
* The AI chat surfaces, lazy for the same reason (objectui#13410).
98-
*
99-
* `/ai…` and the public share page `/s/:token` are the two console routes that
100-
* render the chat UI (`ChatbotEnhanced` and everything it reaches in
101-
* `@object-ui/plugin-chatbot`: `streamdown`, `shiki`, the AI Elements). Imported
102-
* statically here, that UI was in every first page load, the third-largest
103-
* eager chunk, including for users who never open a chat. The AI page arrives
104-
* through `./components/aiChatPage`, a console-local module nothing imports
105-
* statically, because an `import()` of the `@object-ui/app-shell` barrel this
106-
* file already imports would move nothing (see `./components/studioBuilder`).
98+
* The public share page `/s/:token` renders the chat UI (`ChatbotEnhanced` and
99+
* everything it reaches in `@object-ui/plugin-chatbot`), so it is lazy for the
100+
* same reason (objectui#13410). The `/ai…` addresses no longer draw a page: they
101+
* open the console's chat drawer (objectstack#34608, `AiAddressRedirect`), whose
102+
* body loads the chat UI when it first renders.
107103
*/
108-
const DefaultAiChatPage = lazy(() =>
109-
import('./components/aiChatPage').then((m) => ({ default: m.DefaultAiChatPage })),
110-
);
111104
const SharedRecordPage = lazy(() => import('./pages/SharedRecordPage'));
112105

113106
const SERVER_URL = import.meta.env.VITE_SERVER_URL || '';
@@ -498,34 +491,33 @@ export function App() {
498491
</Route>
499492
<Route path="/system/*" element={<SystemRedirect />} />
500493
{/*
501-
AI surfaces are agent-scoped: the active assistant is baked into
502-
the route (`/ai/:agent`) rather than a `?agent=` query snapshot,
503-
so each assistant ("build" authoring vs "ask" data Q&A, plus any
504-
custom `*.agent.ts`) is its own page. AiChatPage handles the
505-
back-compat redirects: bare `/ai` → the default agent surface, and
506-
a single-segment `/ai/:agent` that is actually a legacy bare
507-
conversation id → `/ai/:agent/:conversationId`.
494+
objectstack#34608 (ui ADR-0057 as amended) — the AI assistant has
495+
one container, the right-side drawer, and no page. The old
496+
full-page addresses (`/ai`, `/ai/:agent`,
497+
`/ai/:agent/:conversationId`, with `?package=` / `?new=`) stay
498+
routed so bookmarks and shared links keep working:
499+
`AiAddressRedirect` opens the drawer on the conversation the
500+
address names, filling the window, over the declared landing.
508501
509502
`RequireAiSurface` keeps these from dead-ending on a runtime that
510503
serves no AI (Community Edition): with AI unavailable a stale
511504
bookmark / external link gets a screen saying so, with the way
512-
home, instead of a chat with no agent to talk to. Cloud installs
513-
pass straight through. Purely additive runtime gating — same
514-
server signal the floating-chat FAB has always used.
505+
home. Purely additive runtime gating — the same server signal the
506+
top-bar robot uses.
515507
*/}
516508
<Route path="/ai" element={
517509
<ProtectedRoute>
518-
<RequireAiSurface><Suspense fallback={<LoadingScreen />}><DefaultAiChatPage /></Suspense></RequireAiSurface>
510+
<RequireAiSurface><AiAddressRedirect /></RequireAiSurface>
519511
</ProtectedRoute>
520512
} />
521513
<Route path="/ai/:agent" element={
522514
<ProtectedRoute>
523-
<RequireAiSurface><Suspense fallback={<LoadingScreen />}><DefaultAiChatPage /></Suspense></RequireAiSurface>
515+
<RequireAiSurface><AiAddressRedirect /></RequireAiSurface>
524516
</ProtectedRoute>
525517
} />
526518
<Route path="/ai/:agent/:conversationId" element={
527519
<ProtectedRoute>
528-
<RequireAiSurface><Suspense fallback={<LoadingScreen />}><DefaultAiChatPage /></Suspense></RequireAiSurface>
520+
<RequireAiSurface><AiAddressRedirect /></RequireAiSurface>
529521
</ProtectedRoute>
530522
} />
531523
{/* `RedirectWithSplash`, not a bare `<Navigate>` (objectui#6378).

‎ui/apps/console/src/__tests__/App.agentChatLink-10640.test.tsx‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
* `internalFormShell.test.tsx` does. A hand-copied route list would be free to
2222
* agree with whatever the source does. Everything `App.tsx` imports but this
2323
* card does not touch is stubbed, with the same list that file uses. The
24-
* catch-all's element (`RedirectWithSplash`) and the chat page
25-
* (`DefaultAiChatPage`) are stubbed to markers; the chat stub reports the
24+
* catch-all's element (`RedirectWithSplash`) and the chat address's element
25+
* (`AiAddressRedirect`, which opens the chat drawer since objectstack#34608)
26+
* are stubbed to markers; the chat stub reports the
2627
* `:agent` and `:conversationId` params and the `new` flag it was routed with.
2728
*
2829
* The href is not written here: it is the one the REAL registered agent
@@ -91,7 +92,9 @@ vi.mock('@object-ui/app-shell', async (importOriginal) => {
9192
DefaultInvitationsPage: stub('invitations-page'),
9293
DefaultSettingsPage: stub('settings-page'),
9394
DefaultAcceptInvitationPage: stub('accept-invitation-page'),
94-
DefaultAiChatPage: AiChatPageProbe,
95+
// objectstack#34608 — the `/ai…` routes render `AiAddressRedirect` (it opens
96+
// the chat drawer on the address); the probe reports what it was routed with.
97+
AiAddressRedirect: AiChatPageProbe,
9598
StudioDesignSurface: stub('studio-design-surface'),
9699
BuilderLanding: stub('builder-landing'),
97100
getProductName: () => 'ObjectOS',

‎ui/apps/console/src/__tests__/App.docsPortalLazy.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ vi.mock('@object-ui/app-shell', async (importOriginal) => ({
104104
DefaultInvitationsPage: stub('invitations-page'),
105105
DefaultSettingsPage: stub('settings-page'),
106106
DefaultAcceptInvitationPage: stub('accept-invitation-page'),
107-
DefaultAiChatPage: stub('ai-chat-page'),
107+
AiAddressRedirect: stub('ai-chat-page'),
108108
StudioDesignSurface: stub('studio-design-surface'),
109109
BuilderLanding: stub('builder-landing'),
110110
getProductName: () => 'ObjectOS',

‎ui/apps/console/src/__tests__/App.nativeShellMode-29039.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ vi.mock('@object-ui/app-shell', async (importOriginal) => ({
9393
DefaultInvitationsPage: stub('invitations-page'),
9494
DefaultSettingsPage: stub('settings-page'),
9595
DefaultAcceptInvitationPage: stub('accept-invitation-page'),
96-
DefaultAiChatPage: stub('ai-chat-page'),
96+
AiAddressRedirect: stub('ai-chat-page'),
9797
StudioDesignSurface: stub('studio-design-surface'),
9898
BuilderLanding: stub('builder-landing'),
9999
getProductName: () => 'ObjectOS',

‎ui/apps/console/src/__tests__/App.nativeShellOpenSet-29330.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ vi.mock('@object-ui/app-shell', async (importOriginal) => ({
7272
DefaultInvitationsPage: stub('invitations-page'),
7373
DefaultSettingsPage: stub('settings-page'),
7474
DefaultAcceptInvitationPage: stub('accept-invitation-page'),
75-
DefaultAiChatPage: stub('ai-chat-page'),
75+
AiAddressRedirect: stub('ai-chat-page'),
7676
StudioDesignSurface: stub('studio-design-surface'),
7777
BuilderLanding: stub('builder-landing'),
7878
getProductName: () => 'ObjectOS',

‎ui/apps/console/src/__tests__/App.uploadAltitude-10131.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ vi.mock('@object-ui/app-shell', async (importOriginal) => ({
156156
DefaultInvitationsPage: stub('invitations-page'),
157157
DefaultSettingsPage: stub('settings-page'),
158158
DefaultAcceptInvitationPage: stub('accept-invitation-page'),
159-
DefaultAiChatPage: stub('ai-chat-page'),
159+
AiAddressRedirect: stub('ai-chat-page'),
160160
StudioDesignSurface: stub('studio-design-surface'),
161161
BuilderLanding: stub('builder-landing'),
162162
getProductName: () => 'ObjectOS',

‎ui/apps/console/src/__tests__/i18nAfterSignIn-12034.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ vi.mock('@object-ui/app-shell', async (importOriginal) => ({
8282
DefaultInvitationsPage: stub('invitations-page'),
8383
DefaultSettingsPage: stub('settings-page'),
8484
DefaultAcceptInvitationPage: stub('accept-invitation-page'),
85-
DefaultAiChatPage: stub('ai-chat-page'),
85+
AiAddressRedirect: stub('ai-chat-page'),
8686
StudioDesignSurface: stub('studio-design-surface'),
8787
BuilderLanding: stub('builder-landing'),
8888
getProductName: () => 'ObjectOS',

‎ui/apps/console/src/__tests__/internalFormShell.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ vi.mock('@object-ui/app-shell', async (importOriginal) => ({
8181
DefaultInvitationsPage: stub('invitations-page'),
8282
DefaultSettingsPage: stub('settings-page'),
8383
DefaultAcceptInvitationPage: stub('accept-invitation-page'),
84-
DefaultAiChatPage: stub('ai-chat-page'),
84+
AiAddressRedirect: stub('ai-chat-page'),
8585
StudioDesignSurface: stub('studio-design-surface'),
8686
BuilderLanding: stub('builder-landing'),
8787
getProductName: () => 'ObjectOS',

‎ui/apps/console/src/components/aiChatPage.ts‎

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)