diff --git a/features/workbench/layout/workbench-layout.ts b/features/workbench/layout/workbench-layout.ts index f29f9f1..0d8f512 100644 --- a/features/workbench/layout/workbench-layout.ts +++ b/features/workbench/layout/workbench-layout.ts @@ -3,7 +3,7 @@ export const WORKBENCH_LAYOUT = { desktopMinWidth: 1024, persistentConditionMinWidth: 1280, wideMinWidth: 1536, - collapsedAgentWidth: 136, + collapsedAgentWidth: 72, maxAgentViewportRatio: 0.5, mapEdgeGap: 24, desktop: { diff --git a/tests/browser/agent-panel-resize.e2e.ts b/tests/browser/agent-panel-resize.e2e.ts index dbb1090..063afb6 100644 --- a/tests/browser/agent-panel-resize.e2e.ts +++ b/tests/browser/agent-panel-resize.e2e.ts @@ -25,6 +25,21 @@ test("Agent panel resizes by drag without exceeding half the viewport", async ({ await expect.poll(async () => (await panel.boundingBox())?.width).toBe(476); }); +test("collapsed Agent rail is compact and expands as one clear action", async ({ page }) => { + await page.goto("/", { waitUntil: "networkidle" }); + + await page.getByRole("button", { name: "折叠 Agent 面板" }).click(); + + const rail = page.locator('aside[aria-label="Agent 折叠栏"]'); + const expandButton = page.getByRole("button", { name: /展开排水助手面板/ }); + await expect(rail).toBeVisible(); + await expect(rail).toHaveCSS("width", "72px"); + await expect(expandButton).toHaveAttribute("title", /当前|正在/); + + await expandButton.click(); + await expect(page.locator('aside[aria-label="Agent 命令面板"]')).toBeVisible(); +}); + test("Agent resize handle stays hidden in the mobile layout", async ({ page }) => { await page.setViewportSize({ width: 375, height: 812 }); await page.goto("/", { waitUntil: "domcontentloaded" });