fix(webui): preserve sidebar control alignment

This commit is contained in:
Xubin Ren
2026-09-03 13:23:04 +08:00
parent 2b6ee8d71c
commit 30ed228f78
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -165,7 +165,7 @@ export function Sidebar(props: SidebarProps) {
size="icon" size="icon"
aria-label={t("sidebar.collapse")} aria-label={t("sidebar.collapse")}
onClick={props.onCollapse} 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"
> >
<Menu className="h-3.5 w-3.5" /> <Menu className="h-3.5 w-3.5" />
</Button> </Button>
+2
View File
@@ -458,6 +458,7 @@ describe("App layout", () => {
expect(main).not.toHaveAttribute("style"); expect(main).not.toHaveAttribute("style");
expect(screen.getByTestId("sidebar-brand-row")).toHaveClass("pt-3"); expect(screen.getByTestId("sidebar-brand-row")).toHaveClass("pt-3");
expect(screen.getByTestId("sidebar-brand-mark")).not.toHaveClass("mt-5"); 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( const asideClassNames = Array.from(container.querySelectorAll("aside")).map(
(el) => el.className, (el) => el.className,
@@ -1642,6 +1643,7 @@ describe("App layout", () => {
expect(flowSidebar).toHaveStyle({ width: "272px" }); expect(flowSidebar).toHaveStyle({ width: "272px" });
expect(screen.getByTestId("sidebar-brand-row")).toHaveClass("pt-3"); expect(screen.getByTestId("sidebar-brand-row")).toHaveClass("pt-3");
expect(screen.getByTestId("sidebar-brand-mark")).toHaveClass("mt-5"); 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.queryByTestId("host-sidebar-toggle")).not.toBeInTheDocument();
expect( expect(
screen.getByRole("navigation", { name: "Sidebar navigation" }), screen.getByRole("navigation", { name: "Sidebar navigation" }),