Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

test(sidebar): pin the chat face to the OPEN workspaces, not the active one

rubenluetke10-beepafb6d6dd69af
diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx
index f21ec118e1..f59fc5fda8 100644
--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx
@@ -766,11 +766,17 @@ describe("the Agentic IDE's chat face", () => {
view: "chat",
sidebarFace: "chats",
workspace: { id: "w1", name: "Personal Jarvis", path: "/work/jarvis" },
+ workspaces: [{ id: "w1", name: "Personal Jarvis", folder: "/work/jarvis", active: true }],
});
});
afterEach(() => {
- useIdeChatStore.setState({ view: "grid", sidebarFace: "chats", workspace: null });
+ useIdeChatStore.setState({
+ view: "grid",
+ sidebarFace: "chats",
+ workspace: null,
+ workspaces: [],
+ });
});
test("shows the workspace's chats instead of the sections", () => {
@@ -794,6 +800,31 @@ describe("the Agentic IDE's chat face", () => {
expect(screen.getByTestId("nav-row-settings")).toBeTruthy();
});
+ /*
+ * The launcher for one more workspace deactivates the front tab while it
+ * asks for a folder — and that must not take the list of running
+ * workspaces away with it, which is what a takeover gated on the ACTIVE
+ * workspace did.
+ */
+ test("keeps the chats while another workspace is being opened", () => {
+ useEventStore.setState({ activeSection: "agentic-ide" });
+ useIdeChatStore.setState({ workspace: null });
+
+ renderSidebar(SIDEBAR_DEFAULT_WIDTH);
+
+ expect(screen.getByTestId("workspace-chats")).toBeTruthy();
+ });
+
+ test("gives the navigation back once nothing is open at all", () => {
+ useEventStore.setState({ activeSection: "agentic-ide" });
+ useIdeChatStore.setState({ workspace: null, workspaces: [] });
+
+ renderSidebar(SIDEBAR_DEFAULT_WIDTH);
+
+ expect(screen.queryByTestId("workspace-chats")).toBeNull();
+ expect(screen.getByTestId("nav-row-settings")).toBeTruthy();
+ });
+
test("leaves every other section its navigation", () => {
// The IDE is in chat mode, but the user is reading another section:
// taking the navigation away there would be a takeover nobody asked for.