feat(agents): dock a session in the Agents tool window (#588)

Agent sessions can be opened in the Agents tool window beside the editor (Open in Tool Window / Open in Editor in the task menus, or by dragging between the editor and the tool window); opening in an editor tab stays the default.

Fixes in review:
- A docked conversation kept the previous task's subagent view after switching tasks: the session's local state is now keyed by task.
- Moving a conversation between the editor and the tool window lost its scroll position: position and follow-output are kept per conversation (task or subagent).
- In a short bottom tool window the message area shrank to a few pixels: wide windows place the task list beside the conversation, narrow ones cap the list height.
- Drag and drop and list selection now go through the agents.dockTask / undockTask / openTask actions.

Co-authored-by: a-rookie-of-C-language <[email protected]>
Цей коміт міститься в:
arookieofcтаa-rookie-of-C-language authored and GitHub committed 2026-11-01 11:31:53 +08:00
1 джерело fa26ba842c
коміт 9847fd2c01
18 files changed
+982 -103

No files matched your search

+9 -1
Переглянути файл
@@ -1458,6 +1458,11 @@ export class EditorController implements SlotHost {
return [...out];
}
/** Input of the tab `tabId` in pane `paneId` (dragging a tab between views), null if there is none. */
tabInput(paneId: string, tabId: string): EditorInput | null {
return useTabs.getState().panes[paneId]?.tabs.find((t) => t.id === tabId)?.input ?? null;
}
closePath(path: string): Promise<boolean> {
return this.removeGuarded((s) => {
const keys = new Set<string>();
@@ -1682,7 +1687,10 @@ export class EditorController implements SlotHost {
{ kind: "action", action: "project.rename", arg: path, label: "Rename File…" },
{ kind: "separator" },
] as MenuItem[])
: []),
: [
// Contributed groups for tabs without a file (e.g. "Open in Tool Window").
...menuGroupItems("editorTab", { paths: [], input: tab.input }),
]),
{ kind: "action", action: "file.settings", arg: "editor.general.editorTabs", label: "Configure Editor Tabs…" },
];
}