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): filter the Agents tab by this space or the whole folder

rubenluetke10-beep26d85462a4fe
diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.test.tsx
index 174de79500..8e1be369db 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.test.tsx
@@ -42,6 +42,7 @@ function pane(name: string, workspaceId: string, overrides: Partial<WorkspacePan
}
beforeEach(() => {
+ localStorage.removeItem("jarvis.agenticIde.agentsScope");
resetWorkspacePanesPoll();
useIdeSidePanelStore.setState({ spotlight: null });
usePaneReviewsStore.setState({ reviewed: {} });
@@ -176,4 +177,37 @@ describe("AgentsOverview", () => {
expect(screen.queryByTestId("ide-workspace-agent-row")).toBeNull();
expect(screen.getByTestId("ide-workspace-agents").textContent).toContain("No agents");
});
+
+ it("widens to every workspace of the folder and remembers the choice", () => {
+ useWorkspacePanesStore.setState({
+ panes: [
+ pane("T1", "w1", { activity: "working" }),
+ pane("T1", "w2", { activity: "working", workspace_name: "Blog" }),
+ pane("T1", "w3", { activity: "working", folder: "/code/other" }),
+ ],
+ });
+ const { unmount } = render(<AgentsOverview />);
+ expect(screen.getAllByTestId("ide-workspace-agent-row")).toHaveLength(1);
+
+ fireEvent.click(screen.getByTestId("ide-agents-scope-folder"));
+ const rows = screen.getAllByTestId("ide-workspace-agent-row");
+ expect(rows.map((row) => row.getAttribute("data-workspace"))).toEqual(["w1", "w2"]);
+ expect(rows[1].textContent).toContain("Blog");
+ expect(rows[0].textContent).not.toContain("w1");
+ unmount();
+
+ render(<AgentsOverview />);
+ expect(screen.getByTestId("ide-agents-scope-folder").getAttribute("aria-checked")).toBe("true");
+ expect(screen.getAllByTestId("ide-workspace-agent-row")).toHaveLength(2);
+ });
+
+ it("brings another workspace's pane forward from the folder view", () => {
+ render(<AgentsOverview />);
+ fireEvent.click(screen.getByTestId("ide-agents-scope-folder"));
+ const row = screen
+ .getAllByTestId("ide-workspace-agent-row")
+ .find((entry) => entry.getAttribute("data-workspace") === "w2")!;
+ fireEvent.click(row);
+ expect(useIdeChatStore.getState().paneRequest).toMatchObject({ workspaceId: "w2", pane: "T1" });
+ });
});
diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.tsx b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.tsx
index 51931a4fe6..5715bc6a5f 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.tsx
@@ -17,10 +17,12 @@ import {
columnFor,
compactSince,
dotKindFor,
+ folderAgents,
stateKeyFor,
workspaceAgents,
type AgentColumn,
type AgentDotKind,
+ type AgentScope,
} from "./agentStatus";
/** How often the "3m" readings move on; state changes arrive live anyway. */
@@ -35,6 +37,31 @@ function useClock(): number {
return now;
}
+const SCOPE_KEY = "jarvis.agenticIde.agentsScope";
+const SCOPES: readonly AgentScope[] = ["workspace", "folder"];
+
+function storedScope(): AgentScope {
+ try {
+ return localStorage.getItem(SCOPE_KEY) === "folder" ? "folder" : "workspace";
+ } catch {
+ return "workspace";
+ }
+}
+
+/** The tab's own filter, remembered per browser: this workspace, or its whole folder. */
+function useAgentScope(): [AgentScope, (scope: AgentScope) => void] {
+ const [scope, setScope] = useState<AgentScope>(storedScope);
+ const choose = (next: AgentScope) => {
+ setScope(next);
+ try {
+ localStorage.setItem(SCOPE_KEY, next);
+ } catch {
+ /* a convenience only: the filter still works for this session */
+ }
+ };
+ return [scope, choose];
+}
+
/** Ink and a faint fill per state, from the semantic status tokens only. */
const STATE_TONE: Record<AgentDotKind, { text: string; pill: string }> = {
waiting: { text: "text-warning", pill: "bg-warning/10" },
@@ -63,7 +90,9 @@ const COLUMN_TONE: Record<AgentColumn, string> = {
* `store/paneReviews`). A card leads with the agent's brand mark, then its
* goal, its state and for how long, and when it last printed anything. A click
* brings the pane forward, frames it in the grid (the `spotlight`) and counts
- * as reviewing it.
+ * as reviewing it. A switch at the top widens the list from the workspace at
+ * the front to every workspace of its project folder; a card from another
+ * workspace names it, and its click brings that workspace forward.
*/
export function AgentsOverview() {
const t = useT();
@@ -75,7 +104,16 @@ export function AgentsOverview() {
const panes = useWorkspacePanes();
usePaneRecapPoll();
const recaps = usePaneRecapsStore((state) => state);
- const mine = workspaceAgents(panes, activeWorkspaceId);
+ const [scope, setScope] = useAgentScope();
+ const activeFolder = useIdeProjectsStore(
+ (state) =>
+ state.projects.flatMap((project) => project.workspaces).find((workspace) => workspace.id === activeWorkspaceId)
+ ?.folder ?? null,
+ );
+ const mine =
+ scope === "folder"
+ ? folderAgents(panes, activeWorkspaceId, activeFolder)
+ : workspaceAgents(panes, activeWorkspaceId);
const reviewed = usePaneReviewsStore((state) => state.reviewed);
const markReviewed = usePaneReviewsStore((state) => state.markReviewed);
const pushToast = useEventStore((state) => state.pushToast);
@@ -109,6 +147,7 @@ export function AgentsOverview() {
const lastOutput = compactSince(pane.last_output_at, now);
const recap = recaps.workspaceId === pane.workspace_id ? recaps.byName[pane.name] : undefined;
const title = paneTitleFrom(recap, pane);
+ const elsewhere = pane.workspace_id !== activeWorkspaceId ? pane.workspace_name : "";
return (
<li key={pane.history_id}>
<button
@@ -119,6 +158,7 @@ export function AgentsOverview() {
aria-current={selected ? "true" : undefined}
data-testid="ide-workspace-agent-row"
data-pane={pane.name}
+ data-workspace={pane.workspace_id}
data-kind={kind}
className={cn(
"group flex w-full items-center rounded-xl border p-3 text-left transition-[border-color,background-color,box-shadow] duration-150",
@@ -149,7 +189,7 @@ export function AgentsOverview() {
{title || cli}
</span>
<span className="truncate text-[11px] tabular-nums text-muted-foreground">
- {[title ? cli : "", lastOutput ? fill(t("ide_side_panel.agents.last_output"), { time: lastOutput }) : ""]
+ {[elsewhere, title ? cli : "", lastOutput ? fill(t("ide_side_panel.agents.last_output"), { time: lastOutput }) : ""]
.filter(Boolean)
.join(" · ")}
</span>
@@ -193,10 +233,40 @@ export function AgentsOverview() {
aria-label={t("ide_side_panel.agents.aria")}
className="flex h-full min-h-0 flex-col"
>
+ {activeWorkspaceId !== null && (
+ <div
+ role="radiogroup"
+ aria-label={t("ide_side_panel.agents.scope.aria")}
+ data-testid="ide-agents-scope"
+ className="mx-3 mt-3 flex shrink-0 rounded-lg border border-border/60 bg-muted/40 p-0.5"
+ >
+ {SCOPES.map((option) => (
+ <button
+ key={option}
+ type="button"
+ role="radio"
+ aria-checked={scope === option}
+ onClick={() => setScope(option)}
+ data-testid={`ide-agents-scope-${option}`}
+ className={cn(
+ "flex-1 rounded-md px-2 py-1 text-xs font-medium transition-colors duration-150 motion-reduce:transition-none",
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ scope === option
+ ? "bg-background text-foreground shadow-sm"
+ : "text-muted-foreground hover:text-foreground",
+ )}
+ >
+ {t(`ide_side_panel.agents.scope.${option}`)}
+ </button>
+ ))}
+ </div>
+ )}
{activeWorkspaceId === null ? (
<p className="px-4 py-3 text-sm text-muted-foreground">{t("ide_side_panel.agents.no_workspace")}</p>
) : mine.length === 0 ? (
- <p className="px-4 py-3 text-sm text-muted-foreground">{t("ide_side_panel.agents.empty")}</p>
+ <p className="px-4 py-3 text-sm text-muted-foreground">
+ {t(scope === "folder" ? "ide_side_panel.agents.empty_folder" : "ide_side_panel.agents.empty")}
+ </p>
) : (
<div className="scrollbar-jarvis min-h-0 flex-1 space-y-4 overflow-y-auto px-3 pb-3 pt-3">
{COLUMN_ORDER.map((column) => {
diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/agentStatus.ts b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/agentStatus.ts
index 7a96cd6a61..d9ffb1b8e0 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/agentStatus.ts
+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/agentStatus.ts
@@ -57,6 +57,34 @@ export function workspaceAgents(panes: WorkspacePaneRow[], workspaceId: string |
.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true }));
}
+/** Which agents the Agents tab lists: the workspace at the front, or its whole project folder. */
+export type AgentScope = "workspace" | "folder";
+
+/**
+ * The coding agents of every workspace that shares `workspaceId`'s project
+ * folder — the active workspace first, then the others by name.
+ *
+ * `folder` is the project folder the sidebar groups by; when the caller cannot
+ * name it, the active workspace's own rows supply it.
+ */
+export function folderAgents(
+ panes: WorkspacePaneRow[],
+ workspaceId: string | null,
+ folder?: string | null,
+): WorkspacePaneRow[] {
+ if (!workspaceId) return [];
+ const home = folder || panes.find((pane) => pane.workspace_id === workspaceId)?.folder;
+ if (!home) return workspaceAgents(panes, workspaceId);
+ return panes
+ .filter((pane) => pane.folder === home && !pane.archived && pane.agent !== "shell")
+ .sort(
+ (a, b) =>
+ Number(b.workspace_id === workspaceId) - Number(a.workspace_id === workspaceId) ||
+ a.workspace_name.localeCompare(b.workspace_name, undefined, { numeric: true }) ||
+ a.name.localeCompare(b.name, undefined, { numeric: true }),
+ );
+}
+
/** "42s" / "3m" / "2h" / "1d" since an epoch-seconds moment; "" when unknown. */
export function compactSince(at: number | null | undefined, nowMs: number = Date.now()): string {
if (!at) return "";
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index a98020c77a..5191d475a0 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -5702,6 +5702,12 @@
"count_other": "{n} Agents",
"no_workspace": "Wähle einen Workspace, um seine Agents zu sehen.",
"empty": "In diesem Workspace laufen keine Agents.",
+ "empty_folder": "In diesem Ordner laufen keine Agents.",
+ "scope": {
+ "aria": "Agents anzeigen aus",
+ "workspace": "Dieser Space",
+ "folder": "Ganzer Ordner"
+ },
"columns": {
"done": "Fertig",
"working": "Arbeitet",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index bcfbf15b2a..e99501b44d 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -5735,6 +5735,12 @@
"count_other": "{n} agents",
"no_workspace": "Select a workspace to see its agents.",
"empty": "No agents running in this workspace.",
+ "empty_folder": "No agents running in this folder.",
+ "scope": {
+ "aria": "Show agents from",
+ "workspace": "This space",
+ "folder": "Whole folder"
+ },
"columns": {
"done": "Done",
"working": "Working",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index 9467b5192a..99c958e3e0 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -5702,6 +5702,12 @@
"count_other": "{n} agentes",
"no_workspace": "Selecciona un espacio de trabajo para ver sus agentes.",
"empty": "No hay agentes en este espacio de trabajo.",
+ "empty_folder": "No hay agentes en esta carpeta.",
+ "scope": {
+ "aria": "Mostrar agentes de",
+ "workspace": "Este espacio",
+ "folder": "Toda la carpeta"
+ },
"columns": {
"done": "Terminado",
"working": "Trabajando",