diff --git a/packages/app/e2e/browser/plugin-composers-by-reference.spec.ts b/packages/app/e2e/browser/plugin-composers-by-reference.spec.ts index 520d355655..1138fab09a 100644 --- a/packages/app/e2e/browser/plugin-composers-by-reference.spec.ts +++ b/packages/app/e2e/browser/plugin-composers-by-reference.spec.ts @@ -122,6 +122,7 @@ test("focus opens a compact subagent as a tab with its composer", async ({ page test.setTimeout(120_000); await withPluginFocusingASubagent(page, async (author) => { await author.openParentAgent(); + await author.openExplorer(); await author.focusSubagent(); await author.expectSubagentTabReadyToType(); }); diff --git a/packages/app/e2e/support/helpers/plugin-composers-by-reference.ts b/packages/app/e2e/support/helpers/plugin-composers-by-reference.ts index 91fe96a381..70f9b3f531 100644 --- a/packages/app/e2e/support/helpers/plugin-composers-by-reference.ts +++ b/packages/app/e2e/support/helpers/plugin-composers-by-reference.ts @@ -472,6 +472,7 @@ export async function withPluginFocusingASubagent( page: Page, run: (author: { openParentAgent(): Promise; + openExplorer(): Promise; focusSubagent(): Promise; expectSubagentTabReadyToType(): Promise; }) => Promise, @@ -514,6 +515,10 @@ export async function withPluginFocusingASubagent( await expectOpenTabCount(page, 1); await page.waitForFunction(() => (globalThis as FocusAgentGlobal).focusAgent); }), + openExplorer: () => + test.step("open the Explorer over the parent's composer", async () => { + await expect(await ensureExplorerSidebar(page)).toBeVisible(); + }), focusSubagent: () => test.step("focus the subagent, which has no tab", async () => { const result = await page.evaluate( diff --git a/packages/app/src/utils/navigate-to-agent/index.ts b/packages/app/src/utils/navigate-to-agent/index.ts index fddcc4ea3f..5a22ca361c 100644 --- a/packages/app/src/utils/navigate-to-agent/index.ts +++ b/packages/app/src/utils/navigate-to-agent/index.ts @@ -4,6 +4,7 @@ import { useSessionStore } from "@/stores/session-store"; import { useWorkspaceLayoutStore } from "@/stores/workspace-layout-store"; import { normalizeWorkspaceOpaqueId } from "@/utils/workspace-identity"; import { buildWorkspaceTabPersistenceKey } from "@/workspace-tabs/model"; +import { revealWorkspaceTab } from "@/workspace-tabs/navigation"; import { resolveNavigateToAgent, type NavigateToAgentInput } from "./resolve"; export type { NavigateToAgentInput } from "./resolve"; @@ -43,5 +44,5 @@ export function navigateToAgentComposer(input: NavigateToAgentInput): void { const sheet = layout.sheetsByWorkspace[workspaceKey]?.find( ({ tab }) => tab.target.kind === "agent" && tab.target.agentId === input.agentId, ); - if (sheet) layout.openTabInFront(workspaceKey, sheet); + if (sheet) revealWorkspaceTab(workspaceKey, layout.openTabInFront(workspaceKey, sheet)); }