From 2c0a0f2012a241ad74b39389c89990dc7f6408dc Mon Sep 17 00:00:00 2001 From: Dotta Date: Mon, 18 May 2026 08:25:13 -0500 Subject: [PATCH] Move plugin sidebar entries into Work section Co-Authored-By: Paperclip --- ui/src/components/Sidebar.test.tsx | 26 +++++++++++++++++++++++++- ui/src/components/Sidebar.tsx | 18 +++++++++--------- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/ui/src/components/Sidebar.test.tsx b/ui/src/components/Sidebar.test.tsx index f41ab5b40a0..01308192484 100644 --- a/ui/src/components/Sidebar.test.tsx +++ b/ui/src/components/Sidebar.test.tsx @@ -67,7 +67,9 @@ vi.mock("../hooks/useInboxBadge", () => ({ })); vi.mock("@/plugins/slots", () => ({ - PluginSlotOutlet: () => null, + PluginSlotOutlet: ({ slotTypes }: { slotTypes: string[] }) => ( +
Plugin slot outlet
+ ), })); vi.mock("@/plugins/launchers", () => ({ @@ -162,6 +164,28 @@ describe("Sidebar", () => { }); }); + it("renders plugin sidebar slots in Work below Workspaces", async () => { + mockInstanceSettingsApi.getExperimental.mockResolvedValue({ enableIsolatedWorkspaces: true }); + const root = await renderSidebar(); + + const sidebarSlot = [...container.querySelectorAll("nav [data-plugin-slot-types]")] + .find((node) => node.getAttribute("data-plugin-slot-types") === "sidebar"); + expect(sidebarSlot?.textContent).toContain("Plugin slot outlet"); + const workSectionContainer = sidebarSlot?.parentElement?.parentElement; + const workText = workSectionContainer?.textContent ?? ""; + expect(workText).toContain("Work"); + expect(workText).toContain("Workspaces"); + expect(workText.indexOf("Workspaces")).toBeLessThan(workText.indexOf("Plugin slot outlet")); + + const primaryNavText = container.querySelector("nav > div:first-child")?.textContent ?? ""; + expect(primaryNavText).toContain("Inbox"); + expect(primaryNavText).not.toContain("Plugin slot outlet"); + + await act(async () => { + root.unmount(); + }); + }); + it("does not flash the Workspaces link while experimental settings are loading", async () => { mockInstanceSettingsApi.getExperimental.mockImplementation(() => new Promise(() => {})); const root = await renderSidebar(); diff --git a/ui/src/components/Sidebar.tsx b/ui/src/components/Sidebar.tsx index 210976c531e..bce1f64aecf 100644 --- a/ui/src/components/Sidebar.tsx +++ b/ui/src/components/Sidebar.tsx @@ -91,6 +91,15 @@ export function Sidebar() { badgeTone={inboxBadge.failedRuns > 0 ? "danger" : "default"} alert={inboxBadge.failedRuns > 0} /> + + + + + + + {showWorkspacesLink ? ( + + ) : null} - - - - - - - {showWorkspacesLink ? ( - - ) : null}