From 30ed228f78f65c9d2a34fb574fd9885440777c66 Mon Sep 17 00:00:00 2001 From: Xubin Ren <52506698+Re-bin@users.noreply.github.com> Date: Thu, 3 Sep 2026 13:23:04 +0800 Subject: [PATCH] fix(webui): preserve sidebar control alignment --- webui/src/components/Sidebar.tsx | 2 +- webui/src/tests/app-layout.test.tsx | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/webui/src/components/Sidebar.tsx b/webui/src/components/Sidebar.tsx index 01792a4b0..26ac4fa9e 100644 --- a/webui/src/components/Sidebar.tsx +++ b/webui/src/components/Sidebar.tsx @@ -165,7 +165,7 @@ export function Sidebar(props: SidebarProps) { size="icon" aria-label={t("sidebar.collapse")} onClick={props.onCollapse} - className="host-no-drag h-7 w-7 rounded-lg text-muted-foreground/85 hover:bg-sidebar-accent/75 hover:text-sidebar-foreground" + className="host-no-drag mt-1 h-7 w-7 rounded-lg text-muted-foreground/85 hover:bg-sidebar-accent/75 hover:text-sidebar-foreground" >
diff --git a/webui/src/tests/app-layout.test.tsx b/webui/src/tests/app-layout.test.tsx index 1511f92b8..ab3ea13d8 100644 --- a/webui/src/tests/app-layout.test.tsx +++ b/webui/src/tests/app-layout.test.tsx @@ -458,6 +458,7 @@ describe("App layout", () => { expect(main).not.toHaveAttribute("style"); expect(screen.getByTestId("sidebar-brand-row")).toHaveClass("pt-3"); expect(screen.getByTestId("sidebar-brand-mark")).not.toHaveClass("mt-5"); + expect(screen.getByRole("button", { name: "Collapse sidebar" })).toHaveClass("mt-1"); const asideClassNames = Array.from(container.querySelectorAll("aside")).map( (el) => el.className, @@ -1642,6 +1643,7 @@ describe("App layout", () => { expect(flowSidebar).toHaveStyle({ width: "272px" }); expect(screen.getByTestId("sidebar-brand-row")).toHaveClass("pt-3"); expect(screen.getByTestId("sidebar-brand-mark")).toHaveClass("mt-5"); + expect(screen.getByRole("button", { name: "Collapse sidebar" })).toHaveClass("mt-1"); expect(screen.queryByTestId("host-sidebar-toggle")).not.toBeInTheDocument(); expect( screen.getByRole("navigation", { name: "Sidebar navigation" }),