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.

feat(agentic): restyle the project tree as a quiet Codex-style folder list

rubenluetke10-beep53a031b866cf
diff --git a/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.test.tsx
index d9019932ea..09f201949c 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.test.tsx
@@ -107,17 +107,26 @@ it("expands a manually collapsed project when its first workspace becomes active
expect(screen.getByTestId("ide-workspace-p1-w1")).toBeDefined();
});
-it("counts agent sessions across a project's workspaces", () => {
+it("marks running agents on the rows, and on the header only when folded", () => {
const withTwo = { ...project(), workspaces: [
- { ...project().workspaces[0], terminals: 6 },
- { ...project().workspaces[0], id: "p1-w2", terminals: 3 },
- ] };
+ { ...project().workspaces[0], status: "open", live_terminals: 2, terminals: 6 },
+ { ...project().workspaces[0], id: "p1-w2", status: "open", live_terminals: 1, terminals: 3 },
+ ] } as IdeProject;
useIdeProjectsStore.setState({ projects: [withTwo] });
render(<IdeProjectTree />);
- // Open, the rows carry their own counts; folded, the header sums them.
- expect(screen.queryByLabelText("9 agent sessions")).toBeNull();
+ // Open, each row marks its own running agents; folded, the header sums them.
+ expect(screen.getByLabelText("2 agents running")).toBeDefined();
+ expect(screen.queryByLabelText("3 agents running")).toBeNull();
fireEvent.click(screen.getByRole("button", { name: "Collapse App" }));
- expect(screen.getByLabelText("9 agent sessions").textContent).toBe("9");
+ expect(screen.getByLabelText("3 agents running")).toBeDefined();
+});
+
+it("shows no mark for idle or saved workspaces", () => {
+ const idle = { ...project(), workspaces: [{ ...project().workspaces[0], status: "closed", live_terminals: 0, terminals: 4 }] } as IdeProject;
+ useIdeProjectsStore.setState({ projects: [idle] });
+ render(<IdeProjectTree />);
+ expect(screen.queryByLabelText(/agents? running/)).toBeNull();
+ expect(screen.queryByText("4")).toBeNull();
});
it("renders a project whose only workspace shares its name as one row", async () => {
@@ -126,7 +135,7 @@ it("renders a project whose only workspace shares its name as one row", async ()
render(<IdeProjectTree />);
expect(screen.queryByRole("button", { name: /Collapse App|Expand App/ })).toBeNull();
expect(screen.getAllByText(/^app$/i)).toHaveLength(1);
- expect(screen.getByLabelText("4 agent sessions")).toBeDefined();
+ expect(screen.queryByLabelText(/agents? running/)).toBeNull();
fireEvent.click(screen.getByRole("button", { name: "Open App" }));
expect(useIdeProjectsStore.getState().action).toMatchObject({ kind: "activate-workspace", workspaceId: "p1-w1" });
fireEvent.click(screen.getByRole("button", { name: "Project actions for App" }));
diff --git a/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.tsx b/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.tsx
index 84081022f3..99c451943e 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.tsx
@@ -1,6 +1,6 @@
import { useEffect, useLayoutEffect, useRef, useState, type KeyboardEvent as ReactKeyboardEvent } from "react";
import { createPortal } from "react-dom";
-import { ArrowUpRight, Check, ChevronDown, ChevronRight, Copy, CopyPlus, Folder, FolderGit2, GitBranch, FolderOpen, FolderPlus, Globe, Loader2, Mic, MoreHorizontal, OctagonPause, Pencil, Pin, PinOff, Plus, Server, SquareCode, Trash2, X, type LucideIcon } from "lucide-react";
+import { ArrowUpRight, Check, Copy, CopyPlus, Folder, FolderGit2, GitBranch, FolderOpen, FolderPlus, Globe, Loader2, Mic, MoreHorizontal, OctagonPause, Pencil, Pin, PinOff, Plus, Server, SquareCode, Trash2, X, type LucideIcon } from "lucide-react";
import { ChatLibraryError, deleteProject, openProject, patchProject, reorderProjects, revealProject, fetchProjectLaunchers, openProjectIn, type ProjectLaunchers } from "@/lib/chatLibraryApi";
import { robustCopy } from "@/lib/clipboard";
import { useComputerChoices } from "@/hooks/useComputers";
@@ -69,10 +69,18 @@ function soloWorkspace(project: IdeProject): ProjectWorkspace | null {
return workspace.name.trim().toLowerCase() === project.name.trim().toLowerCase() ? workspace : null;
}
-/** Running agents glow, an open but idle workspace is a solid dot, a saved (closed) one a hollow ring. */
-function statusDotClass(workspace: ProjectWorkspace): string {
- if (workspace.status !== "open") return "border border-muted-foreground/45";
- return workspace.live_terminals > 0 ? "bg-accent ring-[3px] ring-accent/15" : "bg-muted-foreground/40";
+/**
+ * Only a workspace with running agents carries a mark: one small accent dot at
+ * the row's end. Idle and saved rows stay plain text, like a Codex thread list.
+ */
+function RunningMark({ workspaces, hover }: { workspaces: ProjectWorkspace[]; hover: "group" | "group/space" }) {
+ const live = workspaces.reduce((total, workspace) => total + (workspace.status === "open" ? workspace.live_terminals : 0), 0);
+ if (live === 0) return null;
+ const fade = hover === "group"
+ ? "group-hover:opacity-0 group-focus-within:opacity-0"
+ : "group-hover/space:opacity-0 group-focus-within/space:opacity-0";
+ return <span aria-label={`${live} ${live === 1 ? "agent" : "agents"} running`} title={`${live} ${live === 1 ? "agent" : "agents"} running`}
+ className={`mr-1 h-1.5 w-1.5 shrink-0 rounded-full bg-accent ring-[3px] ring-accent/15 transition-opacity [@media(hover:none)]:opacity-0 ${fade}`} />;
}
function readExpansion(): Record<string, boolean> {
@@ -427,7 +435,6 @@ export function IdeProjectTree() {
const open = expansion[project.id] ?? (project.id === activeProject?.id || (!activeWorkspaceId && visible[0]?.id === project.id));
const active = project.id === activeProject?.id;
const working = mutatingId === project.id;
- const count = project.workspaces.reduce((total, workspace) => total + workspace.terminals, 0);
const projectDraggable = renamingId !== project.id && !working && !reordering;
const isProjectDragged = draggedProjectId === project.id;
const isProjectDropBefore = projectDropTarget?.id === project.id && projectDropTarget.before;
@@ -500,18 +507,17 @@ export function IdeProjectTree() {
void moveProject(project.id, neighbour.id, event.key === "ArrowUp");
}}
title={soloBlocked ? "This workspace cannot be restored on this machine" : `${project.name} — drag to reorder, or press Alt plus arrow keys to move`}
- className={`flex min-h-8 min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 text-left text-[15px] font-medium [@media(hover:none)]:pr-14 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-45 ${solo && solo.status !== "open" && !soloSelected && !soloPending ? "text-muted-foreground" : "text-foreground"}`}>
- {/* A one-row project has nothing to fold: its status dot takes the chevron's slot. */}
- {solo
- ? <span aria-hidden className="flex h-3 w-3 shrink-0 items-center justify-center">
- {soloPending ? <Loader2 className="h-3 w-3 animate-spin" /> : <span className={`h-1.5 w-1.5 rounded-full ${statusDotClass(solo)}`} />}
- </span>
- : open ? <ChevronDown aria-hidden className="h-3 w-3 shrink-0 text-muted-foreground/70" /> : <ChevronRight aria-hidden className="h-3 w-3 shrink-0 text-muted-foreground/70" />}
- <Folder aria-hidden className="ml-0.5 h-4 w-4 shrink-0 text-muted-foreground" strokeWidth={1.75} />
- <span className="ml-0.5 min-w-0 flex-1 truncate">{project.name}</span>
+ className={`flex min-h-8 min-w-0 flex-1 items-center gap-2.5 rounded-md px-2 text-left text-[15px] [@media(hover:none)]:pr-14 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-45 ${solo && solo.status !== "open" && !soloSelected && !soloPending ? "text-muted-foreground" : "text-foreground"}`}>
+ {/* The folder itself shows the fold: open while its rows show, closed when folded. */}
+ {soloPending
+ ? <Loader2 aria-hidden className="h-4 w-4 shrink-0 animate-spin text-muted-foreground" />
+ : open && !solo
+ ? <FolderOpen aria-hidden className="h-4 w-4 shrink-0 text-muted-foreground" strokeWidth={1.75} />
+ : <Folder aria-hidden className="h-4 w-4 shrink-0 text-muted-foreground" strokeWidth={1.75} />}
+ <span className="min-w-0 flex-1 truncate">{project.name}</span>
{soloPending && <span className="sr-only">Switching workspace</span>}
- {/* An open project's rows carry their own counts; the total only speaks for a folded one. */}
- {count > 0 && (solo || !open) && <span className="text-[13px] tabular-nums text-muted-foreground/80 transition-opacity group-hover:opacity-0 group-focus-within:opacity-0 [@media(hover:none)]:opacity-0" aria-label={`${count} agent ${count === 1 ? "session" : "sessions"}`}>{count}</span>}
+ {/* An open project's rows carry their own marks; the header only speaks for a folded one. */}
+ {(solo || !open) && <RunningMark workspaces={project.workspaces} hover="group" />}
</button>
<div className={`absolute inset-y-0 right-0 flex items-center rounded-r-md bg-gradient-to-l from-muted from-60% to-transparent pl-5 pr-1 transition-opacity ${projectMenuOpen ? "opacity-100" : "pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100 [@media(hover:none)]:pointer-events-auto [@media(hover:none)]:opacity-100"}`} data-project-menu={project.id}>
<button type="button" aria-label={`Project actions for ${project.name}`} title="Project actions" aria-haspopup="menu" aria-expanded={projectMenuOpen}
@@ -529,7 +535,7 @@ export function IdeProjectTree() {
</div>
</>}
</div>
- {open && !solo && <div className="mb-1 ml-3.5 flex flex-col gap-px border-l border-border/60 pl-1.5">
+ {open && !solo && <div className="mb-1 flex flex-col gap-px">
{project.workspaces.map((workspace: ProjectWorkspace) => {
const pending = workspace.id === pendingWorkspaceId;
const selected = workspace.id === activeWorkspaceId;
@@ -631,11 +637,10 @@ export function IdeProjectTree() {
if (!neighbour) return;
void moveWorkspace(workspace.id, neighbour.id, event.key === "ArrowUp");
}}
- className={`flex min-h-8 min-w-0 flex-1 items-center gap-2 rounded-md px-2 text-left text-[15px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-45 ${selected || pending ? "text-foreground" : "text-muted-foreground"} ${draggable ? "cursor-grab active:cursor-grabbing" : ""}`}>
- {pending ? <Loader2 aria-hidden className="h-3 w-3 shrink-0 animate-spin" />
- : <span aria-hidden className={`h-1.5 w-1.5 shrink-0 rounded-full ${statusDotClass(workspace)}`} />}
+ className={`flex min-h-8 min-w-0 flex-1 items-center gap-2 rounded-md py-1 pl-[34px] pr-2 text-left text-[15px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-45 ${selected || pending ? "text-foreground" : workspace.status === "open" ? "text-foreground/80" : "text-muted-foreground"} ${draggable ? "cursor-grab active:cursor-grabbing" : ""}`}>
+ {/* Text aligns under the project name, the way Codex indents threads under a folder. */}
<span className="min-w-0 flex-1 truncate">{workspace.name}</span>
- <span className="text-[13px] tabular-nums text-muted-foreground/80 transition-opacity group-hover/space:opacity-0 group-focus-within/space:opacity-0 [@media(hover:none)]:opacity-0">{workspace.terminals}</span>
+ {pending ? <Loader2 aria-hidden className="h-3 w-3 shrink-0 animate-spin text-muted-foreground" /> : <RunningMark workspaces={[workspace]} hover="group/space" />}
{pending && <span className="sr-only">Switching workspace</span>}
</button>
{(() => {