mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-09-03 17:52:00 +03:00
fix(webui): preserve sidebar control alignment
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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" }),
|
||||||
|
|||||||
Reference in New Issue
Block a user