Repository navigation
feat(app-shell): the AI drawer history lists the app's conversations, with an All switch - #39250
Queued
objectstack-fleet[bot] wants to merge 3 commits into
Queued
objectstack-fleet[bot] wants to merge 3 commits into
objectstack-fleet[bot] wants to merge 3 commits into
Conversation
… with an All switch The drawer's history defaults to the conversations started in the app in view (the list route's packageId filter), offers an All switch, and a row started in another app moves the console to that app before opening it. A new conversation sends the app it starts in at create. Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1 Co-authored-by: Claude <noreply@anthropic.com>
…d navigate-first Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1 Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
repo:cloud@zhuangjianguo · zhuangjianguo · session_01TsNV8Bsjqmw7aXCo2QuLU1 席位核对 · ACCEPT · 2026-12-03T03:20ZHead:
|
objectstack-fleet
Bot
added this pull request to the merge queue
Dec 3, 2026
Any commits made after this event will not be merged.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #35081
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
The client half of #35014 item 4. The server half (service-ai records the app a conversation was started in, returns it on every conversation row as
packageId, and filtersGET /api/v1/ai/conversations?packageId=) shipped in objectstack-ai/cloud#4835; the field and parameter names here are the ones in service-ai'sconversation/conversation-app.ts(CONVERSATION_APP_FIELD = 'packageId').useConversationList: a row carries thepackageIdthe list route recorded (absent when it has none); a newpackageIdoption asks the list route for one app's conversations.ConversationsSidebar: a newappPackageIdprop. Set, the list reads that app's conversations by default and draws a two-button switch ("This app" / "All") above the search box; the choice is per app, so moving to another app starts on that app's own list. Absent, the list reads every conversation and draws no switch. A hosted row hands itspackageIdtoonSelectConversation. In the app's own view, an empty list says so and points at All.ChatDockConversation: the app in view isambientAppPackage(appPackageId)(an authorable app; none at Home or in a built-in app such as Setup). It is passed to the history (only when the host lists every row: theai:chatpage keeps its ownhistoryRowFilterand gets no switch) and touseChatConversationascreatePackageId. A picked row whosepackageIdnames another app goes to the host's newonOpenInApp; a row with no app, or of the app in view, opens in place as before.useChatConversation:createPackageIdis sent as the create'spackageId. With nothing to send the body is still{}.useConsoleChatDock(plumbed throughChatDockPanel/ChatDockMobileSheet):onOpenInAppstores the target placed in the destination app (app: ambientAppPackage(packageId) ?? null, sodockTargetFollowsAppshows it there), then navigates to/apps/PACKAGE(the ADR-0048 package-id address). On a phone the sheet stays open over the new page: the drawer's own move forgets the entry the sheet was shown on instead of reading it as a move away.@object-ui/i18n:console.ai.historyScope.{label,app,all},console.ai.noChatsInApp,console.ai.noChatsInAppDescriptionin every pack (zh-Hantregenerated bygen:zh-hant).Tests
ui/packages/app-shell/src/layout/__tests__/ChatDock.historyByApp-35081.test.tsx(7 pins). It drives the real console hostuseConsoleChatDockwith the realConversationsSidebar,useConversationList,ChatPaneanduseChatConversationunder a router whose address decides the app in view, over afetchstub that filters its list bypackageIdas service-ai does. Its own file becauseChatDock.appBinding-10926.test.tsxreplaces the history list with a stub module-wide. Pins: the default per-app list; All and back; no app (Home, Setup) means every conversation and no switch; a row from another app navigates first and opens there (also from Home); a row of the app in view or with no app opens in place; the create sendspackageIdin an authorable app and nothing in Setup.useConversationList.test.tsx(2 pins): the row'spackageIdis read (absent and empty read as no app); thepackageIdoption reaches the query, and is dropped when unset.AppAskPage-37788.test.tsx: the create-body expectation now includespackageId: PKG. The page's create sends the app it starts in, like the drawer's.6f292da44e(git restore --source), new pins run: 8 failed, 3 passed. The 3 that pass by design are the two existing list pins and the no-app preservation pin. Restored after;git diff HEADempty.scripts/ablation-replace.mjs, each restored with blob == HEAD andgit diff HEADempty). The subjects are imported relatively fromsrc, so no build leg is needed.const listApp = showAll ? undefined : appPackageId;replaced byconst listApp = undefined;: 4 red (default list, All and back, navigate-first, open-in-place).onClick={() => setAllFor(...)}replaced by a no-op: 3 red (All and back, navigate-first, open-in-place).if (conversation.packageId && conversation.packageId !== appPackageId && onOpenInApp) {replaced byif (false) {: 2 red (both navigate-first pins).createPackageId: ambientApp,replaced bycreatePackageId: undefined,: 1 red (the create pin).c22053a3c(code identical to head0363607a3, which adds only the changeset):ui/test files that importConversationsSidebar,useConversationList,useChatConversation,ChatDockConversation,useConsoleChatDockorChatDock: 504/504;packages/i18n/: 110 files, 1874 passed, 13 skipped;ui/scripts/: 172 files passed, 2 skipped;@object-ui/i18nand@object-ui/app-shelltype-check(bothtscprojects each, after building the app-shell dependency closure): exit 0.Red on main (base sources, new pins)
Green runs
Gates
node scripts/pm/dispatch-gates.mjs --commandsfor this diff derived 41 families. Each was run locally with its exit code recorded, and all exited 0.check:query-options-erasurehit a 300 s wrapper timeout on the shared box the first time and exited 0 on its re-run.Acceptance notes
packageIdon the conversation schemas.AiConversationSchema,CreateAiConversationRequestSchemaandListAiConversationsRequestSchemainpackages/spec/src/api/protocol.zod.tspredate cloud#4835, and@objectstack/client'sai.conversations.create/listtherefore carry nopackageIdeither. The console reads the route directly through its own fetch, so nothing here depends on that, and this PR leaves the spec alone: changing it is a contract-shape change, not this card's. Raised to the seat as an open question.The list's existing "the open conversation is always kept" leniency applies only to the rows a list read returns, so it cannot keep that row.
ai:chatpage keeps its own row filter and gets no switch. Its create now also sendspackageId(its own app), so its conversations appear in the drawer's per-app list for that app. Before this PR they already appeared in the drawer's unfiltered list./aihistory and the empty conversation's 「最近会话」 list (DrawerRecentConversations) still read every conversation. The card names the history list only.ConsoleLayout, a page change drops the full window back to the rail.content/docs/has none, and the app-shell README does not cover it.Read first:
ui/packages/app-shell/src/layout/useConsoleChatDock.tsx,openInApp. This is where the target is placed in the destination app and the phone sheet's shown-at entry is forgotten.ui/packages/app-shell/src/layout/ChatDockConversation.tsx,openConversation, and theappPackageIdpassed to the history.ui/packages/app-shell/src/console/ai/ConversationsSidebar.tsx, the per-appallForderived state.Verification
pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/ChatDock.historyByApp-35081.test.tsx: expect 7 passed. In the console: open the AI drawer inside an app, then open History. It shows "This app" pressed and only that app's conversations. Press All, then pick a conversation from another app: the page moves to that app and the drawer shows that conversation.Generated by Claude Code