Repository navigation
feat(app-shell): Ask AI opens a new conversation after the user's own close, and the drawer header names the conversation - #37970
Conversation
… A5 (WIP) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzv3KSUSav5J2uw97s
…e approvals on the bus Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzv3KSUSav5J2uw97s
…, not during it Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzv3KSUSav5J2uw97s
…rite-approval pin Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzv3KSUSav5J2uw97s
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i L1-c, the seat's L1 thread · 2026-11-27T14:06Z 席位核对 — L1 @
|
…plan Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzv3KSUSav5J2uw97s
… pin Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzv3KSUSav5J2uw97s
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i L1-c, the seat's L1 thread · 2026-11-27T14:35Z 席位核对 — L1 delta @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Seat reading of the red
|
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i L1-c, the seat's L1 thread · 2026-11-27T14:51Z 席位核对 — L1 @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i L1-c, the seat's L1 thread · 2026-11-27T15:31Z 席位核对 — L1 delta @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-27T15:33Z · zone
|
…-ctejy8 Brings in #37970 (C4), which also changes ui/packages/app-shell/src/console/ai/ChatPane.tsx; auto-merged with no conflict. Claude-Session: https://claude.ai/code/session_01L9qibyUpyff7pHe7vkFgA8 Co-authored-by: Claude <noreply@anthropic.com>
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
Requested by Tesla · project thread
Fixes #37860
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Implements every row of ui ADR-0057 Amendment A5's open-type table (as merged,
bc173343). Where the card's text and A5 differ, A5 wins (claim 7218853868).useConsoleChatDockwrites one per-tab record at each close (sessionStorage, module copy when storage throws):by: userfor ×, the entry or the keyboard toggle again, and dismissing the phone sheet;by: consolefor the phone sheet's PUSH/POP collapse (objectstack#37556) and the A4 ask-page collapse; plus the conversation the body showed then (onShownConversationChange, reported byChatDockConversation).openEntryon the dock handle; the top bar's 「Ask AI」 toggle, the keyboard toggle, Home's 「Ask AI」 throughuseAskAiEntry, and the record pane's button) reads that record through the pureentryOpening:{ agent?, fresh: true }, which reachesuseChatConversationasforceNewonly (neverresumeMode: 'fresh'), so no row exists until the first send;isApprovalPendingIn);buildor a package, orapp.defaultAgent: 'build'with no target agent) → as before;open(target), a reload, the bus'srequestAssistantOpen, filling the window.An entry that names an agent (Home's
ask) keeps the closed thread only when it is that agent's.ChatPanecounts the tool calls the framework parked as pending actions (approval-requestedwith apendingActionId) that have no decision, or a failed one, in the chat (countWritesAwaitingApproval), and publishes the count per conversation withpublishPlanApprovalPending. The reading outlives the pane, as the bus intends.useConversationLabel, the list's ownnormalizeon the detail read; the first message stands in until the server answers), "New conversation" (console.ai.newConversation, the history list's own fallback) before the first send, nothing while an existing label is read. Right: + (the body's new-conversation action), the history as an icon button witharia-pressedand both names (rail and sheet only; the full window keeps the column), ⋯ unchanged, × (the sheet keeps its own ✕ last). No ☆ (C8).record-pane-open-assistantbutton reads 「Ask AI」 (home.askAI) with the chat-bubble icon and opens as the entry does. The drawer is no longer titled "AI Assistant"; the objectstack#34827 pin now pins the new rule.No new i18n key: the title and + reuse
console.ai.newConversation, the history button keepsconsole.ai.dock.history/backToChat.Tests
useConsoleChatDock.phoneCollapseOnNavigate-37556.test.tsx, new top-level describe (the hook's shared harness): A5 rows 1 (first opening; ×; entry and keyboard closes; sheet dismissal), 2, 3 (and its control: another conversation, another user), 5, 6 (reload is no opening; the record survives a reload), 7, 8 (defaultAgent build; a build target with a package), Home's 「Ask AI」 after a build thread, and with the drawer open. The stand-ins now report the shown conversation and offer × and dismissal.ChatDock.test.tsx, new describe: the header row in rail / full / sheet, the label, "New conversation", nothing while pending, the history icon's pressed state and names, + calling the body's action and closing the history.ChatDock.titleMatchesTopBar-34827.test.tsxrewritten to "drawer title = the conversation's label, 「新对话」 / "New conversation" before the first send", real packs, every built-in pack.writeApprovalPending-37860.test.tsx: real hydration of stored rows and the realuseHitlInChatdecisions → pending, cleared by an approval, kept by a failed one; control with no parked write.AiChatPage.toolLabelsLocale-11667.test.tsx, new describe: the realChatPanepublishes the pending write for its conversation and clears it after the user's reject.recordDrawerAssistant-36998.test.tsx,ObjectDataPage.openRule-35875.test.tsx: the pane button's name is 「Ask AI」 and its click is an entry opening.Ablation (on disk, restored from the commit): every entry opening forced to
same→ 7 of 30 cases in the hook harness red (all row-1 cases, the row-3 control, row 6, Home's entry).ChatPanepublishingpending: false→ the pane pin red (1 of 3).Readings
db93e901+ tests (every ui test file naming ChatDock, useConsoleChatDock, AssistantTopBarButton, ChatPane/AiChatPage, Console/Home layout, HomePage, the conversation list or sidebar, recordDrawerStack, ObjectDataPage, assistantBus, chatDockControl, DocsPortalShell): 327 files / 3893 tests passed.5d407804): every ui test file naming ChatDock or useConsoleChatDock, 28 files / 305 tests passed.pnpm --filter @object-ui/app-shell run type-check(src andtsconfig.test.json): exit 0, after building the dependency closure.overlap-check.mjsbefore the first push: clean against main, feat(spec)!: retire the ask_ai action type (ADR-0160 D7) #37924 (sharesChatDockConversation.tsx) and feat(app-shell): the AI inquiry page lists this app's recent conversations #37940 (sharesuseConversationList.ts).Acceptance notes
console.ai.newConversation, which reads 「新对话」 in zh-Hans, so the header reads 「新对话」. No pack changed.console.ai.dock.planAwaitingApproval, now reads "An action is waiting for your approval" (「有一项操作等待确认」) in all eleven packs, with the key unchanged. That was L1-c's R1 (7220360349), fixed at12ae1bed.askagent as before.views/ObjectDataPage.tsx,views/recordDrawerStack.tsx,console/ai/ChatPane.tsx. Plusassistant/writeApprovalPending.ts(new, inside the glob).Verification
Read first, by risk:
ui/packages/app-shell/src/layout/useConsoleChatDock.tsx:entryOpening,openEntry,closeByand which close paths call it.ui/packages/app-shell/src/layout/ChatDockConversation.tsx: the shown-conversation report and the header actions.ui/packages/app-shell/src/console/ai/ChatPane.tsx: the bus publish effect.Two-minute check:
pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/useConsoleChatDock.phoneCollapseOnNavigate-37556.test.tsx. Expected: 30 passed. In the Console: open 「问 AI」, send a message, close with ×, click 「问 AI」 again: the header reads 「新对话」 and the old thread is in history.Generated by Claude Code