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(ide): add live agents panel to sidebar for active workspace

rubenluetke10-beep66b5964ab999
diff --git a/jarvis/ui/web/frontend/src/components/agentic/IdeWorkspaceAgents.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/IdeWorkspaceAgents.test.tsx
new file mode 100644
index 0000000000..8ceea105eb
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/agentic/IdeWorkspaceAgents.test.tsx
@@ -0,0 +1,131 @@
+import { act, cleanup, fireEvent, render, screen } from "@testing-library/react";
+import { afterEach, beforeEach, describe, expect, it } from "vitest";
+import { IdeWorkspaceAgents } from "./IdeWorkspaceAgents";
+import { useIdeChatStore } from "@/store/ideChat";
+import { useIdeProjectsStore } from "@/store/ideProjects";
+import { resetWorkspacePanesPoll, useWorkspacePanesStore } from "@/store/workspacePanes";
+import type { WorkspacePaneRow } from "@/lib/agenticIdeApi";
+
+function pane(name: string, workspaceId: string, overrides: Partial<WorkspacePaneRow> = {}): WorkspacePaneRow {
+ return {
+ workspace_id: workspaceId,
+ workspace_name: workspaceId,
+ folder: "/code/app",
+ workspace_active: workspaceId === "w1",
+ key: name,
+ history_id: `${name}@${workspaceId}`,
+ name,
+ agent: "claude",
+ display_name: "Claude Code",
+ accepts_prompts: true,
+ status: "live",
+ exit_code: null,
+ activity: "working",
+ activity_since: 0,
+ worked: true,
+ started_at: 1,
+ last_output_at: 2,
+ last_prompt: "",
+ last_prompt_at: null,
+ recap: "",
+ has_resume: false,
+ readable: true,
+ account: null,
+ account_label: null,
+ archived: false,
+ ...overrides,
+ };
+}
+
+beforeEach(() => {
+ resetWorkspacePanesPoll();
+ useWorkspacePanesStore.setState({
+ panes: [
+ pane("T1", "w1", { activity: "working" }),
+ pane("T2", "w1", { activity: "asking", agent: "codex", display_name: "Codex" }),
+ pane("T3", "w1", { activity: "waiting", agent: "opencode", display_name: "opencode" }),
+ pane("T1", "w2", { activity: "working" }),
+ ],
+ activeId: "w1",
+ loaded: true,
+ load: async () => {},
+ });
+ useIdeProjectsStore.setState({
+ projects: [],
+ activeWorkspaceId: "w1",
+ pendingWorkspaceId: null,
+ refreshRequest: null,
+ action: null,
+ });
+ useIdeChatStore.setState({
+ paneRequest: null,
+ stagedPane: null,
+ workspaces: [],
+ agents: [],
+ terminalRequest: null,
+ newChatRequest: null,
+ workspaceRequest: null,
+ sessionRequest: null,
+ addWorkspaceRequest: null,
+ });
+});
+
+afterEach(cleanup);
+
+describe("IdeWorkspaceAgents", () => {
+ it("lists only the active workspace agents with names and live dots", () => {
+ render(<IdeWorkspaceAgents />);
+ const rows = screen.getAllByTestId("ide-workspace-agent-row");
+ expect(rows.map((row) => row.getAttribute("data-pane"))).toEqual(["T1", "T2", "T3"]);
+ expect(screen.getByTestId("ide-workspace-agents-count").textContent).toBe("3");
+ expect(rows[0].getAttribute("data-kind")).toBe("working");
+ expect(rows[1].getAttribute("data-kind")).toBe("waiting");
+ expect(rows[2].getAttribute("data-kind")).toBe("idle");
+ expect(rows[0].textContent).toContain("T1");
+ expect(rows[0].textContent).toContain("Claude Code");
+ expect(rows[1].textContent).toContain("Codex");
+ });
+
+ it("marks errors red and idle panes gray", () => {
+ useWorkspacePanesStore.setState({
+ panes: [
+ pane("T1", "w1", { status: "error", activity: "" }),
+ pane("T9", "w1", { status: "live", activity: "", worked: false }),
+ ],
+ });
+ render(<IdeWorkspaceAgents />);
+ const rows = screen.getAllByTestId("ide-workspace-agent-row");
+ expect(rows[0].getAttribute("data-kind")).toBe("error");
+ expect(rows[1].getAttribute("data-kind")).toBe("idle");
+ });
+
+ it("switches the list when the workspace tab changes", () => {
+ const { rerender } = render(<IdeWorkspaceAgents />);
+ expect(screen.getAllByTestId("ide-workspace-agent-row")).toHaveLength(3);
+ act(() => useIdeProjectsStore.setState({ activeWorkspaceId: "w2" }));
+ rerender(<IdeWorkspaceAgents />);
+ const rows = screen.getAllByTestId("ide-workspace-agent-row");
+ expect(rows.map((row) => row.getAttribute("data-pane"))).toEqual(["T1"]);
+ });
+
+ it("asks the IDE view to focus the pane on click", () => {
+ render(<IdeWorkspaceAgents />);
+ fireEvent.click(screen.getByRole("button", { name: /T2, Codex/ }));
+ expect(useIdeChatStore.getState().paneRequest).toMatchObject({ workspaceId: "w1", pane: "T2" });
+ });
+
+ it("highlights the staged pane", () => {
+ useIdeChatStore.setState({ stagedPane: "T2" });
+ render(<IdeWorkspaceAgents />);
+ const rows = screen.getAllByTestId("ide-workspace-agent-row");
+ expect(rows[1].getAttribute("aria-current")).toBe("true");
+ expect(rows[0].getAttribute("aria-current")).toBeNull();
+ });
+
+ it("shows an empty hint when the workspace has no agents", () => {
+ useIdeProjectsStore.setState({ activeWorkspaceId: "w9" });
+ render(<IdeWorkspaceAgents />);
+ expect(screen.queryByTestId("ide-workspace-agent-row")).toBeNull();
+ expect(screen.getByTestId("ide-workspace-agents").textContent).toContain("No agents");
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/components/agentic/IdeWorkspaceAgents.tsx b/jarvis/ui/web/frontend/src/components/agentic/IdeWorkspaceAgents.tsx
new file mode 100644
index 0000000000..30057d43a8
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/agentic/IdeWorkspaceAgents.tsx
@@ -0,0 +1,125 @@
+import { useIdeChatStore } from "@/store/ideChat";
+import { useIdeProjectsStore } from "@/store/ideProjects";
+import { useWorkspacePanes } from "@/store/workspacePanes";
+import type { WorkspacePaneRow } from "@/lib/agenticIdeApi";
+import { cn } from "@/lib/utils";
+
+type AgentDotKind = "working" | "waiting" | "idle" | "error";
+
+function dotKindFor(pane: WorkspacePaneRow): AgentDotKind {
+ if (pane.status === "error" || pane.activity === "failed") return "error";
+ if (pane.activity === "asking") return "waiting";
+ if (
+ pane.activity === "working" ||
+ pane.activity === "starting" ||
+ pane.status === "pending"
+ )
+ return "working";
+ return "idle";
+}
+
+const DOT_STYLE: Record<AgentDotKind, { dot: string; label: string; ping: boolean }> = {
+ working: { dot: "bg-success", label: "working", ping: false },
+ waiting: { dot: "bg-warning", label: "needs input", ping: true },
+ idle: { dot: "bg-muted-foreground/40", label: "idle", ping: false },
+ error: { dot: "bg-destructive", label: "error", ping: false },
+};
+
+function dotLabel(pane: WorkspacePaneRow, kind: AgentDotKind): string {
+ if (kind === "working") return pane.activity === "starting" || pane.status === "pending" ? "starting" : "working";
+ if (kind === "waiting") return "needs input";
+ if (kind === "error") return pane.activity === "failed" ? "failed" : "error";
+ if (pane.status === "exited") return "exited";
+ return pane.worked ? "done" : "idle";
+}
+
+/**
+ * Compact agents list for the active workspace tab.
+ *
+ * Sits under Workspaces in the sidebar while the Agentic IDE is on screen:
+ * one row per coding agent of the workspace at the front — status dot, pane
+ * name and agent — switching with the tab because it filters on the active
+ * workspace id. Rows stay current through the shared pane store (poll plus
+ * socket activity events), and a click asks the IDE view to bring that pane
+ * forward via `requestPane`.
+ */
+export function IdeWorkspaceAgents() {
+ const activeWorkspaceId = useIdeProjectsStore((state) => state.activeWorkspaceId);
+ const requestPane = useIdeChatStore((state) => state.requestPane);
+ const stagedPane = useIdeChatStore((state) => state.stagedPane);
+ const panes = useWorkspacePanes();
+
+ const mine = (activeWorkspaceId
+ ? panes.filter(
+ (pane) => pane.workspace_id === activeWorkspaceId && !pane.archived && pane.agent !== "shell",
+ )
+ : []
+ ).slice().sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true }));
+
+ return (
+ <section
+ data-testid="ide-workspace-agents"
+ data-workspace={activeWorkspaceId ?? undefined}
+ aria-label="Agents in this workspace"
+ className="mx-2 mt-2 shrink-0 overflow-hidden rounded-2xl border border-border/50 bg-card/40 p-2 pb-3"
+ >
+ <div className="flex items-center justify-between px-2 pb-2 pt-1">
+ <span className="text-[17px] font-semibold text-foreground">Agents</span>
+ {mine.length > 0 && (
+ <span
+ data-testid="ide-workspace-agents-count"
+ aria-label={`${mine.length} ${mine.length === 1 ? "agent" : "agents"}`}
+ className="rounded-md bg-background/50 px-1.5 py-0.5 text-xs tabular-nums text-muted-foreground"
+ >
+ {mine.length}
+ </span>
+ )}
+ </div>
+ {activeWorkspaceId === null ? (
+ <p className="px-2 py-1 text-xs text-muted-foreground">Select a workspace to see its agents.</p>
+ ) : mine.length === 0 ? (
+ <p className="px-2 py-1 text-xs text-muted-foreground">No agents running in this workspace.</p>
+ ) : (
+ <ul className="space-y-0.5">
+ {mine.map((pane) => {
+ const kind = dotKindFor(pane);
+ const style = DOT_STYLE[kind];
+ const stateLabel = dotLabel(pane, kind);
+ const cli = pane.display_name || pane.agent;
+ const selected = stagedPane !== null && pane.name === stagedPane;
+ return (
+ <li key={pane.history_id}>
+ <button
+ type="button"
+ onClick={() => requestPane(pane.workspace_id, pane.name)}
+ title={`${pane.name} · ${cli} · ${stateLabel}`}
+ aria-label={`${pane.name}, ${cli}, ${stateLabel}`}
+ aria-current={selected ? "true" : undefined}
+ data-testid="ide-workspace-agent-row"
+ data-pane={pane.name}
+ data-kind={kind}
+ className={cn(
+ "flex min-h-10 w-full items-center gap-2.5 rounded-xl px-2.5 text-left transition-colors",
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring hover:bg-muted/70",
+ selected && "border border-border/50 bg-muted text-foreground",
+ )}
+ >
+ <span className="relative flex h-2 w-2 shrink-0" aria-hidden="true">
+ {style.ping && (
+ <span className="absolute inset-0 animate-ping rounded-full bg-current opacity-60 [animation-duration:1.8s] motion-reduce:hidden text-warning" />
+ )}
+ <span className={cn("relative h-2 w-2 rounded-full", style.dot)} />
+ </span>
+ <span className="min-w-0 flex-1 truncate text-[15px] font-medium text-foreground">
+ {pane.name}
+ </span>
+ <span className="max-w-[45%] shrink-0 truncate text-xs text-muted-foreground">{cli}</span>
+ </button>
+ </li>
+ );
+ })}
+ </ul>
+ )}
+ </section>
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
index e232a4c016..be2701d198 100644
--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
@@ -30,6 +30,7 @@ import { useConversations } from "@/hooks/useConversations";
import { useHomeStore } from "@/store/home";
import { useAgentChatStore } from "@/store/agentChat";
import { IdeProjectTree } from "@/components/agentic/IdeProjectTree";
+import { IdeWorkspaceAgents } from "@/components/agentic/IdeWorkspaceAgents";
import { useIdeProjectsStore } from "@/store/ideProjects";
import { useAppInstance } from "@/hooks/useAppInstance";
import { usePublishIdentity } from "@/components/marketplace/PublishIdentity";
@@ -524,7 +525,7 @@ export function Sidebar({
{moreOpen && <ul id="sidebar-more" className="space-y-1">{moreItems.map((item) => item.id === "tasks" ? renderRow({ ...item, labelKey: "sidebar.scheduled" }) : renderRow(item))}</ul>}
</nav>}
{!railed && (onIdeSection
- ? <IdeProjectTree />
+ ? <><IdeProjectTree /><IdeWorkspaceAgents /></>
: <section className="mt-4 px-2 pb-3" aria-label={t("sidebar.recent_chats")}><RecentChats /></section>)}
</div>
diff --git a/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx b/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
index 6d280bbc2f..f295f2a2f4 100644
--- a/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
@@ -2,6 +2,7 @@ import { act, cleanup, fireEvent, render, screen, waitFor } from "@testing-libra
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { AgenticIdeView } from "./AgenticIdeView";
import { useIdeProjectsStore } from "@/store/ideProjects";
+import { useIdeChatStore } from "@/store/ideChat";
import { balancedLayout } from "@/components/agentic/workspaceDocking";
const api = vi.hoisted(() => ({
@@ -196,4 +197,25 @@ describe("Agentic IDE project flow", () => {
expect(screen.getByTestId("live-grid").textContent).toBe("w2");
});
+ it("focuses the requested pane from the sidebar agents list", async () => {
+ const session = { id: "w1", project_id: "p1", folder: "/code/app", name: "A", created_at: 0,
+ focus_mode: false, project: { name: "App" }, terminals: [{ key: "a", history_id: "a", name: "T1" }], layout: balancedLayout(["a"]) };
+ const current = { ...emptyState, active: true, active_id: "w1", session };
+ const otherSession = { ...session, id: "w2", name: "B" };
+ const other = { ...current, active_id: "w2", session: otherSession };
+ api.fetchIdeState.mockResolvedValue(current);
+ api.fetchIdeProjects.mockResolvedValue({ projects: [project], active_workspace_id: "w1" });
+ api.activateWorkspace.mockImplementation(async () => {
+ api.fetchIdeState.mockResolvedValue(other);
+ api.fetchIdeProjects.mockResolvedValue({ projects: [project], active_workspace_id: "w2" });
+ return other;
+ });
+ useIdeChatStore.setState({ paneRequest: null, stagedPane: null });
+ render(<AgenticIdeView onScreen={false} />);
+ await screen.findByTestId("live-grid");
+ act(() => useIdeChatStore.getState().requestPane("w2", "T1"));
+ await waitFor(() => expect(api.activateWorkspace).toHaveBeenCalledWith("w2"));
+ await waitFor(() => expect(useIdeChatStore.getState().stagedPane).toBe("T1"));
+ });
+
});
diff --git a/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx b/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
index 52699b308b..28bd2f0e78 100644
--- a/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
+++ b/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
@@ -30,6 +30,8 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {
const refreshRequest = useIdeProjectsStore((state) => state.refreshRequest);
const setWorkspace = useIdeChatStore((state) => state.setWorkspace);
const setWorkspaces = useIdeChatStore((state) => state.setWorkspaces);
+ const paneRequest = useIdeChatStore((state) => state.paneRequest);
+ const setStagedPane = useIdeChatStore((state) => state.setStagedPane);
const [state, setState] = useState<IdeState | null>(null);
const [projects, setProjects] = useState<IdeProject[]>([]);
const [agents, setAgents] = useState<AgentStatus[]>([]);
@@ -52,6 +54,7 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {
return stored === "light" || stored === "dark" ? stored : null;
});
const handledAction = useRef(0);
+ const handledPaneRequest = useRef(0);
const refreshEpoch = useRef(0);
const activationRunning = useRef(false);
const pendingActivation = useRef<string | null>(null);
@@ -264,6 +267,14 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {
if (workspaceId !== session?.id) setState(await activateWorkspace(workspaceId));
setSelected(pane);
});
+ useEffect(() => {
+ if (!paneRequest || handledPaneRequest.current === paneRequest.nonce) return;
+ handledPaneRequest.current = paneRequest.nonce;
+ jumpToPane(paneRequest.workspaceId, paneRequest.pane);
+ }, [paneRequest, jumpToPane]);
+ useEffect(() => {
+ setStagedPane(session ? selected : null);
+ }, [session, selected, setStagedPane]);
const saveWorkspaceName = () => void run(async () => {
if (!session || !renameValue.trim()) return;
setState(await renameWorkspace(session.id, renameValue.trim()));