From dc5bca7a46b655f1053f8a2140b114fb72e0fd34 Mon Sep 17 00:00:00 2001 From: Dotta Date: Tue, 9 Jun 2026 21:03:16 +0000 Subject: [PATCH] fix(ui): move skills nav below artifacts --- ui/src/components/Sidebar.test.tsx | 20 ++++++++++++++------ ui/src/components/Sidebar.tsx | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ui/src/components/Sidebar.test.tsx b/ui/src/components/Sidebar.test.tsx index df06f891378..ddd8a244fbe 100644 --- a/ui/src/components/Sidebar.test.tsx +++ b/ui/src/components/Sidebar.test.tsx @@ -1,6 +1,6 @@ // @vitest-environment jsdom -import { act, type ReactNode } from "react"; +import { type ReactNode } from "react"; import { flushSync } from "react-dom"; import { createRoot } from "react-dom/client"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; @@ -202,7 +202,7 @@ describe("Sidebar", () => { container.querySelector('[data-testid="sidebar-agents"]')?.getAttribute("data-streamlined"), ).toBe("true"); - await act(async () => { + flushSync(() => { root.unmount(); }); }); @@ -229,7 +229,7 @@ describe("Sidebar", () => { container.querySelector('[data-testid="sidebar-agents"]')?.getAttribute("data-streamlined"), ).toBe("false"); - await act(async () => { + flushSync(() => { root.unmount(); }); }); @@ -267,7 +267,7 @@ describe("Sidebar", () => { }); }); - it("shows an Artifacts nav item directly below Goals", async () => { + it("shows Skills directly below Artifacts in Work", async () => { mockInstanceSettingsApi.getExperimental.mockResolvedValue({ enableIsolatedWorkspaces: false }); const root = await renderSidebar(); @@ -279,7 +279,15 @@ describe("Sidebar", () => { const navText = container.querySelector("nav")?.textContent ?? ""; expect(navText).toContain("Goals"); expect(navText).toContain("Artifacts"); + expect(navText).toContain("Skills"); expect(navText.indexOf("Goals")).toBeLessThan(navText.indexOf("Artifacts")); + expect(navText.indexOf("Artifacts")).toBeLessThan(navText.indexOf("Skills")); + + const sections = [...container.querySelectorAll("nav > div")]; + const workSection = sections.find((section) => section.textContent?.startsWith("Work")); + const companySection = sections.find((section) => section.textContent?.startsWith("Company")); + expect(workSection?.textContent).toContain("Skills"); + expect(companySection?.textContent).not.toContain("Skills"); flushSync(() => { root.unmount(); @@ -348,7 +356,7 @@ describe("Sidebar", () => { expect(toggle).not.toBeNull(); expect(toggle?.getAttribute("aria-expanded")).toBe("true"); - act(() => { + flushSync(() => { toggle?.click(); }); expect(mockSidebar.toggleCollapsed).toHaveBeenCalledTimes(1); @@ -405,7 +413,7 @@ describe("Sidebar", () => { const pin = container.querySelector('button[aria-label="Keep sidebar expanded"]'); expect(pin).not.toBeNull(); - act(() => { + flushSync(() => { pin?.click(); }); expect(mockSidebar.setCollapsed).toHaveBeenCalledWith(false); diff --git a/ui/src/components/Sidebar.tsx b/ui/src/components/Sidebar.tsx index 61d3f2b63fc..8ac906f80a3 100644 --- a/ui/src/components/Sidebar.tsx +++ b/ui/src/components/Sidebar.tsx @@ -176,6 +176,7 @@ export function Sidebar() { + {showWorkspacesLink ? ( ) : null} @@ -204,7 +205,6 @@ export function Sidebar() { -