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.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(office): the IDE desk monitor looks like the real Agentic IDE, and the monitors load sooner
rubenluetke10-beepe2e649c3170b
diff --git a/jarvis/ui/web/frontend/src/components/society/office/CommandOffice.tsx b/jarvis/ui/web/frontend/src/components/society/office/CommandOffice.tsxindex d986321ccf..43264358db 100644--- a/jarvis/ui/web/frontend/src/components/society/office/CommandOffice.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/CommandOffice.tsx@@ -23,7 +23,7 @@ import { Box, MAT, matte, Rounded } from "./OfficeFurniture";import { paneOccupants } from "./codingFloor";import { TaskChair } from "./OfficeChairs";import { COMMAND_DESK, COMMAND_DESK_OFFSET, type Furniture, type FurnitureKind } from "./officeLayout";-import { MissionLiveScreen } from "./MissionScreens";+import { MissionLiveScreen, preloadMissionScreens } from "./MissionScreens";import { useOfficeStore, type MonitorSection } from "./officeStore";// ---------------------------------------------------------------------------@@ -339,8 +339,8 @@ function ExecutiveChair() {}/** Run the live sections within this camera distance of the desk, stop beyond the second (no flicker at the edge). */-const LIVE_NEAR_M = 12;-const LIVE_FAR_M = 15;+const LIVE_NEAR_M = 22;+const LIVE_FAR_M = 26;/** Should the desk run its live sections, given the camera distance and whether it already does? Pure. */export function deskLive(distance: number, live: boolean): boolean {@@ -403,6 +403,8 @@ export function CommandDesk() {const open = useOpenMission();const anchor = useRef<Group>(null);const live = useNearCamera(anchor);+ // The floor is open: fetch the sections' code now, not when the camera arrives.+ useEffect(() => { preloadMissionScreens(); }, []);const { w, d } = COMMAND_DESK;const agentCount = `${data.counts.total} ${labels.agents}`;return (diff --git a/jarvis/ui/web/frontend/src/components/society/office/MissionScreens.tsx b/jarvis/ui/web/frontend/src/components/society/office/MissionScreens.tsxindex 871d4e2e0f..68973e89f7 100644--- a/jarvis/ui/web/frontend/src/components/society/office/MissionScreens.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/MissionScreens.tsx@@ -24,7 +24,9 @@ import { createAgentChatStore } from "@/store/agentChat";import { useWorkspacePanesStore } from "@/store/workspacePanes";import { fetchPaneScreens, MAX_PANE_SCREENS, type PaneScreen } from "@/lib/paneScreensApi";import { PANE_BRAND, PANE_CHROME, PANE_SOLID, storedTerminalAppearance, themeFor } from "@/components/agentic/terminalThemes";-import { AgentMark } from "@/components/agentic/AgentMark";+import { Folder } from "lucide-react";+import { WorkspaceTerminalHeader } from "@/components/agentic/WorkspaceTerminalHeader";+import type { PaneEdgeState } from "@/components/agentic/terminalThemes";import { RosterRail } from "@/components/society/roster/RosterRail";import { useSocietyRoster, type SocietyAgent } from "../data";import { useSocietyChatGroups } from "@/lib/societyChatGroups";@@ -35,8 +37,19 @@ import type { MonitorSection } from "./officeStore";import "./paneCommand.css";import "./missionScreens.css";-const CostsView = lazy(() => import("@/views/CostsView").then((m) => ({ default: m.CostsView })));-const AgentChatPanel = lazy(() => import("../chat/AgentChatPanel").then((m) => ({ default: m.AgentChatPanel })));+const loadCosts = () => import("@/views/CostsView");+const loadChat = () => import("../chat/AgentChatPanel");+const CostsView = lazy(() => loadCosts().then((m) => ({ default: m.CostsView })));+const AgentChatPanel = lazy(() => loadChat().then((m) => ({ default: m.AgentChatPanel })));++/**+ * Fetch the sections' code before the camera gets close, so walking up to the+ * desk shows the screens at once instead of a blank glass while chunks load.+ */+export function preloadMissionScreens(): void {+ void loadCosts().catch((err) => console.warn("Mission Control: Spend preload failed", err));+ void loadChat().catch((err) => console.warn("Mission Control: chat preload failed", err));+}/** The sections are laid out at this window size, then scaled onto the monitor. */export const MISSION_SCREEN_PX = { w: 1240, h: 723 } as const;@@ -98,14 +111,31 @@ export function idePanes(occupants: readonly PaneOccupant[]): { workspace: strinreturn { workspace: front.pane.workspace_id, tiles };}-/** Columns × rows for `n` tiles, the way the IDE grid splits a workspace. Pure. */+/** Columns × rows for `n` tiles, the way the IDE splits a workspace: side by side up to three, then two rows. Pure. */export function ideGrid(n: number): { cols: number; rows: number } {- if (n <= 1) return { cols: 1, rows: 1 };- if (n === 2) return { cols: 2, rows: 1 };- if (n <= 4) return { cols: 2, rows: 2 };+ if (n <= 3) return { cols: Math.max(1, n), rows: 1 };+ if (n === 4) return { cols: 2, rows: 2 };return { cols: 3, rows: 2 };}+/** The IDE sidebar's tree: each project folder with its workspaces, their pane counts and whether one works. Pure. */+export function ideTree(occupants: readonly PaneOccupant[]): { folder: string; name: string; workspaces: { id: string; name: string; count: number; working: boolean }[] }[] {+ const projects = new Map<string, { folder: string; name: string; workspaces: Map<string, { id: string; name: string; count: number; working: boolean }> }>();+ for (const { pane, agent } of occupants) {+ const folder = pane.folder || pane.workspace_name;+ const project = projects.get(folder) ?? { folder, name: folder.split(/[\\/]/).filter(Boolean).pop() ?? folder, workspaces: new Map() };+ const ws = project.workspaces.get(pane.workspace_id) ?? { id: pane.workspace_id, name: pane.workspace_name, count: 0, working: false };+ ws.count += 1;+ ws.working ||= agent.state === "working";+ project.workspaces.set(pane.workspace_id, ws);+ projects.set(folder, project);+ }+ return [...projects.values()].map((p) => ({ folder: p.folder, name: p.name, workspaces: [...p.workspaces.values()] }));+}++const EDGE: Record<string, PaneEdgeState> = { pending: "connecting", live: "live", exited: "exited", error: "error" };+const noop = () => undefined;+function usePaneScreenBatch(panes: { workspaceId: string; key: string }[]): Map<string, PaneScreen> | null {const [screens, setScreens] = useState<Map<string, PaneScreen> | null>(null);const signature = panes.map((p) => `${p.workspaceId}:${p.key}`).join("|");@@ -143,11 +173,7 @@ function IdeScreen() {const panes = useWorkspacePanesStore((s) => s.panes);const occupants = useMemo(() => paneOccupants(panes), [panes]);const { workspace, tiles } = idePanes(occupants);- const workspaces = useMemo(() => {- const seen = new Map<string, string>();- for (const o of occupants) if (!seen.has(o.pane.workspace_id)) seen.set(o.pane.workspace_id, o.pane.workspace_name);- return [...seen];- }, [occupants]);+ const tree = useMemo(() => ideTree(occupants), [occupants]);const screens = usePaneScreenBatch(tiles.map((o) => ({ workspaceId: o.pane.workspace_id, key: o.pane.key })));const appTheme = useThemeValue();// The IDE's pane appearance: the reader's stored choice, else the app's theme.@@ -155,33 +181,42 @@ function IdeScreen() {const brand = PANE_BRAND[appearance], chrome = PANE_CHROME[appearance], ansi = themeFor(appearance);const vars = {"--pane-ink": brand.ink, "--pane-ink-muted": brand.inkMuted, "--pane-ink-faint": brand.inkFaint,- "--pane-chip": brand.chip, "--pane-rule": chrome.border, "--pane-edge": chrome.edge.live,+ "--pane-chip": brand.chip, "--pane-rule": chrome.border,"--pane-ground": PANE_SOLID[appearance], "--pane-caret": ansi.cursor ?? brand.ink,} as CSSProperties;const { cols, rows } = ideGrid(tiles.length);return (- <div className="office-ide-monitor" style={vars}>- <header className="office-ide-tabs">- {workspaces.map(([id, name]) => <span key={id} data-active={id === workspace || undefined}>{name}</span>)}- </header>+ <div className="office-ide-monitor jarvis-nav-surface" style={vars}>+ {/* The IDE's sidebar: every project folder with its workspaces, the front one highlighted. */}+ <aside className="office-ide-side">+ <div className="office-ide-side-title">{t("nav.agentic_ide")}</div>+ {tree.map((project) => (+ <div key={project.folder}>+ <div className="office-ide-project"><Folder aria-hidden />{project.name}</div>+ {project.workspaces.map((ws) => (+ <div key={ws.id} className="office-ide-ws" data-active={ws.id === workspace || undefined}>+ <i style={{ background: ws.working ? ansi.green : brand.inkFaint }} />+ <span>{ws.name}</span>+ <b>{ws.count}</b>+ </div>+ ))}+ </div>+ ))}+ </aside>{tiles.length === 0 ? (<p className="office-ide-empty">{t("society.office.mission_screen_none")}</p>) : (<div className="office-ide-grid" style={{ gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`, gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))` }}>{tiles.map((o) => {- const dot = o.dot === "working" ? ansi.green : o.dot === "waiting" ? ansi.yellow : o.dot === "error" ? ansi.red : brand.inkFaint;const key = `${o.pane.workspace_id}:${o.pane.key}`;- const title = o.pane.recap.trim() || o.pane.last_prompt.trim() || paneLabel(o.pane);+ const edge = EDGE[o.pane.status] ?? "live";return (- <article key={key} className="office-ide-tile">- <header className="office-pane-head">- <span className="office-pane-dot" style={{ background: dot }} />- <AgentMark agent={o.pane.agent} label={o.pane.display_name || o.pane.agent} variant="plain" size="sm"- className="!text-[color:var(--pane-ink)] [&>.bg-foreground]:!bg-[color:var(--pane-ink)]" />- <h2>{title}</h2>- <span className="office-pane-meta">{t(`society.office.pane_state_${o.stateKey}`)}</span>- </header>- <PaneScreenView screen={screens ? (screens.get(key) ?? null) : undefined} label={title}+ // The IDE's own pane: its header component, its edge colour, the live terminal under it.+ <article key={key} className="office-ide-tile" style={{ borderColor: chrome.edge[edge === "connecting" ? "live" : edge] }}>+ <WorkspaceTerminalHeader name={o.pane.name} workspaceId={o.pane.workspace_id} agent={o.pane.agent}+ displayName={o.pane.display_name || o.pane.agent} status={edge} appearance={appearance}+ onToggleMaximize={noop} onAdd={noop} onClose={noop} onFork={noop} />+ <PaneScreenView screen={screens ? (screens.get(key) ?? null) : undefined} label={paneLabel(o.pane)}loadingText={t("society.office.cmd_screen_loading")} emptyText={t("society.office.cmd_screen_empty")}className="office-pane-screen office-ide-screen" /></article>diff --git a/jarvis/ui/web/frontend/src/components/society/office/missionScreens.css b/jarvis/ui/web/frontend/src/components/society/office/missionScreens.cssindex e0048b7b9f..00ce91302e 100644--- a/jarvis/ui/web/frontend/src/components/society/office/missionScreens.css+++ b/jarvis/ui/web/frontend/src/components/society/office/missionScreens.css@@ -4,12 +4,19 @@.office-mission-screen { width:100%; height:100%; overflow:hidden; background:hsl(var(--background)); color:hsl(var(--foreground)); border-radius:6px; }.office-mission-screen > * { height:100%; }-.office-ide-monitor { display:flex; flex-direction:column; height:100%; background:var(--pane-ground); color:var(--pane-ink); }-.office-ide-tabs { display:flex; flex:none; align-items:center; gap:4px; height:38px; padding:0 10px; overflow:hidden; border-bottom:1px solid var(--pane-rule); }-.office-ide-tabs span { flex:none; max-width:220px; padding:4px 10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; border-radius:6px; font-size:13px; color:var(--pane-ink-muted); }-.office-ide-tabs span[data-active] { background:var(--pane-chip); color:var(--pane-ink); }-.office-ide-grid { display:grid; flex:1; min-height:0; gap:6px; padding:6px; }-.office-ide-tile { display:flex; flex-direction:column; min-width:0; min-height:0; overflow:hidden; border:1px solid var(--pane-edge); border-radius:8px; }-.office-ide-tile .office-pane-head h2 { flex:0 1 auto; min-width:0; margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:500; }+/* The Agentic IDE as the app draws it: the workspace sidebar on the app's own+ ground, then the panes side by side, each on the pane ground with its edge. */+.office-ide-monitor { display:flex; height:100%; color:hsl(var(--foreground)); }+.office-ide-side { flex:none; width:220px; padding:10px 8px; overflow:hidden; }+.office-ide-side-title { height:32px; padding:0 8px; font-size:14px; font-weight:600; line-height:32px; }+.office-ide-project { display:flex; align-items:center; gap:8px; margin-top:8px; padding:5px 8px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:13px; font-weight:500; }+.office-ide-project svg { flex:none; width:15px; height:15px; color:hsl(var(--muted-foreground)); }+.office-ide-ws { display:flex; align-items:center; gap:8px; margin-top:1px; padding:5px 8px 5px 22px; border-radius:6px; font-size:13px; color:hsl(var(--muted-foreground)); }+.office-ide-ws[data-active] { background:hsl(var(--muted)); color:hsl(var(--foreground)); }+.office-ide-ws i { flex:none; width:6px; height:6px; border-radius:50%; }+.office-ide-ws span { flex:1; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }+.office-ide-ws b { flex:none; font-size:12px; font-weight:400; color:hsl(var(--muted-foreground)); }+.office-ide-grid { display:grid; flex:1; min-width:0; min-height:0; gap:6px; padding:6px 6px 6px 0; }+.office-ide-tile { display:flex; flex-direction:column; min-width:0; min-height:0; overflow:hidden; border:1px solid var(--pane-rule); border-radius:8px; background:var(--pane-ground); color:var(--pane-ink); }.office-ide-screen { flex:1 1 auto; min-height:0; margin:0 10px 6px; cursor:inherit; }-.office-ide-empty { margin:auto; font-size:14px; color:var(--pane-ink-faint); }+.office-ide-empty { margin:auto; font-size:14px; color:hsl(var(--muted-foreground)); }diff --git a/jarvis/ui/web/frontend/src/components/society/office/missionScreens.test.ts b/jarvis/ui/web/frontend/src/components/society/office/missionScreens.test.tsindex 7cae5563d8..16bdfaee48 100644--- a/jarvis/ui/web/frontend/src/components/society/office/missionScreens.test.ts+++ b/jarvis/ui/web/frontend/src/components/society/office/missionScreens.test.ts@@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest";import type { SocietyAgent } from "../data";import type { PaneOccupant } from "./codingFloor";import { deskLive } from "./CommandOffice";-import { ideGrid, idePanes, pickShownAgent } from "./MissionScreens";+import { ideGrid, idePanes, ideTree, pickShownAgent } from "./MissionScreens";import { screenFillDistance } from "./OfficeCameraRig";import { useOfficeStore } from "./officeStore";@@ -30,18 +30,27 @@ describe("mission control desk monitors", () => {expect(idePanes([]).tiles).toEqual([]);});+ it("groups the IDE sidebar by project folder, then workspace", () => {+ const pane = (workspace: string, folder: string, state: "working" | "idle") =>+ ({ pane: { workspace_id: workspace, workspace_name: workspace, folder }, agent: { state } } as PaneOccupant);+ const tree = ideTree([pane("a", "/p/jarvis", "idle"), pane("a", "/p/jarvis", "working"), pane("b", "C:\\x\\web", "idle")]);+ expect(tree.map((p) => p.name)).toEqual(["jarvis", "web"]);+ expect(tree[0].workspaces).toEqual([{ id: "a", name: "a", count: 2, working: true }]);+ });+it("splits the IDE monitor like the IDE grid", () => {expect(ideGrid(1)).toEqual({ cols: 1, rows: 1 });expect(ideGrid(2)).toEqual({ cols: 2, rows: 1 });+ expect(ideGrid(3)).toEqual({ cols: 3, rows: 1 });expect(ideGrid(4)).toEqual({ cols: 2, rows: 2 });expect(ideGrid(6)).toEqual({ cols: 3, rows: 2 });});it("runs the live sections only near the desk, with no flicker at the edge", () => {- expect(deskLive(8, false)).toBe(true);- expect(deskLive(13, false)).toBe(false);- expect(deskLive(13, true)).toBe(true);- expect(deskLive(16, true)).toBe(false);+ expect(deskLive(20, false)).toBe(true);+ expect(deskLive(24, false)).toBe(false);+ expect(deskLive(24, true)).toBe(true);+ expect(deskLive(27, true)).toBe(false);});it("dives into a larger monitor from further back, so it still fills the view", () => {