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(office): show a coding session as an IDE pane on the map

rubenluetke10-beepe06b8607fe52
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
index 3733d7ebfd..f2fa09a6a1 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
@@ -44,7 +44,7 @@ import { PaneResizer } from "@/components/layout/PaneResizer";
import { useEventStore, type VoiceState } from "@/store/events";
import { AgenticTerminal, type SplitDirection } from "./AgenticTerminal";
import { AgentPickerMenu, offersAgentChoice, type SplitAgentChoice } from "./AgentPicker";
-import type { TerminalAppearance } from "./terminalThemes";
+import { TERMINAL_APPEARANCE_KEY, type TerminalAppearance } from "./terminalThemes";
import { installZoomKeyBridge, type ZoomIntent } from "./terminalZoom";
import {
FONT_DEFAULT,
@@ -488,7 +488,7 @@ function writePosition(node: HTMLElement, style: React.CSSProperties): void {
* working. Its localStorage entry stays as the first-paint cache so the panes
* open at the remembered size instead of visibly resizing a moment later.
*/
-const APPEARANCE_KEY = "jarvis.agenticIde.terminalAppearance";
+const APPEARANCE_KEY = TERMINAL_APPEARANCE_KEY;
/**
* The two ways of looking at one workspace.
diff --git a/jarvis/ui/web/frontend/src/components/agentic/terminalThemes.ts b/jarvis/ui/web/frontend/src/components/agentic/terminalThemes.ts
index def2fa71b7..16803bdeaf 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/terminalThemes.ts
+++ b/jarvis/ui/web/frontend/src/components/agentic/terminalThemes.ts
@@ -131,6 +131,20 @@ export function themeFor(appearance: TerminalAppearance): ITheme {
return appearance === "dark" ? DARK_TERMINAL_THEME : LIGHT_TERMINAL_THEME;
}
+/** Where the reader's pane appearance is kept; no entry means "follow the app". */
+export const TERMINAL_APPEARANCE_KEY = "jarvis.agenticIde.terminalAppearance";
+
+/** The stored pane appearance, or null when there is none (or storage is blocked). */
+export function storedTerminalAppearance(): TerminalAppearance | null {
+ try {
+ const raw = window.localStorage.getItem(TERMINAL_APPEARANCE_KEY);
+ return raw === "light" || raw === "dark" ? raw : null;
+ } catch {
+ // Private mode or disabled storage reads as "no preference", never as a failure.
+ return null;
+ }
+}
+
/**
* The lifecycle a pane's frame reports, mirroring `PaneStatus` in
* ./AgenticTerminal.
@@ -248,6 +262,15 @@ export const PANE_BRAND: Record<TerminalAppearance, PaneBrand> = {
},
};
+/**
+ * The pane's ground made near-opaque, for a pane floated over a busy scene
+ * (the office map) where the translucent `shell` would let the world through.
+ */
+export const PANE_SOLID: Record<TerminalAppearance, string> = {
+ light: "rgba(252, 251, 248, 0.94)",
+ dark: "rgba(18, 18, 18, 0.92)",
+};
+
export const PANE_CHROME: Record<TerminalAppearance, PaneChrome> = {
light: {
shell: "rgba(252, 251, 248, 0.68)",
diff --git a/jarvis/ui/web/frontend/src/components/society/office/PaneCommandPanel.tsx b/jarvis/ui/web/frontend/src/components/society/office/PaneCommandPanel.tsx
index 4601c0052b..3aa3c3f5ad 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/PaneCommandPanel.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/office/PaneCommandPanel.tsx
@@ -1,36 +1,35 @@
/**
- * A coding session on the coding floor, as a command panel: a small live
- * window onto its terminal, a box to prompt the agent directly, one-tap orders, the recent
- * prompts, and the session actions (open, stop, fork, close) next to the map
- * actions (walk there, call over, show).
+ * A coding session on the coding floor, shown as the pane it is: the Agentic
+ * IDE's title bar (state dot, agent mark, the pane's title, the pane actions as
+ * quiet icons) over the live terminal, with a prompt line at the bottom of the
+ * terminal to write into. Nothing else — no chips, no toolbar, no side notes.
*
- * Everything goes through the Agentic IDE's existing routes — the same
- * `/terminals/{name}/prompt` the spoken path uses — so a prompt sent here is
- * recorded, receipted and visible in the pane exactly like one typed there.
+ * Colours come from the pane's own appearance tables (./terminalThemes), so the
+ * panel matches the IDE's panes in light and dark, including a light pane in a
+ * dark app. Prompts go through the IDE's `/terminals/{name}/prompt` route, the
+ * same one the spoken path uses, so a prompt sent here is recorded, receipted
+ * and visible in the pane exactly like one typed there.
*/
-import { useCallback, useEffect, useId, useRef, useState } from "react";
-import { ArrowUp, Footprints, GitFork, Hand, LocateFixed, Maximize2, Square, Trash2 } from "lucide-react";
+import { useCallback, useEffect, useId, useRef, useState, type CSSProperties } from "react";
+import { Footprints, Hand, LocateFixed, Maximize2, Square, Trash2, X } from "lucide-react";
import { useT } from "@/i18n";
-import {
- closeTerminal, fetchPromptHistory, forkTerminal, interruptTerminal, promptTerminal, type PromptHistoryItem,
-} from "@/lib/agenticIdeApi";
+import { useThemeValue } from "@/hooks/useTheme";
+import { closeTerminal, forkTerminal, interruptTerminal, promptTerminal } from "@/lib/agenticIdeApi";
+import { usePaneTitle } from "@/store/paneRecaps";
import { useWorkspacePanesStore } from "@/store/workspacePanes";
+import { AgentMark } from "@/components/agentic/AgentMark";
+import { BranchIcon } from "@/components/agentic/branchIcon";
+import { PANE_BRAND, PANE_CHROME, PANE_SOLID, storedTerminalAppearance, themeFor } from "@/components/agentic/terminalThemes";
import type { PaneOccupant } from "./codingFloor";
import { player, useOfficeStore } from "./officeStore";
import { agentPositions } from "./walkerRegistry";
import { CALL_MS } from "./AgentTalkPanel";
import { PaneLiveScreen } from "./PaneLiveScreen";
-import "./officeTalk.css";
-import "./missionControl.css";
+import "./paneCommand.css";
-/** Recent prompts offered for re-use. */
-const HISTORY_ITEMS = 4;
/** A second press within this window confirms closing the session. */
const CONFIRM_MS = 4000;
-/** One-tap orders; the label is the chip, the text is what the agent receives. */
-export const QUICK_ORDERS = ["continue", "status", "tests", "commit"] as const;
-
function sinceLabel(at: number | null, t: (key: string) => string): string {
if (!at) return "";
const seconds = Math.max(0, Date.now() / 1000 - at);
@@ -50,17 +49,22 @@ export function PaneCommandPanel({ occupant, onOpen, onClose }: { occupant: Pane
const panel = useRef<HTMLElement>(null);
const input = useRef<HTMLTextAreaElement>(null);
const [value, setValue] = useState("");
- const [sharpen, setSharpen] = useState(false);
const [sending, setSending] = useState(false);
const [note, setNote] = useState<Note>(null);
const [confirmClose, setConfirmClose] = useState(false);
- const [history, setHistory] = useState<PromptHistoryItem[]>([]);
+ const appTheme = useThemeValue();
+ // The IDE's pane appearance: the reader's stored choice, else the app's theme.
+ const appearance = storedTerminalAppearance() ?? appTheme;
+ const brand = PANE_BRAND[appearance];
+ const chrome = PANE_CHROME[appearance];
+ const ansi = themeFor(appearance);
+ const paneTitle = usePaneTitle(pane.workspace_id, pane.name);
const where = agentPositions.get(agent.agentId);
const live = pane.status === "live";
const canPrompt = live && pane.accepts_prompts;
const working = occupant.dot === "working";
const since = sinceLabel(pane.activity_since || null, t);
- const recap = pane.recap.trim();
+ const title = paneTitle || pane.recap.trim() || agent.name;
useEffect(() => { panel.current?.focus({ preventScroll: true }); setValue(""); setNote(null); setConfirmClose(false); }, [agent.agentId]);
useEffect(() => {
@@ -69,13 +73,6 @@ export function PaneCommandPanel({ occupant, onOpen, onClose }: { occupant: Pane
return () => clearTimeout(timer);
}, [confirmClose]);
- const loadHistory = useCallback(() => {
- fetchPromptHistory(pane.name, pane.workspace_id)
- .then((res) => setHistory(res.items.slice(0, HISTORY_ITEMS)))
- .catch((err) => console.warn("Prompt history unavailable", err));
- }, [pane.name, pane.workspace_id]);
- useEffect(() => { loadHistory(); }, [loadHistory]);
-
const refresh = () => { void useWorkspacePanesStore.getState().load(); };
const send = useCallback(async (text: string) => {
@@ -84,19 +81,18 @@ export function PaneCommandPanel({ occupant, onOpen, onClose }: { occupant: Pane
setSending(true);
setNote(null);
try {
- const result = await promptTerminal(pane.name, content, { compose: sharpen, workspaceId: pane.workspace_id });
+ const result = await promptTerminal(pane.name, content, { workspaceId: pane.workspace_id });
setValue("");
setNote(result.submitted === true
? { tone: "ok", text: t("society.office.cmd_sent").replace("{0}", agent.name) }
: { tone: "error", text: result.detail || t("society.office.cmd_unconfirmed") });
- loadHistory();
refresh();
} catch (err) {
setNote({ tone: "error", text: err instanceof Error ? err.message : String(err) });
} finally {
setSending(false);
}
- }, [agent.name, canPrompt, loadHistory, pane.name, pane.workspace_id, sending, sharpen, t]);
+ }, [agent.name, canPrompt, pane.name, pane.workspace_id, sending, t]);
/** Run one session action; it answers with the line the panel shows once it is done. */
const run = async (action: () => Promise<string>) => {
@@ -126,107 +122,94 @@ export function PaneCommandPanel({ occupant, onOpen, onClose }: { occupant: Pane
});
};
- const status = !pane.accepts_prompts
+ const dot = occupant.dot === "working" ? ansi.green
+ : occupant.dot === "waiting" ? ansi.yellow
+ : occupant.dot === "error" ? ansi.red : brand.inkFaint;
+ const edge = occupant.dot === "error" ? chrome.edge.error : live ? chrome.edge.live : chrome.edge.exited;
+ 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": edge,
+ "--pane-ground": PANE_SOLID[appearance],
+ "--pane-float": chrome.float,
+ "--pane-ok": ansi.green,
+ "--pane-fault": ansi.red,
+ "--pane-caret": ansi.cursor ?? brand.ink,
+ } as CSSProperties;
+
+ const hint = !pane.accepts_prompts
? t("society.office.cmd_no_prompts")
: !live ? t("society.office.cmd_not_running") : t("society.office.cmd_hint");
return (
- <aside ref={panel} className="office-card office-panel office-talk office-cmd" data-office-ui aria-labelledby={headingId} tabIndex={-1}>
- <header className="office-talk-head">
- <span className="office-talk-avatar" style={{ background: agent.palette.primary }} aria-hidden>
- {agent.name.slice(0, 1).toUpperCase()}
+ <aside ref={panel} className="office-panel office-pane" data-office-ui style={vars} aria-labelledby={headingId} tabIndex={-1}>
+ <header className="office-pane-head">
+ <span className="office-pane-dot" style={{ background: dot }} role="img"
+ aria-label={t(`society.office.pane_state_${occupant.stateKey}`)} />
+ <AgentMark agent={pane.agent} label={pane.display_name || pane.agent} variant="plain" size="sm"
+ className="!text-[color:var(--pane-ink)] [&>.bg-foreground]:!bg-[color:var(--pane-ink)]" />
+ <h2 id={headingId} title={`${title} (${pane.name})`}>{title}</h2>
+ <span className="office-pane-meta">
+ {t(`society.office.pane_state_${occupant.stateKey}`)}{since ? ` · ${since}` : ""}
</span>
- <div className="office-talk-who">
- <h2 id={headingId}>{agent.name}</h2>
- <span>
- <i className="office-dot" data-state={agent.state} data-dot={occupant.dot} aria-hidden />
- {t(`society.office.pane_state_${occupant.stateKey}`)}{since ? ` · ${since}` : ""} · {pane.display_name || pane.agent} · {agent.providerLabel}
- </span>
- </div>
- <button type="button" className="office-icon-button" onClick={onClose} aria-label={t("society.office.close")}>×</button>
- </header>
-
- <div className="office-cmd-body">
- <PaneLiveScreen workspaceId={pane.workspace_id} paneKey={pane.key} title={pane.display_name || pane.name}
- dot={occupant.dot} stateLabel={t(`society.office.pane_state_${occupant.stateKey}`)} agentName={agent.name} onOpen={onOpen} />
-
- <div className="office-cmd-side">
- {recap && <p className="office-cmd-topic" title={recap}><strong>{t("society.office.pane_recap")}</strong> {recap}</p>}
-
- <div className="office-cmd-quick" role="group" aria-label={t("society.office.cmd_quick")}>
- {QUICK_ORDERS.map((order) => (
- <button key={order} type="button" disabled={!canPrompt || sending} title={t(`society.office.cmd_order_${order}_text`)}
- onClick={() => void send(t(`society.office.cmd_order_${order}_text`))}>
- {t(`society.office.cmd_order_${order}`)}
- </button>
- ))}
- </div>
-
- <div className="office-talk-composer">
- <textarea ref={input} rows={1} value={value} maxLength={8000} disabled={!canPrompt}
- placeholder={t("society.office.cmd_placeholder").replace("{0}", agent.name)}
- aria-label={t("society.office.cmd_placeholder").replace("{0}", agent.name)}
- onChange={(e) => setValue(e.target.value)}
- onKeyDown={(e) => {
- if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); void send(value); }
- // Escape leaves the box so the arrow keys walk again; a second Escape closes the panel.
- else if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); panel.current?.focus({ preventScroll: true }); }
- }} />
- {working && !value.trim()
- ? <button type="button" className="office-talk-send" data-stop onClick={stop}
- aria-label={t("society.office.cmd_stop")} title={t("society.office.cmd_stop")}><Square aria-hidden /></button>
- : <button type="button" className="office-talk-send" disabled={!canPrompt || sending || !value.trim()} onClick={() => void send(value)}
- aria-label={t("society.office.cmd_send")} title={t("society.office.cmd_send")}><ArrowUp aria-hidden /></button>}
- </div>
- <div className="office-cmd-row">
- <label className="office-cmd-check">
- <input type="checkbox" checked={sharpen} onChange={(e) => setSharpen(e.target.checked)} />
- <span>{t("society.office.cmd_sharpen")}</span>
- </label>
- <span className="office-talk-status" role="status" data-tone={note?.tone}>{sending ? t("society.office.cmd_sending") : note?.text ?? status}</span>
- </div>
-
- {history.length > 0 && (
- <details className="office-cmd-history">
- <summary>{t("society.office.cmd_history").replace("{0}", String(history.length))}</summary>
- <ul>
- {history.map((item) => (
- <li key={item.id}>
- <button type="button" title={t("society.office.cmd_reuse")} onClick={() => { setValue(item.text); input.current?.focus(); }}>
- {item.text}
- </button>
- </li>
- ))}
- </ul>
- </details>
+ <div className="office-pane-actions" role="toolbar" aria-label={t("society.office.talk_tools")}>
+ {working && live && (
+ <button type="button" onClick={stop} title={t("society.office.cmd_stop")} aria-label={t("society.office.cmd_stop")}>
+ <Square aria-hidden />
+ </button>
)}
+ <button type="button" disabled={!live} onClick={fork} title={t("society.office.cmd_fork")} aria-label={t("society.office.cmd_fork")}>
+ <BranchIcon aria-hidden />
+ </button>
+ <button type="button" disabled={!where} onClick={() => where && office.requestWalk(where)}
+ title={t("society.office.action_walk")} aria-label={t("society.office.action_walk")}>
+ <Footprints aria-hidden />
+ </button>
+ <button type="button" onClick={() => office.summon([agent.agentId], { x: player.x, z: player.z }, CALL_MS)}
+ title={t("society.office.action_call")} aria-label={t("society.office.action_call")}>
+ <Hand aria-hidden />
+ </button>
+ <button type="button" disabled={!where} onClick={() => where && office.focusOn(where)}
+ title={t("society.office.action_focus")} aria-label={t("society.office.action_focus")}>
+ <LocateFixed aria-hidden />
+ </button>
+ <button type="button" onClick={onOpen} title={t("society.office.pane_open")} aria-label={t("society.office.pane_open")}>
+ <Maximize2 aria-hidden />
+ </button>
+ <button type="button" data-danger aria-pressed={confirmClose} onClick={close}
+ title={t(confirmClose ? "society.office.cmd_close_confirm" : "society.office.cmd_close")}
+ aria-label={t(confirmClose ? "society.office.cmd_close_confirm" : "society.office.cmd_close")}>
+ <Trash2 aria-hidden />
+ </button>
+ <span className="office-pane-sep" aria-hidden />
+ <button type="button" onClick={onClose} title={t("society.office.close")} aria-label={t("society.office.close")}>
+ <X aria-hidden />
+ </button>
</div>
- </div>
+ </header>
- <div className="office-talk-tools office-cmd-tools" role="toolbar" aria-label={t("society.office.talk_tools")}>
- <button type="button" onClick={onOpen} title={t("society.office.pane_open")}>
- <Maximize2 aria-hidden /><span>{t("society.office.tool_open")}</span>
- </button>
- <button type="button" disabled={!live || !working} onClick={stop} title={t("society.office.cmd_stop")}>
- <Square aria-hidden /><span>{t("society.office.tool_stop")}</span>
- </button>
- <button type="button" disabled={!live} onClick={fork} title={t("society.office.cmd_fork")}>
- <GitFork aria-hidden /><span>{t("society.office.tool_fork")}</span>
- </button>
- <button type="button" disabled={!where} onClick={() => where && office.requestWalk(where)} title={t("society.office.action_walk")}>
- <Footprints aria-hidden /><span>{t("society.office.tool_walk")}</span>
- </button>
- <button type="button" onClick={() => office.summon([agent.agentId], { x: player.x, z: player.z }, CALL_MS)} title={t("society.office.action_call")}>
- <Hand aria-hidden /><span>{t("society.office.tool_call")}</span>
- </button>
- <button type="button" disabled={!where} onClick={() => where && office.focusOn(where)} title={t("society.office.action_focus")}>
- <LocateFixed aria-hidden /><span>{t("society.office.tool_focus")}</span>
- </button>
- <button type="button" data-danger aria-pressed={confirmClose} onClick={close}
- title={t(confirmClose ? "society.office.cmd_close_confirm" : "society.office.cmd_close")}>
- <Trash2 aria-hidden /><span>{t(confirmClose ? "society.office.tool_close_confirm" : "society.office.tool_close")}</span>
- </button>
+ <PaneLiveScreen workspaceId={pane.workspace_id} paneKey={pane.key} onOpen={onOpen}
+ label={t("society.office.cmd_screen").replace("{0}", agent.name)}
+ loadingText={t("society.office.cmd_screen_loading")} emptyText={t("society.office.cmd_screen_empty")} />
+
+ <div className="office-pane-prompt" data-disabled={!canPrompt || undefined} onClick={() => input.current?.focus()}>
+ <span className="office-pane-caret" aria-hidden>❯</span>
+ <textarea ref={input} rows={1} value={value} maxLength={8000} disabled={!canPrompt}
+ placeholder={t("society.office.cmd_placeholder").replace("{0}", agent.name)}
+ aria-label={t("society.office.cmd_placeholder").replace("{0}", agent.name)}
+ onChange={(e) => setValue(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); void send(value); }
+ // Escape leaves the box so the arrow keys walk again; a second Escape closes the panel.
+ else if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); panel.current?.focus({ preventScroll: true }); }
+ }} />
</div>
+ <p className="office-pane-status" role="status" data-tone={note?.tone}>
+ {sending ? t("society.office.cmd_sending") : note?.text ?? hint}
+ </p>
</aside>
);
}
diff --git a/jarvis/ui/web/frontend/src/components/society/office/PaneLiveScreen.tsx b/jarvis/ui/web/frontend/src/components/society/office/PaneLiveScreen.tsx
index 067d24f341..85b753bd85 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/PaneLiveScreen.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/office/PaneLiveScreen.tsx
@@ -1,30 +1,29 @@
/**
- * A small live window onto one coding session's terminal, for the session's
- * command panel: a title bar with the run state and a "Live" beat, and below
- * it the bottom of the real screen, cursor included, with the font fitted to
- * the pane's own column count so a narrow TUI fills the window instead of
- * hugging its left edge.
+ * The live terminal of one coding session, drawn the way the Agentic IDE
+ * draws a pane: the pane's own font, weight and ink, the bottom of the real
+ * screen with its cursor, and the font fitted to the pane's column count so a
+ * narrow TUI fills the window instead of hugging its left edge.
*
* It reads the same in-memory screen feed as the desk monitors, at their
* near-live rate, jittered (AP-33); an unchanged screen never re-renders.
*/
import { useEffect, useLayoutEffect, useRef, useState, type RefObject } from "react";
-import { Maximize2 } from "lucide-react";
-import { useT } from "@/i18n";
import { fetchPaneScreens, type PaneScreen } from "@/lib/paneScreensApi";
+import { TERMINAL_FONT_STACK, TERMINAL_FONT_WEIGHT } from "@/lib/terminalFont";
import { screenChanged, visibleRows } from "./terminalScreen";
const POLL_MIN_MS = 450;
const POLL_JITTER_MS = 250;
/** Font bounds in CSS pixels: a wide TUI shrinks the text, a narrow one never blows it up. */
-const MIN_FONT = 10, MAX_FONT = 14;
+const MIN_FONT = 10, MAX_FONT = 15;
/** Wider terminals than this are cut on the right rather than shrunk further. */
const MAX_FIT_COLS = 120;
/** A monospace glyph is about this wide per pixel of font size. */
const CHAR_RATIO = 0.6;
-const LINE_RATIO = 1.3;
-/** Inner padding of the screen, matching `.office-live-body` in the CSS. */
-const PAD = 10;
+/** The panes draw at line height 1.0; a touch more keeps the small window airy. */
+const LINE_RATIO = 1.15;
+/** Horizontal padding of the screen, matching `.office-pane-screen` in the CSS. */
+const PAD = 12;
export interface LiveGrid { font: number; lineH: number; cols: number; fit: number }
@@ -38,7 +37,7 @@ export function liveGrid(cols: number, width: number, height: number): LiveGrid
font,
lineH,
cols: Math.max(1, Math.floor(inner / (font * CHAR_RATIO))),
- fit: Math.max(1, Math.floor((height - 2 * PAD) / lineH)),
+ fit: Math.max(1, Math.floor(height / lineH)),
};
}
@@ -87,62 +86,45 @@ function useBoxSize(ref: RefObject<HTMLElement | null>): { width: number; height
return size;
}
-export function PaneLiveScreen({ workspaceId, paneKey, title, dot, stateLabel, agentName, onOpen }: {
+export function PaneLiveScreen({ workspaceId, paneKey, label, loadingText, emptyText, onOpen }: {
workspaceId: string;
paneKey: string;
- title: string;
- /** The IDE's dot reading of the pane: working / waiting / idle / error. */
- dot: string;
- stateLabel: string;
- agentName: string;
+ label: string;
+ loadingText: string;
+ emptyText: string;
onOpen: () => void;
}) {
- const t = useT();
- const body = useRef<HTMLDivElement>(null);
+ const box = useRef<HTMLDivElement>(null);
const screen = useLiveScreen(workspaceId, paneKey);
- const { width, height } = useBoxSize(body);
+ const { width, height } = useBoxSize(box);
const grid = liveGrid(screen?.cols ?? 80, width, height);
const view = screen ? visibleRows(screen.lines, grid.fit, screen.cursor) : null;
const cursor = screen?.cursor && view ? [screen.cursor[0] - view.first, screen.cursor[1]] as const : null;
- const working = dot === "working";
const empty = !view || view.rows.every((row) => !row.trim());
return (
- <section className="office-live" data-dot={dot} aria-label={t("society.office.cmd_screen").replace("{0}", agentName)}>
- <header className="office-live-bar">
- <i className="office-dot" data-dot={dot} aria-hidden />
- <span className="office-live-title" title={title}>{title}</span>
- <span className="office-live-state">{stateLabel}</span>
- {working && <span className="office-live-beat">{t("society.office.cmd_live")}</span>}
- {screen && <span className="office-live-size">{screen.cols}×{screen.rows}</span>}
- <button type="button" className="office-live-open" onClick={onOpen}
- title={t("society.office.cmd_screen_open")} aria-label={t("society.office.cmd_screen_open")}>
- <Maximize2 aria-hidden />
- </button>
- </header>
- <div ref={body} className="office-live-body" onDoubleClick={onOpen}>
- {empty ? (
- <p className="office-live-empty">
- {screen === undefined ? t("society.office.cmd_screen_loading") : t("society.office.cmd_screen_empty")}
- </p>
- ) : (
- <pre className="office-live-rows" aria-live="off" style={{ fontSize: grid.font, lineHeight: `${grid.lineH}px` }}>
- {view!.rows.map((row, i) => {
- const line = row.length > grid.cols ? `${row.slice(0, grid.cols - 1)}…` : row;
- if (!cursor || cursor[0] !== i || cursor[1] >= grid.cols) return <div key={i}>{line || " "}</div>;
- const col = cursor[1];
- const padded = line.padEnd(col + 1, " ");
- return (
- <div key={i}>
- {padded.slice(0, col)}
- <span className="office-live-cursor">{padded[col]}</span>
- {padded.slice(col + 1)}
- </div>
- );
- })}
- </pre>
- )}
- </div>
- </section>
+ <div ref={box} className="office-pane-screen" role="img" aria-label={label} onDoubleClick={onOpen}>
+ {empty ? (
+ <p className="office-pane-empty">{screen === undefined ? loadingText : emptyText}</p>
+ ) : (
+ <pre aria-hidden style={{
+ fontFamily: TERMINAL_FONT_STACK, fontWeight: TERMINAL_FONT_WEIGHT, fontSize: grid.font, lineHeight: `${grid.lineH}px`,
+ }}>
+ {view!.rows.map((row, i) => {
+ const line = row.length > grid.cols ? `${row.slice(0, grid.cols - 1)}…` : row;
+ if (!cursor || cursor[0] !== i || cursor[1] >= grid.cols) return <div key={i}>{line || " "}</div>;
+ const col = cursor[1];
+ const padded = line.padEnd(col + 1, " ");
+ return (
+ <div key={i}>
+ {padded.slice(0, col)}
+ <span className="office-pane-cursor">{padded[col]}</span>
+ {padded.slice(col + 1)}
+ </div>
+ );
+ })}
+ </pre>
+ )}
+ </div>
);
}
diff --git a/jarvis/ui/web/frontend/src/components/society/office/missionControl.css b/jarvis/ui/web/frontend/src/components/society/office/missionControl.css
index 40e1ddffd8..e3324521f4 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/missionControl.css
+++ b/jarvis/ui/web/frontend/src/components/society/office/missionControl.css
@@ -1,68 +1,16 @@
/* Coding floor command surfaces: the session command panel and Mission Control.
Theme tokens only, so both read in light and dark mode. */
-/* ---- session command panel -------------------------------------------- */
-.office-cmd-topic { margin:8px 12px 0; font-size:12px; line-height:1.4; color:hsl(var(--muted-foreground)); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
-.office-cmd-topic strong { color:hsl(var(--foreground)); font-weight:600; margin-right:4px; }
-/* The panel reads as one terminal window with its controls beside it: wide
- (the compact office stretches the panel across the view) puts the live
- window left and the controls right; narrow stacks them. */
-.office-panel-slot:has(> .office-cmd) { width:min(480px, calc(100% - 28px)); }
-.office-stage-compact .office-panel-slot:has(> .office-cmd) { width:calc(100% - 16px); }
-.office-cmd { container-type:inline-size; }
-.office-cmd-body { display:flex; flex-direction:column; min-height:0; overflow:auto; }
-.office-cmd-side { display:flex; flex-direction:column; min-width:0; }
-.office-live { display:flex; flex-direction:column; margin:10px 10px 0; min-height:0; border:1px solid hsl(var(--border-strong, var(--border))); border-radius:10px; overflow:hidden; background:hsl(var(--muted)); }
-.office-live[data-dot="working"] { border-color:hsl(var(--success) / .55); box-shadow:0 0 0 1px hsl(var(--success) / .15); }
-.office-live[data-dot="waiting"] { border-color:hsl(var(--warning) / .6); }
-.office-live-bar .office-dot[data-dot="working"] { background:hsl(var(--success)); }
-.office-live-bar .office-dot[data-dot="waiting"] { background:hsl(var(--warning)); }
-.office-live[data-dot="error"] { border-color:hsl(var(--destructive) / .55); }
-.office-live-bar { display:flex; align-items:center; gap:7px; min-width:0; padding:5px 6px 5px 10px; border-bottom:1px solid hsl(var(--border)); background:hsl(var(--secondary)); font-size:11px; color:hsl(var(--muted-foreground)); }
-.office-live-title { flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; color:hsl(var(--foreground)); }
-.office-live-state { flex:none; white-space:nowrap; }
-.office-live-beat { flex:none; display:inline-flex; align-items:center; gap:4px; padding:1px 6px; border-radius:6px; background:hsl(var(--success) / .14); color:hsl(var(--success)); font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
-.office-live-beat::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; animation:office-live-beat 1.4s ease-in-out infinite; }
-@keyframes office-live-beat { 50% { opacity:.25; } }
-.office-live-size { flex:none; margin-left:auto; font:10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; opacity:.8; }
-.office-live-open { flex:none; display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; margin-left:auto; border:0; border-radius:6px; background:none; color:hsl(var(--muted-foreground)); cursor:pointer; }
-.office-live-size + .office-live-open { margin-left:2px; }
-.office-live-open svg { width:14px; height:14px; }
-.office-live-open:hover { background:hsl(var(--background)); color:hsl(var(--foreground)); }
-.office-live-open:focus-visible { outline:2px solid hsl(var(--ring)); outline-offset:1px; }
-/* Fixed height, rows absolutely placed: the grid is fitted to this box, so the
- text can never feed back into its size. */
-.office-live-body { position:relative; height:clamp(150px, 26vh, 240px); cursor:zoom-in; }
-.office-live-rows { position:absolute; inset:10px; margin:0; overflow:hidden; display:flex; flex-direction:column; justify-content:flex-end; color:hsl(var(--foreground)); font-family:ui-monospace, 'Cascadia Mono', SFMono-Regular, Menlo, Consolas, monospace; white-space:pre; text-shadow:none; }
-.office-live-rows > div { overflow:hidden; }
-.office-live-cursor { background:hsl(var(--foreground) / .85); color:hsl(var(--muted)); }
-.office-live-empty { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; margin:0; font-size:12px; color:hsl(var(--muted-foreground)); }
-@container (min-width:720px) {
- .office-cmd-body { display:grid; grid-template-columns:minmax(0, 1.6fr) minmax(300px, 1fr); align-items:stretch; }
- .office-cmd-body > .office-live { margin:10px 0 0 10px; }
- .office-cmd-body .office-live-body { height:auto; flex:1 1 auto; min-height:220px; }
- .office-cmd-side { justify-content:flex-end; padding-bottom:2px; }
-}
-@media (prefers-reduced-motion:reduce) { .office-live-beat::before { animation:none; } }
-.office-cmd-quick { display:flex; flex-wrap:wrap; gap:5px; margin:8px 10px; }
-.office-cmd-quick button, .office-mc-chips button { padding:4px 10px; border:1px solid hsl(var(--border)); border-radius:999px; background:hsl(var(--background)); color:hsl(var(--foreground)); font-size:11px; font-weight:600; cursor:pointer; }
-.office-cmd-quick button:hover:not(:disabled), .office-mc-chips button:hover:not(:disabled) { background:hsl(var(--secondary)); }
-.office-cmd-quick button:disabled, .office-mc-chips button:disabled { opacity:.45; cursor:not-allowed; }
+/* ---- shared ----------------------------------------------------------- */
+.office-mc-chips button { padding:4px 10px; border:1px solid hsl(var(--border)); border-radius:999px; background:hsl(var(--background)); color:hsl(var(--foreground)); font-size:11px; font-weight:600; cursor:pointer; }
+.office-mc-chips button:hover:not(:disabled) { background:hsl(var(--secondary)); }
+.office-mc-chips button:disabled { opacity:.45; cursor:not-allowed; }
.office-mc-chips button[aria-pressed="true"] { border-color:hsl(var(--primary)); background:hsl(var(--primary)); color:hsl(var(--primary-foreground)); text-shadow:none; }
-.office-cmd-quick button:focus-visible, .office-mc-chips button:focus-visible, .office-mc-tabs button:focus-visible { outline:2px solid hsl(var(--ring)); outline-offset:2px; }
-.office-cmd-row { display:flex; align-items:center; gap:8px; margin:5px 12px 0; min-width:0; }
-.office-cmd-row .office-talk-status { flex:1; margin:0; text-align:right; }
+.office-mc-chips button:focus-visible, .office-mc-tabs button:focus-visible { outline:2px solid hsl(var(--ring)); outline-offset:2px; }
.office-talk-status[data-tone="ok"] { color:hsl(var(--success)); }
.office-talk-status[data-tone="error"] { color:hsl(var(--destructive)); white-space:normal; }
.office-cmd-check { display:inline-flex; align-items:center; gap:6px; flex:none; font-size:11px; color:hsl(var(--muted-foreground)); cursor:pointer; }
.office-cmd-check input { accent-color:hsl(var(--primary)); }
-.office-cmd-history { margin:8px 12px 0; font-size:12px; }
-.office-cmd-history summary { cursor:pointer; color:hsl(var(--muted-foreground)); font-weight:600; }
-.office-cmd-history ul { list-style:none; margin:6px 0 0; padding:0; display:flex; flex-direction:column; gap:4px; }
-.office-cmd-history button { width:100%; padding:5px 8px; border:0; border-radius:8px; background:hsl(var(--secondary)); color:hsl(var(--foreground)); font:inherit; font-size:11px; text-align:left; cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
-.office-cmd-history button:hover { background:hsl(var(--secondary) / .7); }
-.office-cmd-tools { grid-template-columns:repeat(7, 1fr); }
-.office-cmd-tools button[data-danger]:hover:not(:disabled), .office-cmd-tools button[data-danger][aria-pressed="true"] { color:hsl(var(--destructive)); background:hsl(var(--destructive) / .1); }
/* ---- Mission Control -------------------------------------------------- */
/* Quiet and typographic: sentence-case headings, hairline dividers, one filled
diff --git a/jarvis/ui/web/frontend/src/components/society/office/missionControl.test.ts b/jarvis/ui/web/frontend/src/components/society/office/missionControl.test.ts
index 57e7727d8c..1e08b6591b 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/missionControl.test.ts
+++ b/jarvis/ui/web/frontend/src/components/society/office/missionControl.test.ts
@@ -2,7 +2,6 @@ import { describe, expect, it } from "vitest";
import type { AgentStatus } from "@/lib/agenticIdeApi";
import type { PaneOccupant } from "./codingFloor";
import { launchableAgents, pickAll } from "./MissionControlPanel";
-import { QUICK_ORDERS } from "./PaneCommandPanel";
import { liveGrid } from "./PaneLiveScreen";
const cli = (name: string, extra: Partial<AgentStatus> = {}): AgentStatus => ({
@@ -12,22 +11,19 @@ const cli = (name: string, extra: Partial<AgentStatus> = {}): AgentStatus => ({
const occupant = (id: string, state: PaneOccupant["agent"]["state"]): PaneOccupant =>
({ agent: { agentId: id, state } } as PaneOccupant);
-describe("pane command panel", () => {
+describe("pane live screen", () => {
it("fits the live window's font to the pane's width, within bounds", () => {
// A narrow 40-column TUI in a wide window grows to the cap instead of hugging the left edge.
- expect(liveGrid(40, 900, 240).font).toBe(14);
+ expect(liveGrid(40, 900, 240).font).toBe(15);
// A wide 200-column terminal shrinks to the floor and is cut on the right.
const wide = liveGrid(200, 500, 240);
expect(wide.font).toBe(10);
- expect(wide.cols).toBe(80);
+ expect(wide.cols).toBe(79);
// As many rows as the height holds, never zero.
- expect(liveGrid(80, 600, 240).fit).toBe(Math.floor(220 / Math.round(liveGrid(80, 600, 240).font * 1.3)));
+ expect(liveGrid(80, 600, 240).fit).toBe(Math.floor(240 / Math.round(liveGrid(80, 600, 240).font * 1.15)));
expect(liveGrid(80, 0, 0).fit).toBe(1);
});
- it("offers the four one-tap orders", () => {
- expect(QUICK_ORDERS).toEqual(["continue", "status", "tests", "commit"]);
- });
});
describe("mission control", () => {
diff --git a/jarvis/ui/web/frontend/src/components/society/office/paneCommand.css b/jarvis/ui/web/frontend/src/components/society/office/paneCommand.css
new file mode 100644
index 0000000000..ca2d64f875
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/society/office/paneCommand.css
@@ -0,0 +1,39 @@
+/* A coding session's panel on the office map, drawn as an Agentic IDE pane:
+ 36 px title bar, the live terminal, a prompt line inside the terminal.
+ Every colour is a --pane-* variable the component sets from the pane
+ appearance tables (terminalThemes.ts), so it follows light and dark panes. */
+.office-panel-slot:has(> .office-pane) { width:min(560px, calc(100% - 28px)); }
+.office-stage-compact .office-panel-slot:has(> .office-pane) { width:calc(100% - 16px); }
+
+.office-pane { border:1px solid var(--pane-edge); border-radius:10px; background:var(--pane-ground); color:var(--pane-ink); box-shadow:0 10px 32px rgb(0 0 0 / .28); backdrop-filter:blur(14px); }
+
+.office-pane-head { display:flex; align-items:center; gap:8px; height:36px; min-height:36px; padding:0 4px 0 10px; border-bottom:1px solid var(--pane-rule); }
+.office-pane-dot { flex:none; width:6px; height:6px; border-radius:50%; }
+.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; color:var(--pane-ink); }
+.office-pane-meta { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:var(--pane-ink-muted); }
+.office-pane-actions { display:flex; flex:none; align-items:center; gap:1px; }
+.office-pane-actions button { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; padding:0; border:0; border-radius:6px; background:none; color:var(--pane-ink-muted); cursor:pointer; }
+.office-pane-actions button svg { width:15px; height:15px; }
+.office-pane-actions button:hover:not(:disabled) { background:var(--pane-chip); color:var(--pane-ink); }
+.office-pane-actions button:focus-visible { outline:1px solid var(--pane-ink); outline-offset:-1px; }
+.office-pane-actions button:disabled { opacity:.35; cursor:default; }
+.office-pane-actions button[data-danger]:hover:not(:disabled), .office-pane-actions button[data-danger][aria-pressed="true"] { color:var(--pane-fault); }
+.office-pane-actions button[data-danger][aria-pressed="true"] { background:var(--pane-chip); }
+.office-pane-sep { width:1px; height:16px; margin:0 3px; background:var(--pane-rule); }
+
+/* Fixed height, rows absolutely placed: the grid is fitted to this box, so the
+ text can never feed back into its size. */
+.office-pane-screen { position:relative; flex:1 1 clamp(200px, 38vh, 420px); min-height:110px; margin:0 12px; cursor:zoom-in; }
+.office-pane-screen pre { position:absolute; inset:8px 0 0; margin:0; overflow:hidden; display:flex; flex-direction:column; justify-content:flex-end; color:var(--pane-ink); white-space:pre; text-shadow:none; font-variant-ligatures:none; }
+.office-pane-screen pre > div { overflow:hidden; }
+.office-pane-cursor { background:var(--pane-caret); color:var(--pane-ground); }
+.office-pane-empty { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; margin:0; font-size:12px; color:var(--pane-ink-faint); }
+
+.office-pane-prompt { display:flex; align-items:flex-start; gap:8px; margin:6px 12px 0; padding:9px 0 4px; border-top:1px solid var(--pane-rule); cursor:text; }
+.office-pane-prompt[data-disabled] { cursor:default; opacity:.6; }
+.office-pane-caret { flex:none; font:600 14px/20px ui-monospace, 'Cascadia Mono', SFMono-Regular, Menlo, Consolas, monospace; color:var(--pane-ok); }
+.office-pane-prompt textarea { flex:1; min-width:0; min-height:20px; max-height:120px; margin:0; padding:0; border:0; outline:none; resize:none; background:transparent; color:var(--pane-ink); caret-color:var(--pane-caret); font:500 13px/20px ui-monospace, 'Cascadia Mono', SFMono-Regular, Menlo, Consolas, monospace; field-sizing:content; }
+.office-pane-prompt textarea::placeholder { color:var(--pane-ink-faint); }
+.office-pane-status { margin:0; padding:2px 12px 8px 30px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:var(--pane-ink-faint); }
+.office-pane-status[data-tone="ok"] { color:var(--pane-ok); }
+.office-pane-status[data-tone="error"] { color:var(--pane-fault); white-space:normal; }