From bb683c0209ba916bdf57411940381277fb1d25f0 Mon Sep 17 00:00:00 2001 From: Akash Pathak Date: Thu, 30 Jul 2026 16:03:03 +0200 Subject: [PATCH] fix(gui): stop window drag from swallowing right-rail hide clicks --- surfaces/gui/e2e/session-shell.spec.ts | 24 +++++++++++ surfaces/gui/src/App.tsx | 60 ++++++++++++++------------ 2 files changed, 57 insertions(+), 27 deletions(-) diff --git a/surfaces/gui/e2e/session-shell.spec.ts b/surfaces/gui/e2e/session-shell.spec.ts index 0156c87a..5c154e90 100644 --- a/surfaces/gui/e2e/session-shell.spec.ts +++ b/surfaces/gui/e2e/session-shell.spec.ts @@ -75,3 +75,27 @@ test("composer is three controls (+ attach · Mode · send); folder and branch c await expect(page.locator(".wschip")).toHaveCount(0); await expect(page.locator(".wsbranch")).toHaveCount(0); }); + +test("right-rail Hide side panel toggle collapses and restores the inspector (#342)", async ({ + page, +}) => { + await page.goto("/"); + await page.getByText("Draft the launch note").first().click(); + + const hide = page.getByRole("button", { name: "Hide side panel" }); + await expect(hide).toBeVisible(); + await expect(page.locator(".right-rail")).toBeVisible(); + await expect(page.locator(".main")).toHaveClass(/rail-open/); + + // Clicks must reach the button even though the topbar side is a window-drag surface — + // the actions cluster stops pointerdown so beginWindowDrag never runs (#342). + await hide.click(); + await expect(page.locator(".right-rail")).toHaveCount(0); + await expect(page.locator(".main")).not.toHaveClass(/rail-open/); + await expect(page.getByRole("button", { name: "Show side panel" })).toBeVisible(); + + await page.getByRole("button", { name: "Show side panel" }).click(); + await expect(page.locator(".right-rail")).toBeVisible(); + await expect(page.locator(".main")).toHaveClass(/rail-open/); + await expect(page.getByRole("button", { name: "Hide side panel" })).toBeVisible(); +}); diff --git a/surfaces/gui/src/App.tsx b/surfaces/gui/src/App.tsx index 603d1e8e..4cdb636a 100644 --- a/surfaces/gui/src/App.tsx +++ b/surfaces/gui/src/App.tsx @@ -1373,34 +1373,40 @@ export function App() { )} - {/* Right: session-settings icon (§23) + panel toggle. Model/mode/persona chrome is - gone — the facts live in the subtitle, the controls in the composer (§22). */} + {/* Right: artifacts chip + panel toggle. Model/mode/persona chrome is gone — the + facts live in the subtitle, the controls in the composer (§22). Clicks must not + start a window drag: stop pointerdown (not mousedown) so beginWindowDrag never + runs — onMouseDown alone left the button dead in the desktop app (#342). */}
- {agent === "cowork" && railHidden && artifactCount > 0 && ( - - )} - {/* §32: the panel toggle is the ONE session-panel entry, for every non-chat persona - (the rail now carries Access, so code-family gets it too). */} - {agent !== "chat" && ( - - )} +
e.stopPropagation()} + > + {agent === "cowork" && railHidden && artifactCount > 0 && ( + + )} + {/* §32: the panel toggle is the ONE session-panel entry, for every non-chat persona + (the rail now carries Access, so code-family gets it too). */} + {agent !== "chat" && ( + + )} +