feat(agents): Select the active session in the Agents list (#140)

Switching between agent session tabs in the editor now moves the Agents
tool window's selection to that task, expanding its group (e.g. Archived)
when it is collapsed. The list also opens with the active session selected.
Tabs of other kinds leave the selection as it is.

The editor service gains activeInput() and onActiveInputChange() so
features can follow the active tab of any kind.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-10-28 20:36:55 +08:00
1 джерело f8b3ef6840
коміт 44b2d11b2d
4 files changed
+43 -3

No files matched your search

+14
Переглянути файл
@@ -1093,6 +1093,20 @@ export class EditorController implements SlotHost {
this.apply((s) => closeKey(s, key));
}
activeInput(): EditorInput | null {
return this.activeTabOf()?.input ?? null;
}
onActiveInputChange(fn: (input: EditorInput | null) => void): () => void {
let prev = this.activeInput()?.key;
return useTabs.subscribe(() => {
const input = this.activeInput();
if (input?.key === prev) return;
prev = input?.key;
fn(input);
});
}
activePath(): string | null {
return this.activeSlot?.model.path ?? this.activeTabOf()?.input.path ?? null;
}