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): bring back the quiet session counts in the project tree

rubenluetke10-beepd17140b854af
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 565f458b91..205a1df6ea 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,18 @@ it("expands a manually collapsed project when its first workspace becomes active
expect(screen.getByTestId("ide-workspace-p1-w1")).toBeDefined();
});
-it("keeps rows plain: no session counts or status marks", () => {
- const busy = { ...project(), workspaces: [
- { ...project().workspaces[0], status: "open", live_terminals: 2, terminals: 6 },
- { ...project().workspaces[0], id: "p1-w2", status: "closed", live_terminals: 0, terminals: 3 },
- ] } as IdeProject;
- useIdeProjectsStore.setState({ projects: [busy] });
+it("counts agent sessions per row, and on the header only when folded", () => {
+ const withTwo = { ...project(), workspaces: [
+ { ...project().workspaces[0], terminals: 6 },
+ { ...project().workspaces[0], id: "p1-w2", terminals: 3 },
+ ] };
+ useIdeProjectsStore.setState({ projects: [withTwo] });
render(<IdeProjectTree />);
- expect(screen.queryByText("6")).toBeNull();
+ // Open, the rows carry their own counts; folded, the header sums them.
+ expect(screen.getByLabelText("6 agent sessions").textContent).toBe("6");
+ expect(screen.queryByLabelText("9 agent sessions")).toBeNull();
fireEvent.click(screen.getByRole("button", { name: "Collapse App" }));
- expect(screen.queryByText("9")).toBeNull();
- expect(screen.queryByLabelText(/agent sessions?|agents? running/)).toBeNull();
+ expect(screen.getByLabelText("9 agent sessions").textContent).toBe("9");
});
it("renders a project whose only workspace shares its name as one row", async () => {
@@ -126,7 +127,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.queryByText("4")).toBeNull();
+ expect(screen.getByLabelText("4 agent sessions")).toBeDefined();
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 cff74f64c7..d7de696fb9 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/IdeProjectTree.tsx
@@ -69,6 +69,15 @@ function soloWorkspace(project: IdeProject): ProjectWorkspace | null {
return workspace.name.trim().toLowerCase() === project.name.trim().toLowerCase() ? workspace : null;
}
+/** The agent sessions behind a row: a quiet number that makes room for the row's actions on hover. */
+function SessionCount({ count, hover }: { count: number; hover: "group" | "group/space" }) {
+ 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={`${count} agent ${count === 1 ? "session" : "sessions"}`}
+ className={`shrink-0 text-[13px] tabular-nums text-muted-foreground/70 transition-opacity [@media(hover:none)]:opacity-0 ${fade}`}>{count}</span>;
+}
+
function readExpansion(): Record<string, boolean> {
try {
const value: unknown = JSON.parse(localStorage.getItem(EXPANSION_KEY) ?? "{}");
@@ -426,6 +435,7 @@ export function IdeProjectTree() {
const isProjectDropBefore = projectDropTarget?.id === project.id && projectDropTarget.before;
const isProjectDropAfter = projectDropTarget?.id === project.id && !projectDropTarget.before;
const solo = soloWorkspace(project);
+ const count = project.workspaces.reduce((total, workspace) => total + workspace.terminals, 0);
const soloSelected = solo !== null && solo.id === activeWorkspaceId;
const soloPending = solo !== null && solo.id === pendingWorkspaceId;
const soloBlocked = solo !== null && solo.status === "closed" && !solo.restorable;
@@ -502,6 +512,8 @@ export function IdeProjectTree() {
: <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) && <SessionCount count={count} 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}
@@ -624,7 +636,8 @@ export function IdeProjectTree() {
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>
- {pending && <Loader2 aria-hidden className="h-3 w-3 shrink-0 animate-spin text-muted-foreground" />}
+ {pending ? <Loader2 aria-hidden className="h-3 w-3 shrink-0 animate-spin text-muted-foreground" />
+ : workspace.terminals > 0 && <SessionCount count={workspace.terminals} hover="group/space" />}
{pending && <span className="sr-only">Switching workspace</span>}
</button>
{(() => {