fix(app): focus file pane when editing beside an agent (#2457)
CodeMirror uses a contenteditable surface, which the split-pane focus filter treated as exempt. Let editor interactions claim pane focus just like composer text inputs do.
This commit is contained in:
@@ -95,6 +95,34 @@ test.describe("CodeMirror workspace file editing", () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("clicking the editor focuses its pane beside an agent", async ({ page }) => {
|
||||||
|
const target = "target.ts:42";
|
||||||
|
const session = await seedAgentWithFileLink(target);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await page.setViewportSize({ width: 1280, height: 900 });
|
||||||
|
await openAgentRoute(page, session);
|
||||||
|
|
||||||
|
await page.getByRole("button", { name: "Split pane right" }).first().click();
|
||||||
|
await expect(page.getByTestId("workspace-tabs-row").filter({ visible: true })).toHaveCount(2);
|
||||||
|
await openWorkspaceFile(page, "target.ts");
|
||||||
|
|
||||||
|
await page
|
||||||
|
.getByTestId(`workspace-tab-agent_${session.agentId}`)
|
||||||
|
.filter({ visible: true })
|
||||||
|
.click();
|
||||||
|
await editor(page).click();
|
||||||
|
await page.keyboard.press("Alt+Shift+W");
|
||||||
|
|
||||||
|
await expect(page.getByTestId("workspace-tab-file_target.ts")).not.toBeVisible();
|
||||||
|
await expect(
|
||||||
|
page.getByTestId(`workspace-tab-agent_${session.agentId}`).filter({ visible: true }),
|
||||||
|
).toBeVisible();
|
||||||
|
} finally {
|
||||||
|
await session.cleanup();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
test("shows the full file path and keeps editor controls stable", async ({
|
test("shows the full file path and keeps editor controls stable", async ({
|
||||||
page,
|
page,
|
||||||
withWorkspace,
|
withWorkspace,
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ const INTERACTIVE_TARGET_SELECTOR = [
|
|||||||
"select",
|
"select",
|
||||||
"[role='button']",
|
"[role='button']",
|
||||||
"[role='link']",
|
"[role='link']",
|
||||||
"[contenteditable='true']",
|
|
||||||
"[data-paseo-pane-focus-exempt='true']",
|
"[data-paseo-pane-focus-exempt='true']",
|
||||||
].join(", ");
|
].join(", ");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user