From 153f2d9529670a756c967d4223cf27deeef7064d Mon Sep 17 00:00:00 2001 From: chengyongru Date: Mon, 15 Jun 2026 18:12:54 +0800 Subject: [PATCH] fix(webui): move automations after skills --- webui/src/components/Sidebar.tsx | 14 +++++++------- webui/src/tests/app-layout.test.tsx | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/webui/src/components/Sidebar.tsx b/webui/src/components/Sidebar.tsx index 48725dce..66a8bd41 100644 --- a/webui/src/components/Sidebar.tsx +++ b/webui/src/components/Sidebar.tsx @@ -161,13 +161,6 @@ export function Sidebar(props: SidebarProps) { active={props.activeUtility === "apps"} icon={} /> - } - /> } /> + } + /> {props.archivedCount ? ( { expect(asideClassNames.some((cls) => cls.includes("lg:block"))).toBe(true); }); + it("places Automations after Skills in the main sidebar", async () => { + render(); + + await waitFor(() => expect(connectSpy).toHaveBeenCalled()); + const sidebar = screen.getByRole("navigation", { name: "Sidebar navigation" }); + const appsButton = within(sidebar).getByRole("button", { name: "Apps" }); + const skillsButton = within(sidebar).getByRole("button", { name: "Skills" }); + const automationsButton = within(sidebar).getByRole("button", { name: "Automations" }); + + expect(appsButton.compareDocumentPosition(skillsButton) & Node.DOCUMENT_POSITION_FOLLOWING) + .toBeTruthy(); + expect( + skillsButton.compareDocumentPosition(automationsButton) & + Node.DOCUMENT_POSITION_FOLLOWING, + ).toBeTruthy(); + }); + it("opens Skills from the main sidebar", async () => { mockFetchRoutes({ "/api/settings": baseSettingsPayload(),