fix: compact collapsed agent rail

This commit is contained in:
2026-07-21 14:51:59 +08:00
parent ebe6cdc7f1
commit e0cfa3d6eb
2 changed files with 16 additions and 1 deletions
@@ -3,7 +3,7 @@ export const WORKBENCH_LAYOUT = {
desktopMinWidth: 1024, desktopMinWidth: 1024,
persistentConditionMinWidth: 1280, persistentConditionMinWidth: 1280,
wideMinWidth: 1536, wideMinWidth: 1536,
collapsedAgentWidth: 136, collapsedAgentWidth: 72,
maxAgentViewportRatio: 0.5, maxAgentViewportRatio: 0.5,
mapEdgeGap: 24, mapEdgeGap: 24,
desktop: { desktop: {
+15
View File
@@ -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); 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 }) => { test("Agent resize handle stays hidden in the mobile layout", async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 }); await page.setViewportSize({ width: 375, height: 812 });
await page.goto("/", { waitUntil: "domcontentloaded" }); await page.goto("/", { waitUntil: "domcontentloaded" });