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(ui): a mission deck as the front page, with the classic chat one click away

Haraldaed79976f9e1
diff --git a/jarvis/ui/web/frontend/src/components/layout/MainView.detached.test.tsx b/jarvis/ui/web/frontend/src/components/layout/MainView.detached.test.tsx
index 3d25124c97..0030aa8851 100644
--- a/jarvis/ui/web/frontend/src/components/layout/MainView.detached.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/MainView.detached.test.tsx
@@ -34,8 +34,11 @@ vi.mock("@/views/AgenticIdeView", async () => {
};
});
-vi.mock("@/views/ChatsView", () => ({
- ChatsView: () => <div data-testid="chats-stub">chats</div>,
+// The "chats" section renders through the surface shell now (mission deck
+// or classic chat). MainView imports the shell, so that is what must be
+// stubbed for these tests to keep asserting about section switching.
+vi.mock("@/views/ChatsSurface", () => ({
+ ChatsSurface: () => <div data-testid="chats-stub">chats</div>,
ViewHeader: () => null,
}));
diff --git a/jarvis/ui/web/frontend/src/components/layout/MainView.lazy.test.tsx b/jarvis/ui/web/frontend/src/components/layout/MainView.lazy.test.tsx
index ad3c5dc40c..f3a5c74b0a 100644
--- a/jarvis/ui/web/frontend/src/components/layout/MainView.lazy.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/MainView.lazy.test.tsx
@@ -62,9 +62,15 @@ describe("MainView lazy sections", () => {
it("keeps the default section statically imported", () => {
// The first-paint section must not cost an extra round trip on startup.
+ // That section is the surface shell, which picks the mission deck or the
+ // classic chat view from the stored preference — EITHER can be the first
+ // thing painted, so the shell (and with it both surfaces) has to travel in
+ // the entry chunk rather than behind a lazy boundary.
const source = readFileSync(MAIN_VIEW, "utf8");
- expect(source).toMatch(/import \{ ChatsView \} from "@\/views\/ChatsView"/);
+ expect(source).toMatch(/import \{ ChatsSurface \} from "@\/views\/ChatsSurface"/);
+ expect(lazyViews.some((v) => v.exportName === "ChatsSurface")).toBe(false);
expect(lazyViews.some((v) => v.exportName === "ChatsView")).toBe(false);
+ expect(lazyViews.some((v) => v.exportName === "MissionDeckView")).toBe(false);
});
it.each(lazyViewsDeclaredInMainView().map((v) => [v.modulePath, v.exportName]))(
@@ -83,5 +89,11 @@ describe("MainView lazy sections", () => {
"section would resolve to undefined and blow up when opened",
).toBeTypeOf("function");
},
+ // This case really imports the section module — the heaviest ones (Settings,
+ // the Agentic IDE) pull a large tree through the jsdom transform and sit
+ // right at the 5 s default on a loaded machine, which made the case fail for
+ // being slow rather than for a missing export. What is under test is the
+ // export, not the load time, so the budget is generous on purpose.
+ 20_000,
);
});
diff --git a/jarvis/ui/web/frontend/src/components/layout/MainView.sticky.test.tsx b/jarvis/ui/web/frontend/src/components/layout/MainView.sticky.test.tsx
index 021b7317cd..f193ea68bb 100644
--- a/jarvis/ui/web/frontend/src/components/layout/MainView.sticky.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/MainView.sticky.test.tsx
@@ -44,8 +44,11 @@ vi.mock("@/views/AgenticIdeView", async () => {
// The default section, statically imported by MainView — stubbed so this test
// pays for none of the chat surface.
-vi.mock("@/views/ChatsView", () => ({
- ChatsView: () => <div data-testid="chats-stub">chats</div>,
+// The "chats" section renders through the surface shell now (mission deck
+// or classic chat). MainView imports the shell, so that is what must be
+// stubbed for these tests to keep asserting about section switching.
+vi.mock("@/views/ChatsSurface", () => ({
+ ChatsSurface: () => <div data-testid="chats-stub">chats</div>,
ViewHeader: () => null,
}));
diff --git a/jarvis/ui/web/frontend/src/components/layout/MainView.tsx b/jarvis/ui/web/frontend/src/components/layout/MainView.tsx
index 8134f2f69e..55d11a9e05 100644
--- a/jarvis/ui/web/frontend/src/components/layout/MainView.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/MainView.tsx
@@ -14,8 +14,10 @@ import { DetachedViewPlaceholder } from "@/components/layout/DetachedViewPlaceho
import type { AgenticIdeViewProps } from "@/views/AgenticIdeView";
// The default section is the one view that must be on screen the moment React
// mounts, so it stays statically linked into the entry chunk. Every other view
-// is code-split below.
-import { ChatsView } from "@/views/ChatsView";
+// is code-split below. `ChatsSurface` picks the mission deck or the classic
+// chat view from the stored preference — both travel in the entry chunk because
+// either one can be the very first thing painted.
+import { ChatsSurface } from "@/views/ChatsSurface";
/**
* Section views are CODE-SPLIT, then prefetched while the app is idle.
@@ -361,7 +363,7 @@ export function MainView() {
function SwitchOnActiveSection({ active }: { active: string }) {
switch (active) {
case "chats":
- return <ChatsView />;
+ return <ChatsSurface />;
case "agents":
return <JarvisAgentsView />;
// Skills + Plugins + MCPs are merged behind the "Skills & Tools" entry with
@@ -451,6 +453,6 @@ function SwitchOnActiveSection({ active }: { active: string }) {
case "chat-workspace":
return null;
default:
- return <ChatsView />;
+ return <ChatsSurface />;
}
}
diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
index e470e318dd..0c58bb64b6 100644
--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
@@ -1,33 +1,15 @@
import {
- MessageSquare,
- Users,
- Boxes,
- BookOpen,
- KeyRound,
- Settings,
- UserCircle2,
- ListTodo,
- Drama,
- FolderOpen,
- Gauge,
- Notebook,
- Sparkles,
- Mic,
- Terminal,
- Share2,
- Contact,
- MessageSquareWarning,
- ScrollText,
- MessagesSquare,
- Frame,
- Image as ImageIcon,
Loader2,
- type LucideIcon,
ChevronRight,
PanelLeftClose,
PanelLeftOpen,
} from "lucide-react";
-import { useEventStore, type SectionId } from "@/store/events";
+import {
+ NAV_GROUPS,
+ resolveNavLabel,
+ type NavItem,
+} from "@/components/layout/navGroups";
+import { useEventStore } from "@/store/events";
import { useVoiceReadiness } from "@/hooks/useVoiceReadiness";
import { useVoiceMode } from "@/hooks/useVoiceMode";
import { useSectionHealth } from "@/hooks/useProviders";
@@ -38,166 +20,12 @@ import { useT } from "@/i18n";
import { BrowserRealtimeControl } from "@/components/voice/BrowserRealtimeControl";
import { PRODUCT_NAME } from "@/lib/branding";
-interface NavItem {
- id: SectionId;
- labelKey: string;
- icon: LucideIcon;
- // When set, the row is highlighted while the active section is any of these
- // ids — used by the merged section entries ("Skills & Tools" fronting
- // skills/plugins/mcps, "CLIs" fronting clis/cli-test-hub); the active id
- // doubles as the tab state.
- matchIds?: SectionId[];
- // English fallback shown when `labelKey` has no translation yet in the active
- // locale (the i18n resolver returns the key itself on a miss).
- fallbackLabel?: string;
- // Draws a small "Beta" pill after the label — the Agentic IDE runs real
- // coding-agent CLIs against the user's own filesystem, which is a step
- // riskier than the rest of the app, so the row says so up front.
- beta?: boolean;
-}
-
-// Resolve a nav row's label, preferring the active-locale translation and
-// falling back to the English `fallbackLabel` when the key is not yet present
-// (the i18n resolver returns the key itself on a miss).
-function resolveNavLabel(t: (key: string) => string, item: NavItem): string {
- const resolved = t(item.labelKey);
- return resolved === item.labelKey && item.fallbackLabel ? item.fallbackLabel : resolved;
-}
-
// A logo request that fails once (backend restarting, dist mid-rebuild) would
// otherwise stick as the browser's broken-image glyph forever — an <img> never
// retries on its own. Bounded cache-busted retries let it heal itself.
const LOGO_RETRY_MAX = 5;
const LOGO_RETRY_BASE_MS = 1500;
-// Sidebar nav, clustered into logical groups separated by a thin divider:
-// 1) daily tools 2) content & data 3) configuration 4) social links.
-// The render walks the groups in order and draws a separator between them, so
-// the order below IS the on-screen order.
-const NAV_GROUPS: NavItem[][] = [
- // 1) Daily tools — what the user reaches for most often.
- [
- { id: "chats", labelKey: "nav.chats", icon: MessageSquare },
- { id: "agents", labelKey: "nav.agents", icon: Users },
- // Skills & Tools — Skills + Plugins + MCPs behind one tab switch. The id
- // "skills" is the default landing (Skills tab); matchIds keeps the row
- // highlighted for any of the fronted sections.
- {
- id: "skills",
- labelKey: "nav.extensions",
- icon: Boxes,
- matchIds: ["skills", "plugins", "mcps"],
- },
- // CLIs — the CLIs list + the CLI Test Hub behind one tab switch (CLIs first).
- { id: "clis", labelKey: "nav.clis_hub", icon: Terminal, matchIds: ["clis", "cli-test-hub"] },
- ],
- // 2) Content & data — things the user reads, edits, or browses.
- [
- { id: "tasks", labelKey: "nav.tasks", icon: ListTodo },
- { id: "sessions", labelKey: "nav.sessions", icon: Mic },
- { id: "run_inspector", labelKey: "nav.run_inspector", icon: Gauge },
- // The visual stage. Sits with the content group next to Outputs on
- // purpose: it reads the same run archive, it just shows the pictures in it
- // instead of listing the files.
- {
- id: "visualization",
- labelKey: "nav.visualization",
- icon: Frame,
- fallbackLabel: "Visualization",
- },
- { id: "board", labelKey: "nav.board", icon: Sparkles },
- { id: "memory", labelKey: "nav.wiki", icon: Notebook },
- { id: "contacts", labelKey: "nav.contacts", icon: Contact },
- { id: "profile", labelKey: "nav.profile", icon: UserCircle2 },
- {
- id: "agent-instructions",
- labelKey: "nav.agent_instructions",
- icon: ScrollText,
- fallbackLabel: "Instructions",
- },
- { id: "docs", labelKey: "nav.docs", icon: BookOpen },
- ],
- // 3) Configuration. API Keys now also fronts the former "Telephony" screen —
- // the telephony status/credentials/scripts/calls live as a section inside the
- // API-Keys view, so matchIds keeps this row highlighted when a "geh zur
- // Telefonie" voice command lands on the "telephony" id. Settings likewise
- // fronts the former "Taskbar" + "Languages" sections (overlay/dictation
- // controls live in OverlayTaskbarGroup, language selectors in LanguagesGroup).
- [
- {
- id: "apikeys",
- labelKey: "nav.apikeys",
- icon: KeyRound,
- matchIds: ["apikeys", "telephony", "telephony-setup"],
- },
- {
- id: "settings",
- labelKey: "nav.settings",
- icon: Settings,
- matchIds: ["settings", "taskbar", "languages"],
- },
- // The voice section — dictation, the custom vocabulary, the keys that start
- // it, the dictation language and the speech-to-text providers — behind one
- // tab switch. "dictation" is the default landing; matchIds keeps the row
- // highlighted for any of the fronted tabs. The label carries the {name}
- // token, so the row reads as the user's own wake-word brand.
- {
- id: "dictation",
- labelKey: "nav.voice",
- icon: Mic,
- matchIds: [
- "dictation",
- "dictionary",
- "voice-shortcuts",
- "voice-language",
- "voice-api-keys",
- ],
- // Name-FREE on purpose: the fallback is rendered verbatim when the key is
- // missing from a locale, and it is NOT interpolated.
- fallbackLabel: "Voice",
- },
- { id: "outputs", labelKey: "nav.outputs", icon: FolderOpen },
- // The assistant's character. Sits with the configuration group because it
- // changes how the assistant behaves everywhere, not what any one page holds.
- {
- id: "modes",
- labelKey: "nav.modes",
- icon: Drama,
- fallbackLabel: "Modes",
- },
- // Appearance. Sits with the configuration group rather than with the
- // content views: it changes how the app looks, not what it holds.
- {
- id: "wallpaper",
- labelKey: "nav.wallpaper",
- icon: ImageIcon,
- fallbackLabel: "Wallpaper",
- },
- ],
- // 4) Social links + in-app feedback.
- [
- { id: "socials", labelKey: "nav.socials", icon: Share2 },
- { id: "feedback", labelKey: "nav.feedback", icon: MessageSquareWarning },
- ],
- // 5) The Agentic IDE — its own bottom group on purpose. It is not one more
- // page among the tools above: opening it puts real coding agents to work in a
- // folder and can narrow the assistant to that workspace, so it sits apart
- // with its own divider rather than blending into the list.
- [
- {
- id: "agentic-ide",
- labelKey: "nav.agentic_ide",
- icon: MessagesSquare,
- fallbackLabel: "Agentic IDE",
- // The classic grid is the same destination as far as the row is
- // concerned: someone who stepped back into it should still see where
- // they are in the navigation.
- matchIds: ["agentic-ide", "chat-workspace", "agentic-ide-classic"],
- beta: true,
- },
- ],
-];
-
const VOICE_STATE_STYLE: Record<string, { dot: string; pulse: boolean }> = {
idle: { dot: "bg-muted-foreground/50", pulse: false },
listening: { dot: "bg-emerald-400", pulse: true },
diff --git a/jarvis/ui/web/frontend/src/components/layout/navGroups.ts b/jarvis/ui/web/frontend/src/components/layout/navGroups.ts
new file mode 100644
index 0000000000..30367e82d9
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/layout/navGroups.ts
@@ -0,0 +1,196 @@
+/**
+ * The app's section list — the ONE source of truth for what sections exist.
+ *
+ * Extracted from `Sidebar.tsx` so the mission deck can show every section at
+ * once without pulling the sidebar's own dependency tree (voice hooks, the
+ * realtime control, provider health) into the entry chunk with it. The deck
+ * ships in that chunk, and `MainView` keeps it deliberately small.
+ *
+ * A second hand-written list anywhere would be the classic drift trap (AP-4):
+ * a section added here would silently never appear on the deck.
+ */
+import {
+ BookOpen,
+ Boxes,
+ Contact,
+ Drama,
+ FolderOpen,
+ Frame,
+ Gauge,
+ KeyRound,
+ ListTodo,
+ MessageSquare,
+ MessageSquareWarning,
+ MessagesSquare,
+ Mic,
+ Notebook,
+ ScrollText,
+ Settings,
+ Share2,
+ Sparkles,
+ Terminal,
+ UserCircle2,
+ Users,
+ Image as ImageIcon,
+ type LucideIcon,
+} from "lucide-react";
+import type { SectionId } from "@/store/events";
+
+// Resolve a nav row's label, preferring the active-locale translation and
+// falling back to the English `fallbackLabel` when the key is not yet present
+// (the i18n resolver returns the key itself on a miss).
+export function resolveNavLabel(t: (key: string) => string, item: NavItem): string {
+ const resolved = t(item.labelKey);
+ return resolved === item.labelKey && item.fallbackLabel ? item.fallbackLabel : resolved;
+}
+
+export interface NavItem {
+ id: SectionId;
+ labelKey: string;
+ icon: LucideIcon;
+ // When set, the row is highlighted while the active section is any of these
+ // ids — used by the merged section entries ("Skills & Tools" fronting
+ // skills/plugins/mcps, "CLIs" fronting clis/cli-test-hub); the active id
+ // doubles as the tab state.
+ matchIds?: SectionId[];
+ // English fallback shown when `labelKey` has no translation yet in the active
+ // locale (the i18n resolver returns the key itself on a miss).
+ fallbackLabel?: string;
+ // Draws a small "Beta" pill after the label — the Agentic IDE runs real
+ // coding-agent CLIs against the user's own filesystem, which is a step
+ // riskier than the rest of the app, so the row says so up front.
+ beta?: boolean;
+}
+
+
+// Sidebar nav, clustered into logical groups separated by a thin divider:
+// 1) daily tools 2) content & data 3) configuration 4) social links.
+// The render walks the groups in order and draws a separator between them, so
+// the order below IS the on-screen order.
+//
+// Exported because the mission deck shows every section at once and jumps to
+// them. A second hand-written list there would be the classic drift trap
+// (AP-4): a section added here would silently never appear on the deck.
+export const NAV_GROUPS: NavItem[][] = [
+ // 1) Daily tools — what the user reaches for most often.
+ [
+ { id: "chats", labelKey: "nav.chats", icon: MessageSquare },
+ { id: "agents", labelKey: "nav.agents", icon: Users },
+ // Skills & Tools — Skills + Plugins + MCPs behind one tab switch. The id
+ // "skills" is the default landing (Skills tab); matchIds keeps the row
+ // highlighted for any of the fronted sections.
+ {
+ id: "skills",
+ labelKey: "nav.extensions",
+ icon: Boxes,
+ matchIds: ["skills", "plugins", "mcps"],
+ },
+ // CLIs — the CLIs list + the CLI Test Hub behind one tab switch (CLIs first).
+ { id: "clis", labelKey: "nav.clis_hub", icon: Terminal, matchIds: ["clis", "cli-test-hub"] },
+ ],
+ // 2) Content & data — things the user reads, edits, or browses.
+ [
+ { id: "tasks", labelKey: "nav.tasks", icon: ListTodo },
+ { id: "sessions", labelKey: "nav.sessions", icon: Mic },
+ { id: "run_inspector", labelKey: "nav.run_inspector", icon: Gauge },
+ // The visual stage. Sits with the content group next to Outputs on
+ // purpose: it reads the same run archive, it just shows the pictures in it
+ // instead of listing the files.
+ {
+ id: "visualization",
+ labelKey: "nav.visualization",
+ icon: Frame,
+ fallbackLabel: "Visualization",
+ },
+ { id: "board", labelKey: "nav.board", icon: Sparkles },
+ { id: "memory", labelKey: "nav.wiki", icon: Notebook },
+ { id: "contacts", labelKey: "nav.contacts", icon: Contact },
+ { id: "profile", labelKey: "nav.profile", icon: UserCircle2 },
+ {
+ id: "agent-instructions",
+ labelKey: "nav.agent_instructions",
+ icon: ScrollText,
+ fallbackLabel: "Instructions",
+ },
+ { id: "docs", labelKey: "nav.docs", icon: BookOpen },
+ ],
+ // 3) Configuration. API Keys now also fronts the former "Telephony" screen —
+ // the telephony status/credentials/scripts/calls live as a section inside the
+ // API-Keys view, so matchIds keeps this row highlighted when a "geh zur
+ // Telefonie" voice command lands on the "telephony" id. Settings likewise
+ // fronts the former "Taskbar" + "Languages" sections (overlay/dictation
+ // controls live in OverlayTaskbarGroup, language selectors in LanguagesGroup).
+ [
+ {
+ id: "apikeys",
+ labelKey: "nav.apikeys",
+ icon: KeyRound,
+ matchIds: ["apikeys", "telephony", "telephony-setup"],
+ },
+ {
+ id: "settings",
+ labelKey: "nav.settings",
+ icon: Settings,
+ matchIds: ["settings", "taskbar", "languages"],
+ },
+ // The voice section — dictation, the custom vocabulary, the keys that start
+ // it, the dictation language and the speech-to-text providers — behind one
+ // tab switch. "dictation" is the default landing; matchIds keeps the row
+ // highlighted for any of the fronted tabs. The label carries the {name}
+ // token, so the row reads as the user's own wake-word brand.
+ {
+ id: "dictation",
+ labelKey: "nav.voice",
+ icon: Mic,
+ matchIds: [
+ "dictation",
+ "dictionary",
+ "voice-shortcuts",
+ "voice-language",
+ "voice-api-keys",
+ ],
+ // Name-FREE on purpose: the fallback is rendered verbatim when the key is
+ // missing from a locale, and it is NOT interpolated.
+ fallbackLabel: "Voice",
+ },
+ { id: "outputs", labelKey: "nav.outputs", icon: FolderOpen },
+ // The assistant's character. Sits with the configuration group because it
+ // changes how the assistant behaves everywhere, not what any one page holds.
+ {
+ id: "modes",
+ labelKey: "nav.modes",
+ icon: Drama,
+ fallbackLabel: "Modes",
+ },
+ // Appearance. Sits with the configuration group rather than with the
+ // content views: it changes how the app looks, not what it holds.
+ {
+ id: "wallpaper",
+ labelKey: "nav.wallpaper",
+ icon: ImageIcon,
+ fallbackLabel: "Wallpaper",
+ },
+ ],
+ // 4) Social links + in-app feedback.
+ [
+ { id: "socials", labelKey: "nav.socials", icon: Share2 },
+ { id: "feedback", labelKey: "nav.feedback", icon: MessageSquareWarning },
+ ],
+ // 5) The Agentic IDE — its own bottom group on purpose. It is not one more
+ // page among the tools above: opening it puts real coding agents to work in a
+ // folder and can narrow the assistant to that workspace, so it sits apart
+ // with its own divider rather than blending into the list.
+ [
+ {
+ id: "agentic-ide",
+ labelKey: "nav.agentic_ide",
+ icon: MessagesSquare,
+ fallbackLabel: "Agentic IDE",
+ // The classic grid is the same destination as far as the row is
+ // concerned: someone who stepped back into it should still see where
+ // they are in the navigation.
+ matchIds: ["agentic-ide", "chat-workspace", "agentic-ide-classic"],
+ beta: true,
+ },
+ ],
+];
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index cff744d2d6..e7a09ceb8d 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -4327,5 +4327,24 @@
"unreviewed": "Selbst hochgeladen: niemand hat dieses Plugin geprüft, und es trägt keinen Herausgeber.",
"blocker_no_files": "Noch nichts ausgewählt.",
"ready": "Bereit zum Installieren."
+ },
+ "deck": {
+ "sections": "Sektionen",
+ "running": "Läuft gerade",
+ "running_empty": "Nichts läuft. Sag dein Wake-Word oder tippe unten.",
+ "thinking_now": "Denkt gerade",
+ "thinking_starting": "Startet…",
+ "idle_headline": "Bereit. Sag dein Wake-Word oder tippe einfach los.",
+ "warming": "Startet gerade. Tippen geht schon, sprechen gleich.",
+ "mood_ready": "bereit",
+ "mood_busy": "arbeitet",
+ "mood_listening": "hört zu",
+ "mood_fail": "gestört",
+ "mood_offline": "getrennt",
+ "stat_brain": "Hirn",
+ "stat_model": "Modell",
+ "stat_running": "Läuft",
+ "switch_to_classic": "Klassischer Chat",
+ "switch_to_deck": "Deck"
}
}
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index 078911206b..229b7fcf42 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -4327,5 +4327,24 @@
"unreviewed": "Self-uploaded: nobody reviewed this plugin, and it carries no publisher.",
"blocker_no_files": "Nothing chosen yet.",
"ready": "Ready to install."
+ },
+ "deck": {
+ "sections": "Sections",
+ "running": "Running now",
+ "running_empty": "Nothing running. Say your wake word or type below.",
+ "thinking_now": "Thinking",
+ "thinking_starting": "Starting…",
+ "idle_headline": "Ready. Say your wake word, or just type.",
+ "warming": "Starting up. You can already type — speaking works in a moment.",
+ "mood_ready": "ready",
+ "mood_busy": "working",
+ "mood_listening": "listening",
+ "mood_fail": "trouble",
+ "mood_offline": "offline",
+ "stat_brain": "Brain",
+ "stat_model": "Model",
+ "stat_running": "Running",
+ "switch_to_classic": "Classic chat",
+ "switch_to_deck": "Deck"
}
}
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index 0dcb86b418..4c81fdafc3 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -4327,5 +4327,24 @@
"unreviewed": "Subido por ti: nadie ha revisado este plugin y no lleva editor.",
"blocker_no_files": "Aún no has elegido nada.",
"ready": "Listo para instalar."
+ },
+ "deck": {
+ "sections": "Secciones",
+ "running": "En marcha",
+ "running_empty": "Nada en marcha. Di tu palabra de activación o escribe abajo.",
+ "thinking_now": "Pensando",
+ "thinking_starting": "Empezando…",
+ "idle_headline": "Listo. Di tu palabra de activación o simplemente escribe.",
+ "warming": "Arrancando. Ya puedes escribir; hablar funcionará enseguida.",
+ "mood_ready": "listo",
+ "mood_busy": "trabajando",
+ "mood_listening": "escuchando",
+ "mood_fail": "con fallos",
+ "mood_offline": "sin conexión",
+ "stat_brain": "Cerebro",
+ "stat_model": "Modelo",
+ "stat_running": "Activos",
+ "switch_to_classic": "Chat clásico",
+ "switch_to_deck": "Panel"
}
}
diff --git a/jarvis/ui/web/frontend/src/lib/deckMode.ts b/jarvis/ui/web/frontend/src/lib/deckMode.ts
new file mode 100644
index 0000000000..09f86e32af
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/lib/deckMode.ts
@@ -0,0 +1,41 @@
+/**
+ * Which surface the "chats" section shows: the mission deck, or the classic
+ * chat view it replaced.
+ *
+ * The deck is a NEW front page, not a migration — the classic view keeps every
+ * feature it ever had (conversation history, per-thread resume, delete, "speak
+ * in this conversation") and stays one click away. Anything the deck cannot do
+ * yet is therefore never lost, only somewhere else, which is the whole reason
+ * this switch exists rather than a hard cutover.
+ *
+ * Persisted in localStorage so the choice survives a reload and a rebuild. A
+ * broken or absent value falls back to the deck: a corrupted preference must
+ * land somewhere usable, never on a blank screen.
+ */
+
+export type DeckMode = "deck" | "classic";
+
+const STORAGE_KEY = "chats.surface.v1";
+const DEFAULT_MODE: DeckMode = "deck";
+
+function isDeckMode(v: unknown): v is DeckMode {
+ return v === "deck" || v === "classic";
+}
+
+export function readDeckMode(): DeckMode {
+ try {
+ const raw = window.localStorage.getItem(STORAGE_KEY);
+ return isDeckMode(raw) ? raw : DEFAULT_MODE;
+ } catch {
+ // Private mode / storage disabled — the deck still has to render.
+ return DEFAULT_MODE;
+ }
+}
+
+export function writeDeckMode(mode: DeckMode): void {
+ try {
+ window.localStorage.setItem(STORAGE_KEY, mode);
+ } catch {
+ /* not being able to remember the choice must not break switching it */
+ }
+}
diff --git a/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsx b/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsx
new file mode 100644
index 0000000000..2ec18113ce
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsx
@@ -0,0 +1,88 @@
+import { describe, it, expect, afterEach, beforeEach, vi } from "vitest";
+import { cleanup, fireEvent, render, screen } from "@testing-library/react";
+import { ChatsSurface } from "@/views/ChatsSurface";
+
+/**
+ * The promise this change is built on: shipping the mission deck takes NOTHING
+ * away. The classic chat view keeps the conversation list, thread resume,
+ * delete and "speak in this conversation" — features the deck does not have —
+ * so it has to stay one click away, and the choice has to stick.
+ *
+ * Both surfaces are stubbed: what is under test is the shell's switching and
+ * persistence, not what either view renders.
+ */
+vi.mock("@/views/ChatsView", () => ({
+ ChatsView: ({ headerAccessory }: { headerAccessory?: React.ReactNode }) => (
+ <div data-testid="classic">
+ classic
+ {headerAccessory}
+ </div>
+ ),
+}));
+
+vi.mock("@/views/MissionDeckView", async () => {
+ const actual = await vi.importActual<typeof import("@/views/MissionDeckView")>(
+ "@/views/MissionDeckView",
+ );
+ return {
+ // The real switch — it owns the persistence this test is about.
+ SurfaceSwitch: actual.SurfaceSwitch,
+ MissionDeckView: ({ headerAccessory }: { headerAccessory?: React.ReactNode }) => (
+ <div data-testid="deck">
+ deck
+ {headerAccessory}
+ </div>
+ ),
+ };
+});
+
+const STORAGE_KEY = "chats.surface.v1";
+
+describe("ChatsSurface", () => {
+ beforeEach(() => {
+ window.localStorage.clear();
+ });
+
+ afterEach(cleanup);
+
+ it("shows the deck by default", () => {
+ render(<ChatsSurface />);
+ expect(screen.getByTestId("deck")).toBeTruthy();
+ expect(screen.queryByTestId("classic")).toBeNull();
+ });
+
+ it("falls back to the classic chat view and remembers it", () => {
+ render(<ChatsSurface />);
+
+ fireEvent.click(screen.getByRole("button"));
+
+ // The classic view is on screen — nothing about it was removed.
+ expect(screen.getByTestId("classic")).toBeTruthy();
+ expect(screen.queryByTestId("deck")).toBeNull();
+ // ...and the choice survives the next start.
+ expect(window.localStorage.getItem(STORAGE_KEY)).toBe("classic");
+ });
+
+ it("opens on the classic view when that is the stored choice", () => {
+ window.localStorage.setItem(STORAGE_KEY, "classic");
+ render(<ChatsSurface />);
+ expect(screen.getByTestId("classic")).toBeTruthy();
+ });
+
+ it("switches back to the deck", () => {
+ window.localStorage.setItem(STORAGE_KEY, "classic");
+ render(<ChatsSurface />);
+
+ fireEvent.click(screen.getByRole("button"));
+
+ expect(screen.getByTestId("deck")).toBeTruthy();
+ expect(window.localStorage.getItem(STORAGE_KEY)).toBe("deck");
+ });
+
+ it("lands on the deck when the stored value is corrupt", () => {
+ // A broken preference must resolve to a usable surface, never a blank one.
+ window.localStorage.setItem(STORAGE_KEY, "not-a-surface");
+ render(<ChatsSurface />);
+ expect(screen.getByTestId("deck")).toBeTruthy();
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/views/ChatsSurface.tsx b/jarvis/ui/web/frontend/src/views/ChatsSurface.tsx
new file mode 100644
index 0000000000..9a93b4d636
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/views/ChatsSurface.tsx
@@ -0,0 +1,30 @@
+import { useState } from "react";
+import { ChatsView } from "@/views/ChatsView";
+import { MissionDeckView, SurfaceSwitch } from "@/views/MissionDeckView";
+import { readDeckMode, type DeckMode } from "@/lib/deckMode";
+
+/**
+ * The "chats" section: the mission deck, with the classic chat view one click
+ * behind it.
+ *
+ * Why a switch instead of a replacement: the classic view still owns things the
+ * deck does not do — the conversation list, resuming a stored thread, deleting
+ * one, "speak in this conversation". Shipping the deck as a hard cutover would
+ * take those away, so both surfaces stay reachable and the choice is
+ * remembered. When the deck grows those features the switch can go; until then
+ * it is what makes this a safe change rather than a lossy one.
+ *
+ * The mode lives here rather than in the event store on purpose: nothing on the
+ * backend cares which surface is on screen, and a preference that never leaves
+ * the browser has no business on the event bus.
+ */
+export function ChatsSurface() {
+ const [mode, setMode] = useState<DeckMode>(() => readDeckMode());
+ const accessory = <SurfaceSwitch mode={mode} onChange={setMode} />;
+
+ return mode === "classic" ? (
+ <ChatsView headerAccessory={accessory} />
+ ) : (
+ <MissionDeckView headerAccessory={accessory} />
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/views/ChatsView.tsx b/jarvis/ui/web/frontend/src/views/ChatsView.tsx
index d39385c804..ce4fcd11fd 100644
--- a/jarvis/ui/web/frontend/src/views/ChatsView.tsx
+++ b/jarvis/ui/web/frontend/src/views/ChatsView.tsx
@@ -1,4 +1,4 @@
-import { useCallback, useEffect, useRef } from "react";
+import { useCallback, useEffect, useRef, type ReactNode } from "react";
import { MessageSquare, Mic, Plus, Trash2, AudioLines } from "lucide-react";
import {
useEventStore,
@@ -26,7 +26,16 @@ import {
const LIST_REFRESH_MS = 5000;
-export function ChatsView() {
+export function ChatsView({
+ headerAccessory,
+}: {
+ /**
+ * The surface switch, handed down by the shell that owns the mode. Absent
+ * when this view is rendered on its own (tests, detached window), which is
+ * why it stays optional rather than required.
+ */
+ headerAccessory?: ReactNode;
+} = {}) {
const t = useT();
const messages = useEventStore((s) => s.messages);
const chatThinking = useEventStore((s) => s.chatThinking);
@@ -142,22 +151,25 @@ export function ChatsView() {
title={activeTitle}
subtitle={t("chats_view.subtitle")}
right={
- <button
- type="button"
- onClick={speak}
- disabled={!activeThreadId}
- title={t("chats_view.speak")}
- className={cn(
- "flex items-center gap-2 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors",
- activeThreadId
- ? "border-primary/40 bg-primary/10 text-primary hover:bg-primary/20"
- : "cursor-not-allowed border-border text-muted-foreground/50",
- )}
- >
- <AudioLines className="h-3.5 w-3.5" />
- <span className="hidden sm:inline">{t("chats_view.speak")}</span>
- <span className="sm:hidden">{t("chats_view.speak_short")}</span>
- </button>
+ <div className="flex items-center gap-2">
+ <button
+ type="button"
+ onClick={speak}
+ disabled={!activeThreadId}
+ title={t("chats_view.speak")}
+ className={cn(
+ "flex items-center gap-2 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors",
+ activeThreadId
+ ? "border-primary/40 bg-primary/10 text-primary hover:bg-primary/20"
+ : "cursor-not-allowed border-border text-muted-foreground/50",
+ )}
+ >
+ <AudioLines className="h-3.5 w-3.5" />
+ <span className="hidden sm:inline">{t("chats_view.speak")}</span>
+ <span className="sm:hidden">{t("chats_view.speak_short")}</span>
+ </button>
+ {headerAccessory}
+ </div>
}
/>
@@ -490,13 +502,13 @@ export function ViewHeader({
subtitle,
right,
}: {
- icon: React.ReactNode;
+ icon: ReactNode;
title: string;
// Optional inline accessory rendered right next to the title (e.g. a
// "Research Preview" / "Beta" pill). Absent for every other view.
- titleBadge?: React.ReactNode;
+ titleBadge?: ReactNode;
subtitle?: string;
- right?: React.ReactNode;
+ right?: ReactNode;
}) {
return (
<header className="flex items-center gap-3 border-b border-border px-6 py-4">
diff --git a/jarvis/ui/web/frontend/src/views/MissionDeckView.tsx b/jarvis/ui/web/frontend/src/views/MissionDeckView.tsx
new file mode 100644
index 0000000000..efb3046fe3
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/views/MissionDeckView.tsx
@@ -0,0 +1,557 @@
+import {
+ useCallback,
+ useEffect,
+ useMemo,
+ useRef,
+ useState,
+ type ReactNode,
+} from "react";
+import { LayoutList, Radio } from "lucide-react";
+import { useEventStore, type SectionId } from "@/store/events";
+import { NAV_GROUPS, resolveNavLabel } from "@/components/layout/navGroups";
+import { ChatInput } from "@/components/ChatInput";
+import { MascotGigi } from "@/components/MascotGigi";
+import { useVoiceReadiness } from "@/hooks/useVoiceReadiness";
+import { cn } from "@/lib/utils";
+import { useT } from "@/i18n";
+import { writeDeckMode } from "@/lib/deckMode";
+import type { ThinkingStep } from "@/lib/thinkingSteps";
+
+/**
+ * The mission deck — the front page.
+ *
+ * One surface that answers "what is going on" without a single navigation
+ * step: every section on the left with its live state, what the assistant is
+ * doing right now on the right, and the one place you talk to it in the middle.
+ *
+ * Everything on screen is REAL. There is no filler telemetry: a number that
+ * cannot be sourced from the store is simply not shown, because a deck whose
+ * figures are decorative teaches the user to stop reading it. That is why there
+ * is no cost meter and no context gauge here yet — the events exist on the bus
+ * (`BrainTTFT`, `BudgetWarning`) but nothing feeds them into this store, and
+ * inventing a plausible value would be worse than the gap.
+ *
+ * Colours come from theme tokens only, so the deck holds in both appearances.
+ */
+export function MissionDeckView({
+ headerAccessory,
+}: {
+ /** The surface switch, handed down by the shell that owns the mode. */
+ headerAccessory?: ReactNode;
+}) {
+ const t = useT();
+ const assistantName = useEventStore((s) => s.assistantName);
+ const brainProvider = useEventStore((s) => s.brainProvider);
+ const brainModel = useEventStore((s) => s.brainModel);
+ const connected = useEventStore((s) => s.connected);
+ const voiceState = useEventStore((s) => s.voiceState);
+ const messages = useEventStore((s) => s.messages);
+ const chatThinking = useEventStore((s) => s.chatThinking);
+ const thinkingSteps = useEventStore((s) => s.thinkingSteps);
+ const conversations = useEventStore((s) => s.conversations);
+ const setActiveSection = useEventStore((s) => s.setActiveSection);
+ const { warming } = useVoiceReadiness();
+
+ // The live steps drive both the "running now" column and the ring around the
+ // mascot, so an active step is the deck's definition of "busy".
+ const running = useMemo(
+ () => thinkingSteps.filter((s) => s.status === "active"),
+ [thinkingSteps],
+ );
+
+ const mood: DeckMood = !connected
+ ? "offline"
+ : voiceState === "error"
+ ? "fail"
+ : voiceState === "listening"
+ ? "listening"
+ : chatThinking || running.length > 0
+ ? "busy"
+ : "ready";
+
+ // The headline: the assistant's last word, or the honest state when it has
+ // not said anything yet in this session.
+ const lastAssistant = useMemo(
+ () => [...messages].reverse().find((m) => m.role === "assistant"),
+ [messages],
+ );
+
+ const headline = lastAssistant
+ ? lastAssistant.content
+ : warming
+ ? t("deck.warming")
+ : t("deck.idle_headline");
+
+ return (
+ <div className="flex h-full min-h-0 flex-col">
+ <DeckHeader
+ assistantName={assistantName}
+ brainProvider={brainProvider}
+ brainModel={brainModel}
+ mood={mood}
+ runningCount={running.length}
+ accessory={headerAccessory}
+ />
+
+ <div className="grid min-h-0 flex-1 grid-cols-1 lg:grid-cols-[minmax(160px,220px)_minmax(0,1fr)_minmax(200px,300px)]">
+ <SectionRail onJump={setActiveSection} chatCount={conversations.length} />
+
+ <main className="flex min-h-0 flex-col border-border lg:border-x">
+ <div className="flex min-h-0 flex-1 flex-col items-center justify-center gap-4 px-6 py-6 text-center">
+ <CoreOrb mood={mood} steps={running} />
+
+ <div className="font-mono text-[10px] uppercase tracking-[0.24em] text-primary">
+ {t(`deck.mood_${mood}`)}
+ </div>
+
+ <p className="max-w-[46ch] text-pretty text-base leading-relaxed text-foreground">
+ {headline}
+ </p>
+
+ <ThoughtStream steps={thinkingSteps} active={chatThinking} />
+ </div>
+
+ {/* The real composer — same component the classic view uses, so
+ dictation, file drop and Enter-to-send behave identically. */}
+ <div className="border-t border-border px-6 py-4">
+ <ChatInput />
+ </div>
+ </main>
+
+ <RunningColumn steps={thinkingSteps} />
+ </div>
+ </div>
+ );
+}
+
+type DeckMood = "ready" | "busy" | "listening" | "fail" | "offline";
+
+const MOOD_DOT: Record<DeckMood, string> = {
+ ready: "bg-emerald-400",
+ busy: "bg-primary",
+ listening: "bg-primary",
+ fail: "bg-destructive",
+ offline: "bg-muted-foreground",
+};
+
+// ----------------------------------------------------------------------
+// Header — identity left, the values that steer a decision right.
+// ----------------------------------------------------------------------
+
+function DeckHeader({
+ assistantName,
+ brainProvider,
+ brainModel,
+ mood,
+ runningCount,
+ accessory,
+}: {
+ assistantName: string;
+ brainProvider: string;
+ brainModel: string;
+ mood: DeckMood;
+ runningCount: number;
+ accessory?: ReactNode;
+}) {
+ const t = useT();
+ const setActiveSection = useEventStore((s) => s.setActiveSection);
+
+ return (
+ <header className="flex flex-wrap items-center gap-x-6 gap-y-2 border-b border-border px-4 py-2.5">
+ <div className="flex items-center gap-2">
+ <span
+ className={cn(
+ "h-2 w-2 shrink-0 rounded-full",
+ MOOD_DOT[mood],
+ (mood === "busy" || mood === "listening") && "animate-pulse",
+ )}
+ aria-hidden
+ />
+ <span className="font-display text-sm font-bold uppercase tracking-[0.18em]">
+ {assistantName}
+ </span>
+ <span className="font-mono text-[10px] uppercase tracking-[0.16em] text-primary">
+ {t(`deck.mood_${mood}`)}
+ </span>
+ </div>
+
+ <div className="ml-auto flex flex-wrap items-center gap-x-5 gap-y-1">
+ <HeaderStat
+ label={t("deck.stat_brain")}
+ value={brainProvider || "—"}
+ hot
+ onClick={() => setActiveSection("apikeys")}
+ />
+ <HeaderStat
+ label={t("deck.stat_model")}
+ value={brainModel || "—"}
+ onClick={() => setActiveSection("apikeys")}
+ />
+ <HeaderStat label={t("deck.stat_running")} value={String(runningCount)} hot={runningCount > 0} />
+ {accessory}
+ </div>
+ </header>
+ );
+}
+
+function HeaderStat({
+ label,
+ value,
+ hot,
+ onClick,
+}: {
+ label: string;
+ value: string;
+ hot?: boolean;
+ onClick?: () => void;
+}) {
+ const body = (
+ <>
+ <span className="font-mono text-[10px] uppercase tracking-[0.14em] text-muted-foreground">
+ {label}
+ </span>
+ <span
+ className={cn(
+ "font-mono text-xs tabular-nums",
+ hot ? "text-primary" : "text-foreground",
+ )}
+ >
+ {value}
+ </span>
+ </>
+ );
+
+ if (!onClick) {
+ return <div className="flex items-baseline gap-1.5 whitespace-nowrap">{body}</div>;
+ }
+ return (
+ <button
+ type="button"
+ onClick={onClick}
+ className="flex items-baseline gap-1.5 whitespace-nowrap transition-colors hover:[&>span]:text-primary"
+ >
+ {body}
+ </button>
+ );
+}
+
+// ----------------------------------------------------------------------
+// Left — every section at once, straight from the sidebar's own list.
+// ----------------------------------------------------------------------
+
+function SectionRail({
+ onJump,
+ chatCount,
+}: {
+ onJump: (id: SectionId) => void;
+ chatCount: number;
+}) {
+ const t = useT();
+ const activeSection = useEventStore((s) => s.activeSection);
+
+ return (
+ <nav className="hidden min-h-0 flex-col overflow-hidden lg:flex">
+ <div className="flex items-center gap-2 border-b border-border px-3 py-2 font-mono text-[9px] uppercase tracking-[0.22em] text-primary">
+ <LayoutList className="h-3 w-3" />
+ {t("deck.sections")}
+ </div>
+
+ <div className="min-h-0 flex-1 overflow-y-auto px-1.5 py-2">
+ {NAV_GROUPS.map((group, gi) => (
+ <div key={gi} className="mb-2">
+ {group.map((item) => {
+ // Only counts that are genuinely known are shown. "chats" is the
+ // one the store already holds; the rest stay blank rather than
+ // display a number nobody computed.
+ const count = item.id === "chats" ? chatCount : 0;
+ const isActive =
+ activeSection === item.id || item.matchIds?.includes(activeSection);
+ return (
+ <button
+ key={item.id}
+ type="button"
+ onClick={() => onJump(item.id)}
+ className={cn(
+ "flex w-full items-center gap-2 rounded-sm px-2 py-1 text-left transition-colors",
+ isActive ? "bg-primary/10" : "hover:bg-card/40",
+ )}
+ >
+ <item.icon
+ className={cn(
+ "h-3 w-3 shrink-0",
+ count > 0 ? "text-primary" : "text-muted-foreground",
+ )}
+ />
+ <span
+ className={cn(
+ "flex-1 truncate text-xs",
+ count > 0 ? "text-foreground" : "text-muted-foreground",
+ )}
+ >
+ {resolveNavLabel(t, item)}
+ </span>
+ {count > 0 && (
+ <span className="font-mono text-[10px] tabular-nums text-primary">
+ {count}
+ </span>
+ )}
+ </button>
+ );
+ })}
+ </div>
+ ))}
+ </div>
+ </nav>
+ );
+}
+
+// ----------------------------------------------------------------------
+// Centre — the mascot, ringed by one arc per running step.
+// ----------------------------------------------------------------------
+
+const STEP_STROKE: Record<string, string> = {
+ brain: "hsl(var(--primary))",
+ tool: "hsl(var(--primary))",
+ computer: "hsl(var(--primary))",
+ worker: "hsl(var(--primary))",
+ note: "hsl(var(--muted-foreground))",
+};
+
+function CoreOrb({ mood, steps }: { mood: DeckMood; steps: ThinkingStep[] }) {
+ // A slow sweep that only turns while something is actually running — motion
+ // without a cause reads as a screensaver and stops meaning anything.
+ const [sweep, setSweep] = useState(0);
+ const raf = useRef<number | null>(null);
+ const busy = mood === "busy" || mood === "listening";
+
+ useEffect(() => {
+ if (!busy || window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
+ return;
+ }
+ let start: number | null = null;
+ const tick = (ts: number) => {
+ if (start === null) start = ts;
+ setSweep(((ts - start) / 28) % 360);
+ raf.current = requestAnimationFrame(tick);
+ };
+ raf.current = requestAnimationFrame(tick);
+ return () => {
+ if (raf.current !== null) cancelAnimationFrame(raf.current);
+ };
+ }, [busy]);
+
+ const point = useCallback((deg: number, r: number): [number, number] => {
+ const rad = ((deg - 90) * Math.PI) / 180;
+ return [66 + r * Math.cos(rad), 66 + r * Math.sin(rad)];
+ }, []);
+
+ const arcs = steps.slice(0, 6).map((step, i, all) => {
+ const span = 300 / Math.max(1, all.length);
+ const a0 = -150 + i * span + 3;
+ const a1 = a0 + (span - 6);
+ const [x0, y0] = point(a0, 52);
+ const [x1, y1] = point(a1, 52);
+ return {
+ id: step.id,
+ d: `M ${x0} ${y0} A 52 52 0 0 1 ${x1} ${y1}`,
+ stroke: STEP_STROKE[step.kind] ?? "hsl(var(--primary))",
+ };
+ });
+
+ const [sx, sy] = point(sweep, 60);
+ const [ex, ey] = point(sweep + 40, 60);
+
+ return (
+ <div className="relative h-[132px] w-[132px] shrink-0">
+ <svg viewBox="0 0 132 132" className="absolute inset-0 h-full w-full" aria-hidden>
+ {/* Scale ring — built once, static. */}
+ {Array.from({ length: 48 }, (_, i) => {
+ const deg = i * 7.5;
+ const [ax, ay] = point(deg, 38);
+ const [bx, by] = point(deg, 42);
+ return (
+ <line
+ key={deg}
+ x1={ax}
+ y1={ay}
+ x2={bx}
+ y2={by}
+ stroke="hsl(var(--primary))"
+ strokeWidth={1}
+ opacity={i % 6 === 0 ? 0.4 : 0.13}
+ />
+ );
+ })}
+
+ {arcs.map((a) => (
+ <path
+ key={a.id}
+ d={a.d}
+ fill="none"
+ stroke={a.stroke}
+ strokeWidth={2.5}
+ strokeLinecap="round"
+ opacity={0.9}
+ />
+ ))}
+
+ {busy && (
+ <path
+ d={`M ${sx} ${sy} A 60 60 0 0 1 ${ex} ${ey}`}
+ fill="none"
+ stroke="hsl(var(--primary))"
+ strokeWidth={1.2}
+ strokeLinecap="round"
+ opacity={0.5}
+ />
+ )}
+ </svg>
+
+ <div className="absolute inset-0 grid place-items-center">
+ <MascotGigi size={54} reactToVoice enableComments={false} />
+ </div>
+ </div>
+ );
+}
+
+/**
+ * What the assistant is reasoning about, in its own words.
+ *
+ * Shows the newest step's translated label plus its raw detail. Deliberately
+ * one line: this is the pulse, not the transcript — the full trace lives in the
+ * running column beside it.
+ */
+function ThoughtStream({ steps, active }: { steps: ThinkingStep[]; active: boolean }) {
+ const t = useT();
+ const latest = steps[steps.length - 1];
+
+ if (!active && !latest) {
+ return <div className="min-h-[3.2em]" aria-hidden />;
+ }
+
+ return (
+ <div className="w-full max-w-[46ch] border-l border-border pl-3 text-left">
+ <span className="block font-mono text-[9px] uppercase tracking-[0.2em] text-primary">
+ {t("deck.thinking_now")}
+ </span>
+ <span className="text-xs leading-relaxed text-muted-foreground">
+ {latest ? (
+ <>
+ {t(latest.labelKey)}
+ {latest.detail ? ` · ${latest.detail}` : ""}
+ </>
+ ) : (
+ t("deck.thinking_starting")
+ )}
+ </span>
+ </div>
+ );
+}
+
+// ----------------------------------------------------------------------
+// Right — every action the assistant is taking, live.
+// ----------------------------------------------------------------------
+
+const STEP_BADGE: Record<string, string> = {
+ brain: "bg-primary text-primary-foreground",
+ tool: "bg-sky-400 text-black",
+ computer: "bg-violet-400 text-black",
+ worker: "bg-emerald-400 text-black",
+ note: "bg-muted text-muted-foreground",
+};
+
+function RunningColumn({ steps }: { steps: ThinkingStep[] }) {
+ const t = useT();
+ const shown = [...steps].reverse();
+
+ return (
+ <aside className="flex min-h-0 flex-col overflow-hidden">
+ <div className="flex items-center gap-2 border-b border-border px-3 py-2 font-mono text-[9px] uppercase tracking-[0.22em] text-primary">
+ <Radio className="h-3 w-3" />
+ {t("deck.running")}
+ <span className="ml-auto tabular-nums text-muted-foreground">{steps.length}</span>
+ </div>
+
+ <div className="min-h-0 flex-1 overflow-y-auto px-2 py-2">
+ {shown.length === 0 ? (
+ <p className="px-1 py-1 text-[11px] text-muted-foreground">
+ {t("deck.running_empty")}
+ </p>
+ ) : (
+ shown.map((step) => (
+ <div
+ key={step.id}
+ className={cn(
+ "mb-1 border-l px-2 py-1",
+ step.status === "active"
+ ? "border-primary"
+ : step.status === "error"
+ ? "border-destructive"
+ : "border-border",
+ )}
+ >
+ <div className="flex items-center gap-1.5">
+ <span
+ className={cn(
+ "shrink-0 px-1 py-px font-mono text-[9px] uppercase tracking-wider",
+ STEP_BADGE[step.kind] ?? STEP_BADGE.note,
+ )}
+ >
+ {step.kind}
+ </span>
+ <span
+ className={cn(
+ "flex-1 truncate text-[11px]",
+ step.status === "active" ? "text-foreground" : "text-muted-foreground",
+ )}
+ >
+ {t(step.labelKey)}
+ </span>
+ {step.durationMs !== undefined && (
+ <span className="shrink-0 font-mono text-[9px] tabular-nums text-muted-foreground">
+ {(step.durationMs / 1000).toFixed(1)}s
+ </span>
+ )}
+ </div>
+ {step.detail && (
+ <div className="truncate pl-1 pt-0.5 font-mono text-[10px] text-muted-foreground">
+ {step.detail}
+ </div>
+ )}
+ </div>
+ ))
+ )}
+ </div>
+ </aside>
+ );
+}
+
+/**
+ * The escape hatch, rendered by the shell above both surfaces.
+ *
+ * Kept in this module so the deck and the switch that leaves it stay together.
+ */
+export function SurfaceSwitch({
+ mode,
+ onChange,
+}: {
+ mode: "deck" | "classic";
+ onChange: (mode: "deck" | "classic") => void;
+}) {
+ const t = useT();
+ const next = mode === "deck" ? "classic" : "deck";
+
+ return (
+ <button
+ type="button"
+ onClick={() => {
+ writeDeckMode(next);
+ onChange(next);
+ }}
+ title={t(next === "classic" ? "deck.switch_to_classic" : "deck.switch_to_deck")}
+ className="flex items-center gap-1.5 rounded-lg border border-border px-2 py-1 font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground transition-colors hover:border-primary/50 hover:text-primary"
+ >
+ {t(next === "classic" ? "deck.switch_to_classic" : "deck.switch_to_deck")}
+ </button>
+ );
+}