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(deck): a boot sequence and a listening ring before the first word — the board takes over when you speak

Harald0e55ac564518
diff --git a/jarvis/ui/web/frontend/src/components/deck/DeckLogCard.tsx b/jarvis/ui/web/frontend/src/components/deck/DeckLogCard.tsx
index 4531158444..c974de796e 100644
--- a/jarvis/ui/web/frontend/src/components/deck/DeckLogCard.tsx
+++ b/jarvis/ui/web/frontend/src/components/deck/DeckLogCard.tsx
@@ -56,12 +56,12 @@ export function fmtMs(ms: number): string {
return `${minutes}:${String(seconds).padStart(2, "0")} min`;
}
-function fmtClock(ms: number): string {
+export function fmtClock(ms: number): string {
return new Date(ms).toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit", second: "2-digit" });
}
/** "quiet for 3 min" — coarse on purpose; a second-by-second count would fidget. */
-function fmtQuiet(ms: number): string {
+export function fmtQuiet(ms: number): string {
if (ms < 60_000) return `${Math.max(1, Math.floor(ms / 1000))} s`;
if (ms < 3_600_000) return `${Math.floor(ms / 60_000)} min`;
return `${Math.floor(ms / 3_600_000)} h`;
diff --git a/jarvis/ui/web/frontend/src/components/deck/DeckReveal.tsx b/jarvis/ui/web/frontend/src/components/deck/DeckReveal.tsx
new file mode 100644
index 0000000000..f434a3acaf
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/deck/DeckReveal.tsx
@@ -0,0 +1,72 @@
+import { useRef, type CSSProperties, type ReactNode } from "react";
+import { motion, useReducedMotion } from "framer-motion";
+import { revealDelayMs, type BoardSlot } from "@/lib/deckStandby";
+import { cn } from "@/lib/utils";
+
+/**
+ * How a board instrument powers on when the board takes over from the standby
+ * stage: a top-to-bottom wipe with a gold scan bar riding the front, timed
+ * from the centre outward (`revealDelayMs`) so the board assembles around the
+ * orb instead of popping in as one block.
+ *
+ * `reveal` is decided ONCE for the board's mount (MissionDeckView): a board
+ * that mounts straight into a running session — a section change and back,
+ * a reload mid-conversation — is simply there. Either way the wrapper is the
+ * same element, so a card never remounts because the flag moved.
+ *
+ * Reduced motion: no wipe, no bar — the same board, at once.
+ */
+const WIPE_S = 0.42;
+const EASE: [number, number, number, number] = [0.2, 0.8, 0.2, 1];
+
+export function DeckReveal({
+ slot,
+ reveal,
+ className,
+ style,
+ children,
+}: {
+ slot: BoardSlot;
+ reveal: boolean;
+ className?: string;
+ style?: CSSProperties;
+ children: ReactNode;
+}) {
+ const reduced = useReducedMotion() ?? false;
+ const animate = reveal && !reduced;
+ const delay = revealDelayMs(slot) / 1000;
+ const ref = useRef<HTMLDivElement>(null);
+
+ return (
+ <motion.div
+ ref={ref}
+ className={cn("relative", className)}
+ style={style}
+ data-testid={`deck-slot-${slot}`}
+ data-reveal={animate ? "true" : "false"}
+ initial={animate ? { clipPath: "inset(0 0 100% 0)", opacity: 0.4 } : false}
+ animate={animate ? { clipPath: "inset(0 0 0% 0)", opacity: 1 } : { opacity: 1 }}
+ transition={{ delay, duration: WIPE_S, ease: EASE }}
+ // The wipe done, the clip goes: a card must not stay clipped to its box
+ // for the rest of the session (focus rings, the frame's halo).
+ onAnimationComplete={() => {
+ if (ref.current) ref.current.style.clipPath = "";
+ }}
+ >
+ {children}
+ {animate && (
+ <motion.div
+ aria-hidden
+ className="deck-scan-bar"
+ initial={{ top: "0%", opacity: 1 }}
+ animate={{ top: "100%", opacity: 0 }}
+ transition={{
+ top: { delay, duration: WIPE_S, ease: EASE },
+ opacity: { delay: delay + WIPE_S - 0.1, duration: 0.14 },
+ }}
+ style={{ translateY: "-100%" }}
+ />
+ )}
+ </motion.div>
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/components/deck/DeckStandby.test.tsx b/jarvis/ui/web/frontend/src/components/deck/DeckStandby.test.tsx
new file mode 100644
index 0000000000..dbd3586d38
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/deck/DeckStandby.test.tsx
@@ -0,0 +1,200 @@
+import { act, cleanup, fireEvent, render, screen, within } from "@testing-library/react";
+import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
+
+import { DeckStandby } from "@/components/deck/DeckStandby";
+import type { WakeWordConfig } from "@/hooks/useWakeWord";
+import { useDeckStore } from "@/store/deck";
+import { useEventStore } from "@/store/events";
+
+/**
+ * The deck before the first word (2026-08-18): a boot console that lights
+ * the four gates as they turn true, then a listening ring — with the board
+ * one press away. Rendered against the real stores so what is asserted is
+ * what a person sees while the app comes up.
+ */
+
+const WAKE: WakeWordConfig = {
+ phrase: "Hey Nova",
+ engine: "openwakeword",
+ custom_model_path: "",
+ fuzzy_match_ratio: 0.8,
+ language: "auto",
+ engines: ["openwakeword"],
+ instant_phrases: [],
+ local_whisper_available: false,
+ enabled: true,
+};
+
+const READOUTS = { nw: "ready", ne: "0 steps", sw: "—", se: "0 words" };
+
+function renderStage(
+ phase: "boot" | "standby",
+ extra: Partial<Parameters<typeof DeckStandby>[0]> = {},
+) {
+ const onOpenBoard = vi.fn();
+ const onPressOrb = vi.fn();
+ const utils = render(
+ <DeckStandby
+ phase={phase}
+ steps={[]}
+ busy={false}
+ readouts={READOUTS}
+ wakeConfig={WAKE}
+ onPressOrb={onPressOrb}
+ pressLabel="Start talking"
+ pressDisabled={false}
+ onOpenBoard={onOpenBoard}
+ {...extra}
+ />,
+ );
+ return { ...utils, onOpenBoard, onPressOrb };
+}
+
+function console_() {
+ return within(screen.getByTestId("deck-boot-console"));
+}
+
+describe("DeckStandby — boot", () => {
+ beforeEach(() => {
+ useDeckStore.getState().resetDeck();
+ useEventStore.setState({
+ connected: false,
+ voiceReady: false,
+ wsWarming: true,
+ voiceState: "idle",
+ brainProvider: "",
+ brainModel: "",
+ assistantName: "Nova",
+ activeSection: "chats",
+ });
+ });
+ afterEach(() => cleanup());
+
+ test("names the act, the assistant, and waits on the link first", () => {
+ renderStage("boot");
+ expect(screen.getByTestId("deck-standby").getAttribute("data-phase")).toBe("boot");
+ expect(screen.getByText("boot sequence")).toBeTruthy();
+ expect(screen.getByTestId("deck-boot-title").getAttribute("aria-label")).toBe("Nova starting");
+ // The console: the first gate only, pending — later lines wait their turn.
+ const c = console_();
+ expect(c.getByText("connecting to the assistant")).toBeTruthy();
+ expect(c.queryByText("voice stack starting")).toBeNull();
+ // No board yet, so no idle headline; but the board is one press away.
+ expect(screen.queryByText(/Say “Hey Nova”/)).toBeNull();
+ expect(screen.getByRole("button", { name: "Open the board" })).toBeTruthy();
+ });
+
+ test("lights the gates in order as they turn true, and the arcs follow", () => {
+ const { rerender } = renderStage("boot");
+ act(() => useEventStore.setState({ connected: true }));
+ let c = console_();
+ expect(c.getByText("connected")).toBeTruthy();
+ expect(c.getByText("voice stack starting")).toBeTruthy();
+ expect(c.queryByText("reading the brain")).toBeNull();
+
+ act(() => useEventStore.setState({ voiceReady: true, brainProvider: "openrouter", brainModel: "claude-sonnet-5" }));
+ rerender(
+ <DeckStandby
+ phase="standby"
+ steps={[]}
+ busy={false}
+ readouts={READOUTS}
+ wakeConfig={WAKE}
+ onPressOrb={() => {}}
+ pressLabel="Start talking"
+ pressDisabled={false}
+ onOpenBoard={() => {}}
+ />,
+ );
+ c = console_();
+ expect(c.getByText("voice ready")).toBeTruthy();
+ expect(c.getByText("openrouter · claude-sonnet-5")).toBeTruthy();
+ expect(c.getByText("listening for “Hey Nova”")).toBeTruthy();
+
+ const ring = screen.getByTestId("deck-standby-ring");
+ const states = Array.from(ring.querySelectorAll(".deck-gate-arc")).map(
+ (el) => `${el.getAttribute("data-gate")}:${el.getAttribute("data-state")}`,
+ );
+ expect(states).toEqual(["link:ok", "voice:ok", "brain:ok", "wake:ok"]);
+ // Every gate was pending when the stage mounted: all four draw in.
+ expect(ring.querySelectorAll('.deck-gate-arc[data-fresh="true"]')).toHaveLength(4);
+ });
+
+ test("the orb press and the board button reach the parent", () => {
+ act(() => useEventStore.setState({ connected: true }));
+ const { onOpenBoard, onPressOrb } = renderStage("boot");
+ fireEvent.click(screen.getByRole("button", { name: "Open the board" }));
+ expect(onOpenBoard).toHaveBeenCalledTimes(1);
+ fireEvent.click(screen.getByRole("button", { name: "Start talking" }));
+ expect(onPressOrb).toHaveBeenCalledTimes(1);
+ });
+});
+
+describe("DeckStandby — standby", () => {
+ beforeEach(() => {
+ useDeckStore.getState().resetDeck();
+ useEventStore.setState({
+ connected: true,
+ voiceReady: true,
+ wsWarming: false,
+ voiceState: "idle",
+ brainProvider: "groq",
+ brainModel: "",
+ assistantName: "Nova",
+ activeSection: "chats",
+ });
+ });
+ afterEach(() => {
+ cleanup();
+ vi.useRealTimers();
+ });
+
+ test("names the phrase to say, listens on the ring, and shows the four gates standing", () => {
+ renderStage("standby");
+ expect(screen.getByTestId("deck-standby").getAttribute("data-phase")).toBe("standby");
+ expect(screen.getByText("standby")).toBeTruthy();
+ expect(screen.getByText("Say “Hey Nova” — or click the orb.")).toBeTruthy();
+ // The wake word is on and the voice is idle: the ring sweeps.
+ expect(screen.getByTestId("deck-standby-ring").getAttribute("data-sweep")).toBe("true");
+ expect(screen.getByTestId("deck-ring-sweep")).toBeTruthy();
+ // Nothing was pending when the stage mounted: no arc draws in, no time is claimed.
+ expect(document.querySelectorAll('.deck-gate-arc[data-fresh="true"]')).toHaveLength(0);
+ const c = console_();
+ expect(c.getByText("connected")).toBeTruthy();
+ expect(c.getByText("groq")).toBeTruthy();
+ expect(c.getByText("listening for the wake word")).toBeTruthy();
+ expect(c.queryByText(/ ms$| s$/)).toBeNull();
+ });
+
+ test("a wake word that is off is said so, and the ring stays still", () => {
+ renderStage("standby", { wakeConfig: { ...WAKE, enabled: false } });
+ expect(console_().getByText(/wake word off/)).toBeTruthy();
+ expect(screen.getByTestId("deck-standby-ring").getAttribute("data-sweep")).toBe("false");
+ expect(screen.queryByTestId("deck-ring-sweep")).toBeNull();
+ expect(console_().getByText("voice idle")).toBeTruthy();
+ });
+
+ test("a brain that never shows up is called absent once the dust settles, and the line opens the keys", () => {
+ vi.useFakeTimers();
+ useEventStore.setState({ brainProvider: "" });
+ renderStage("standby");
+ let c = console_();
+ expect(c.getByText("reading the brain")).toBeTruthy();
+ act(() => {
+ vi.advanceTimersByTime(4_000);
+ });
+ c = console_();
+ const line = c.getByRole("button", { name: /no brain configured/ });
+ fireEvent.click(line);
+ expect(useEventStore.getState().activeSection).toBe("apikeys");
+ // The wake gate settled too — the console reached its last line.
+ expect(c.getByText("listening for “Hey Nova”")).toBeTruthy();
+ });
+
+ test("keeps the sweep off while the voice reports trouble", () => {
+ useEventStore.setState({ voiceState: "error" });
+ renderStage("standby");
+ expect(screen.getByTestId("deck-standby-ring").getAttribute("data-sweep")).toBe("false");
+ expect(console_().getByText(/voice reported an error/)).toBeTruthy();
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/components/deck/DeckStandby.tsx b/jarvis/ui/web/frontend/src/components/deck/DeckStandby.tsx
new file mode 100644
index 0000000000..104b067616
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/deck/DeckStandby.tsx
@@ -0,0 +1,634 @@
+import { useEffect, useId, useMemo, useRef, useState, type CSSProperties, type ReactNode } from "react";
+import { motion, useReducedMotion } from "framer-motion";
+import { useEventStore } from "@/store/events";
+import { useDeckStore } from "@/store/deck";
+import type { WakeWordConfig } from "@/hooks/useWakeWord";
+import type { ThinkingStep } from "@/lib/thinkingSteps";
+import {
+ arcPath,
+ gatesFor,
+ polar,
+ reticleSizeFor,
+ ringSizeFor,
+ ringTicks,
+ GATE_ARC_CENTRE,
+ GATE_ARC_SPAN,
+ SETTLE_MS,
+ type Gate,
+ type GateId,
+ type GateState,
+} from "@/lib/deckStandby";
+import { DeckOrb, type OrbReadouts } from "@/components/deck/DeckOrb";
+import { HudFrameOverlay, HudHaloDefs, useElementSize } from "@/components/deck/HudFrame";
+import { fmtClock, fmtMs, fmtQuiet } from "@/components/deck/DeckLogCard";
+import { cn } from "@/lib/utils";
+import { useT } from "@/i18n";
+
+/**
+ * The deck before the first word — the boot sequence and the standby stage.
+ *
+ * What the maintainer asked for (2026-08-18): the board is good once things
+ * happen, but a fresh start showed nine instruments all saying "nothing yet".
+ * So until somebody speaks the stage is ONE instrument: the orb inside a big
+ * ring, the four gates a voice turn needs drawn on that ring, and a small
+ * console in the corner that reads like a boot log. Everything on it is a
+ * fact from the stores the header lamps already show; the durations are
+ * measured on this very screen (`okAt` against `mountedAt`) and appear only
+ * for gates this screen watched turn true.
+ *
+ * Boot: the ring's ticks ignite clockwise, the bezel draws itself, and each
+ * gate's arc draws in the moment that gate is really true — link, voice,
+ * brain, wake — while its console line types in with the clock time. When
+ * link and voice are both up, one ping leaves the orb and dies at the bezel:
+ * the boot is done.
+ *
+ * Standby: the sweep turns on the ring while the wake word is actually being
+ * listened for (and stays still when it is not — hotkey-only setups, a link
+ * that dropped), the clock and the "quiet for" figure tick, the orb breathes.
+ * The headline names the phrase to say. Nothing else moves: the standby has
+ * to be calm enough to sit next to for an hour.
+ *
+ * The board is one press away at all times (`onOpenBoard`), and takes over
+ * on its own the moment a turn opens — that hand-off is MissionDeckView's,
+ * with this stage's exit choreographed through framer variants (`exit`).
+ */
+
+/** How the orb travels between this ring and its place on the board. */
+export const ORB_TRAVEL = { layout: { duration: 0.62, ease: [0.2, 0.8, 0.2, 1] } } as const;
+/** The ring is labelled at the compass points only when there is room. */
+const LABELS_MIN_RING = 480;
+/** The corner blocks leave the ring's sides alone from this stage width. */
+const WIDE_STAGE = 1040;
+
+export type StandbyPhase = "boot" | "standby";
+
+export function DeckStandby({
+ phase,
+ steps,
+ busy,
+ readouts,
+ wakeConfig,
+ onPressOrb,
+ pressLabel,
+ pressDisabled,
+ onOpenBoard,
+ className,
+}: {
+ phase: StandbyPhase;
+ steps: ThinkingStep[];
+ busy: boolean;
+ readouts: OrbReadouts;
+ wakeConfig: WakeWordConfig | null;
+ onPressOrb: () => void;
+ pressLabel: string;
+ pressDisabled: boolean;
+ onOpenBoard: () => void;
+ className?: string;
+}) {
+ const t = useT();
+ const reduced = useReducedMotion() ?? false;
+ const connected = useEventStore((s) => s.connected);
+ const voiceReady = useEventStore((s) => s.voiceReady);
+ const voiceState = useEventStore((s) => s.voiceState);
+ const brainProvider = useEventStore((s) => s.brainProvider);
+ const brainModel = useEventStore((s) => s.brainModel);
+ const assistantName = useEventStore((s) => s.assistantName);
+ const setActiveSection = useEventStore((s) => s.setActiveSection);
+ const journal = useDeckStore((s) => s.journal);
+
+ // One clock for the stage: the corner clock, "quiet for", and the settle
+ // timer all read it, so the stage ticks as one thing.
+ const [now, setNow] = useState(() => Date.now());
+ useEffect(() => {
+ const id = window.setInterval(() => setNow(Date.now()), 1000);
+ return () => window.clearInterval(id);
+ }, []);
+
+ // What this screen watched: gates that were pending when it mounted, and
+ // when each turned true. Only THOSE get a duration — a gate that was
+ // already up when the stage appeared has no honest time to show.
+ const mountedAt = useRef(Date.now());
+ const [okAt, setOkAt] = useState<Partial<Record<GateId, number>>>({});
+ const [readyAt, setReadyAt] = useState<number | null>(null);
+ // Whether the boot played on this screen — the ignition and the ping fire
+ // only then; a stage that mounts already-ready is simply on.
+ const ignite = useRef(phase === "boot").current;
+
+ const settled = readyAt !== null && now - readyAt >= SETTLE_MS;
+ const gates = useMemo(
+ () =>
+ gatesFor({
+ connected,
+ voiceReady,
+ brainProvider,
+ wakeEnabled: wakeConfig ? wakeConfig.enabled : null,
+ settled,
+ }),
+ [connected, voiceReady, brainProvider, wakeConfig, settled],
+ );
+ // Fixed on the first render, so the very first paint already knows which
+ // lines and arcs are the ones to watch draw in.
+ const [pendingAtMount] = useState(
+ () => new Set<GateId>(gates.filter((g) => g.state !== "ok").map((g) => g.id)),
+ );
+
+ useEffect(() => {
+ const ts = Date.now();
+ setOkAt((prev) => {
+ let next = prev;
+ for (const g of gates) {
+ if (g.state === "ok" && prev[g.id] === undefined) {
+ if (next === prev) next = { ...prev };
+ next[g.id] = ts;
+ }
+ }
+ return next;
+ });
+ if (connected && voiceReady) setReadyAt((r) => (r === null ? ts : r));
+ }, [gates, connected, voiceReady]);
+
+ const [stageRef, stage] = useElementSize<HTMLDivElement>();
+ const wide = stage.w >= WIDE_STAGE;
+ const ring = wide
+ ? ringSizeFor(stage.w, stage.h)
+ : ringSizeFor(stage.w, Math.max(0, stage.h - 200));
+ const reticle = reticleSizeFor(ring);
+
+ const wakePhrase = wakeConfig?.phrase.trim() || assistantName;
+ const listening =
+ phase === "standby" &&
+ connected &&
+ voiceReady &&
+ voiceState === "idle" &&
+ gates.find((g) => g.id === "wake")?.state === "ok";
+
+ const lastJournalTs = journal.length > 0 ? journal[journal.length - 1].ts : null;
+ const quietSince = lastJournalTs ?? readyAt ?? mountedAt.current;
+ const quiet = now - quietSince;
+
+ const gateText = (g: Gate): { text: string; onClick?: () => void } => {
+ switch (g.id) {
+ case "link":
+ return { text: t(g.state === "ok" ? "deck.boot_link_ok" : "deck.boot_link_pending") };
+ case "voice":
+ return { text: t(g.state === "ok" ? "deck.boot_voice_ok" : "deck.boot_voice_pending") };
+ case "brain":
+ if (g.state === "ok") return { text: brainModel ? `${brainProvider} · ${brainModel}` : brainProvider };
+ if (g.state === "off") return { text: t("deck.boot_brain_off"), onClick: () => setActiveSection("apikeys") };
+ return { text: t("deck.boot_brain_pending") };
+ case "wake":
+ if (g.state === "ok") return { text: t("deck.boot_wake_ok").replace("{0}", wakePhrase) };
+ if (g.state === "off") return { text: t("deck.boot_wake_off") };
+ return { text: t("deck.boot_wake_pending") };
+ }
+ };
+
+ // The console shows the gates in boot order, one after the other: a line
+ // appears once every line before it has left "pending" — the way a boot
+ // log grows. A later gate that is already true waits its turn (seconds at
+ // most) rather than jumping the queue and scrambling the order.
+ const shownGates = useMemo(() => {
+ const out: Gate[] = [];
+ for (const g of gates) {
+ out.push(g);
+ if (g.state === "pending") break;
+ }
+ return out;
+ }, [gates]);
+
+ const headline =
+ phase === "boot" ? null : t("deck.idle_headline").replace("{0}", wakePhrase);
+
+ const corner = (extra: string, children: ReactNode) => (
+ <div className={cn("absolute z-10", extra)}>{children}</div>
+ );
+
+ return (
+ <motion.div
+ ref={stageRef}
+ data-testid="deck-standby"
+ data-phase={phase}
+ className={cn("relative overflow-hidden", className)}
+ variants={{ hidden: {}, show: { opacity: 1 }, exit: { opacity: 0, transition: { duration: 0.32, delay: 0.08 } } }}
+ initial={ignite && !reduced ? "hidden" : "show"}
+ animate="show"
+ exit="exit"
+ >
+ <HudFrameOverlay variant="bracket" w={stage.w} h={stage.h} live={phase === "standby"} />
+
+ {/* The instrument: the ring with the orb in it, centred on the stage. */}
+ <div className={cn("absolute inset-0 grid", wide ? "place-items-center" : "place-items-start justify-items-center pt-3")}>
+ <div className="relative" style={{ width: ring, height: ring }}>
+ {/* On the hand-off the ring folds into the orb while the corners slide out. */}
+ <motion.div
+ className="absolute inset-0"
+ variants={{ exit: { scale: 0.62, opacity: 0, transition: { duration: 0.45, ease: "easeIn" } } }}
+ >
+ <StandbyRing
+ size={ring}
+ gates={gates}
+ fresh={pendingAtMount}
+ ignite={ignite}
+ sweep={Boolean(listening) && !reduced}
+ ping={ignite && readyAt !== null && !reduced ? readyAt : null}
+ labels={ring >= LABELS_MIN_RING ? (id) => t(`deck.boot_gate_${id}`) : undefined}
+ reticle={reticle}
+ />
+ </motion.div>
+
+ <div className="absolute inset-0 grid place-items-center">
+ <motion.div
+ layoutId="deck-orb"
+ layoutDependency={reticle}
+ transition={ORB_TRAVEL}
+ variants={{
+ hidden: { opacity: 0, scale: 0.9 },
+ show: { opacity: 1, scale: 1, transition: { duration: 0.9, ease: [0.2, 0.7, 0.2, 1] } },
+ }}
+ >
+ <DeckOrb
+ steps={steps}
+ busy={busy}
+ size={reticle}
+ readouts={readouts}
+ onPress={onPressOrb}
+ pressLabel={pressLabel}
+ pressDisabled={pressDisabled}
+ />
+ </motion.div>
+ </div>
+
+ {/* Under the reticle, inside the ring: the boot title, then the phrase to say. */}
+ <div
+ className="absolute inset-x-0 flex justify-center px-6 text-center"
+ style={{ top: ring / 2 + reticle / 2 + 12 }}
+ >
+ {phase === "boot" ? (
+ <BootTitle text={t("deck.boot_title")} animate={!reduced} />
+ ) : (
+ <motion.p
+ key="idle"
+ variants={{
+ hidden: { opacity: 0, y: 6 },
+ show: { opacity: 1, y: 0, transition: { duration: 0.5, delay: 0.3 } },
+ exit: { opacity: 0, y: 6, transition: { duration: 0.2 } },
+ }}
+ className="max-w-[40ch] text-pretty text-sm leading-relaxed text-muted-foreground"
+ >
+ {headline}
+ </motion.p>
+ )}
+ </div>
+ </div>
+ </div>
+
+ {/* Top left: which act this is, and the clock. */}
+ {corner(
+ wide ? "left-5 top-4" : "left-4 top-3",
+ <motion.div
+ variants={{ exit: { opacity: 0, x: -14, transition: { duration: 0.25 } } }}
+ className="flex flex-col gap-0.5"
+ >
+ <span
+ className={cn(
+ "font-mono text-[10px] uppercase tracking-[0.22em]",
+ phase === "boot" ? "text-muted-foreground" : "text-primary",
+ )}
+ >
+ {t(phase === "boot" ? "deck.boot_phase" : "deck.standby_phase")}
+ {phase === "boot" && <span className="deck-boot-caret ml-1 inline-block h-[1em] w-[0.5em] translate-y-[2px] bg-current" aria-hidden />}
+ </span>
+ <span className="font-mono text-3xl font-semibold tabular-nums leading-none text-foreground" data-testid="deck-standby-clock">
+ {fmtClock(now)}
+ </span>
+ {readyAt !== null && (
+ <span className="font-mono text-[10px] tabular-nums tracking-[0.12em] text-muted-foreground">
+ {t("deck.standby_since").replace("{0}", fmtClock(readyAt))}
+ </span>
+ )}
+ </motion.div>,
+ )}
+
+ {/* Bottom left: the console — the boot log, then the cursor. */}
+ {corner(
+ wide ? "bottom-4 left-5 max-w-[320px]" : "inset-x-4 bottom-14",
+ <motion.div
+ variants={{ exit: { opacity: 0, x: -14, transition: { duration: 0.25 } } }}
+ className="font-mono text-[10.5px] leading-[1.6]"
+ data-testid="deck-boot-console"
+ >
+ {shownGates.map((g) => {
+ const { text, onClick } = gateText(g);
+ const seen = pendingAtMount.has(g.id);
+ const at = okAt[g.id];
+ const ms = seen && at !== undefined ? at - mountedAt.current : null;
+ return (
+ <div
+ key={g.id}
+ className="deck-boot-line flex items-baseline gap-2"
+ data-fresh={seen && !reduced ? "true" : "false"}
+ data-gate={g.id}
+ data-state={g.state}
+ >
+ <span className="shrink-0 tabular-nums text-muted-foreground/70">
+ {fmtClock(at ?? now)}
+ </span>
+ <span className={cn("w-[6ch] shrink-0 uppercase tracking-[0.08em]", TAG_TONE[g.state])}>
+ {t(`deck.boot_gate_${g.id}`)}
+ </span>
+ {onClick ? (
+ <button
+ type="button"
+ onClick={onClick}
+ className={cn("min-w-0 truncate text-left underline-offset-2 hover:underline", TEXT_TONE[g.state])}
+ >
+ {text}
+ </button>
+ ) : (
+ <span className={cn("min-w-0 truncate", TEXT_TONE[g.state])}>{text}</span>
+ )}
+ {g.state === "pending" ? (
+ <span className="deck-boot-dots shrink-0 text-muted-foreground" aria-hidden>
+ <span>·</span>
+ <span>·</span>
+ <span>·</span>
+ </span>
+ ) : ms !== null && ms >= 50 ? (
+ <span className="ml-auto shrink-0 pl-2 tabular-nums text-muted-foreground">{fmtMs(ms)}</span>
+ ) : null}
+ </div>
+ );
+ })}
+ {phase === "standby" && (
+ <div className="mt-1 flex items-baseline gap-2">
+ <span className="shrink-0 tabular-nums text-muted-foreground/70">{fmtClock(now)}</span>
+ <span className="inline-block h-[1.1em] w-[0.55em] shrink-0 self-center bg-foreground/60 motion-safe:animate-pulse" aria-hidden />
+ <span className="min-w-0 text-foreground/80">
+ {t(
+ listening
+ ? "deck.log_now_idle"
+ : !connected
+ ? "deck.log_now_offline"
+ : voiceState === "error"
+ ? "deck.standby_error"
+ : "deck.standby_still",
+ )}
+ {quiet > 5_000 && (
+ <span className="text-muted-foreground/70">
+ {" · "}
+ {t("deck.log_quiet_for").replace("{0}", fmtQuiet(quiet))}
+ </span>
+ )}
+ </span>
+ </div>
+ )}
+ </motion.div>,
+ )}
+
+ {/* Bottom right: the board, one press away. */}
+ {corner(
+ wide ? "bottom-4 right-5 text-right" : "bottom-3 right-4 text-right",
+ <motion.div
+ variants={{ exit: { opacity: 0, x: 14, transition: { duration: 0.25 } } }}
+ className="flex flex-col items-end gap-1.5"
+ >
+ {wide && (
+ <span className="max-w-[28ch] text-pretty text-[11px] leading-snug text-muted-foreground">
+ {t("deck.standby_hint")}
+ </span>
+ )}
+ <button
+ type="button"
+ onClick={onOpenBoard}
+ className="border border-border px-2.5 py-1 font-mono text-[10px] uppercase tracking-[0.14em] text-muted-foreground transition-colors hover:border-primary/50 hover:text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/60"
+ style={{ clipPath: "polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px)" }}
+ >
+ {t("deck.open_board")}
+ </button>
+ </motion.div>,
+ )}
+ </motion.div>
+ );
+}
+
+// Signal colours in PAIRS — a tint on black, its deep twin on paper.
+const TAG_TONE: Record<GateState, string> = {
+ pending: "text-muted-foreground",
+ ok: "text-primary",
+ off: "text-amber-700 dark:text-amber-300",
+};
+const TEXT_TONE: Record<GateState, string> = {
+ pending: "text-foreground/70",
+ ok: "text-foreground/90",
+ off: "text-amber-700 dark:text-amber-300",
+};
+
+/** The boot title: the name, letter by letter, in the display face. */
+function BootTitle({ text, animate }: { text: string; animate: boolean }) {
+ const letters = Array.from(text.toUpperCase());
+ return (
+ <p
+ className="font-display text-base font-bold uppercase tracking-[0.32em] text-foreground sm:text-lg"
+ data-testid="deck-boot-title"
+ aria-label={text}
+ >
+ {letters.map((ch, i) => (
+ <span
+ key={`${i}-${ch}`}
+ aria-hidden
+ className={animate ? "deck-boot-letter" : undefined}
+ style={animate ? { animationDelay: `${180 + i * 38}ms` } : undefined}
+ >
+ {ch === " " ? " " : ch}
+ </span>
+ ))}
+ </p>
+ );
+}
+
+/**
+ * The big ring — the standby's instrument.
+ *
+ * Bezel, tick scale, the four gate arcs at the compass points (dashed while
+ * pending, drawn solid when true, dim and short when honestly off), the
+ * sweep while the wake word is being listened for, and the one-shot ping.
+ * All strokes are theme gold under the HUD halo so they read on any
+ * wallpaper in either appearance.
+ */
+function StandbyRing({
+ size,
+ gates,
+ fresh,
+ ignite,
+ sweep,
+ ping,
+ labels,
+ reticle,
+}: {
+ size: number;
+ gates: Gate[];
+ /** Gates that were pending when the stage mounted — their arcs draw in. */
+ fresh: Set<GateId>;
+ ignite: boolean;
+ sweep: boolean;
+ /** Timestamp of the boot's completion, or null — keys the one-shot ping. */
+ ping: number | null;
+ labels?: (id: GateId) => string;
+ reticle: number;
+}) {
+ const haloId = useId();
+ const C = size / 2;
+ const R = C - 2;
+ const ticks = useMemo(() => ringTicks(3), []);
+ const stroke = "hsl(var(--primary))";
+ const tickOpacity = [0.3, 0.55, 0.9] as const;
+
+ return (
+ <svg
+ viewBox={`0 0 ${size} ${size}`}
+ className="absolute inset-0 h-full w-full"
+ aria-hidden
+ data-testid="deck-standby-ring"
+ data-sweep={sweep ? "true" : "false"}
+ >
+ <HudHaloDefs id={haloId} />
+ <g filter={`url(#${haloId})`}>
+ {/* bezel */}
+ <circle
+ className="deck-ring-bezel"
+ data-ignite={ignite ? "true" : "false"}
+ cx={C}
+ cy={C}
+ r={R * 0.985}
+ pathLength={1}
+ fill="none"
+ stroke={stroke}
+ strokeWidth={1}
+ opacity={0.38}
+ style={{ transform: "rotate(-90deg)", transformOrigin: "center", transformBox: "fill-box" }}
+ />
+
+ {/* tick scale — ignites clockwise on boot */}
+ {ticks.map((tk, i) => {
+ const [ax, ay] = polar(C, C, R * 0.985, tk.deg);
+ const inner = tk.weight === 2 ? 0.925 : tk.weight === 1 ? 0.945 : 0.965;
+ const [bx, by] = polar(C, C, R * inner, tk.deg);
+ return (
+ <line
+ key={tk.deg}
+ className="deck-ring-tick"
+ data-ignite={ignite ? "true" : "false"}
+ x1={ax}
+ y1={ay}
+ x2={bx}
+ y2={by}
+ stroke={stroke}
+ strokeWidth={tk.weight === 2 ? 1.5 : 1}
+ style={
+ {
+ "--tick-opacity": tickOpacity[tk.weight],
+ opacity: "var(--tick-opacity)",
+ animationDelay: ignite ? `${i * 9}ms` : undefined,
+ } as CSSProperties
+ }
+ />
+ );
+ })}
+
+ {/* gate arcs at the compass points */}
+ {gates.map((g) => {
+ const centre = GATE_ARC_CENTRE[g.id];
+ const half = (g.state === "off" ? GATE_ARC_SPAN * 0.35 : GATE_ARC_SPAN) / 2;
+ const d = arcPath(C, C, R * 0.905, centre - half, centre + half);
+ return (
+ <path
+ key={g.id}
+ className="deck-gate-arc"
+ data-gate={g.id}
+ data-state={g.state}
+ data-fresh={fresh.has(g.id) ? "true" : "false"}
+ d={d}
+ pathLength={1}
+ fill="none"
+ stroke={stroke}
+ strokeWidth={g.state === "ok" ? 2.5 : 1.5}
+ strokeDasharray={g.state === "pending" ? "0.012 0.03" : undefined}
+ opacity={g.state === "ok" ? 0.95 : g.state === "off" ? 0.45 : 0.3}
+ strokeLinecap="butt"
+ />
+ );
+ })}
+
+ {/* labels inside the arcs */}
+ {labels &&
+ gates.map((g) => {
+ const centre = GATE_ARC_CENTRE[g.id];
+ const [lx, ly] = polar(C, C, R * 0.845, centre);
+ return (
+ <text
+ key={g.id}
+ x={lx}
+ y={ly}
+ textAnchor="middle"
+ dominantBaseline="middle"
+ className="font-mono uppercase"
+ style={{ fontSize: 9, letterSpacing: "0.18em" }}
+ fill={g.state === "ok" ? "hsl(var(--primary))" : "hsl(var(--muted-foreground))"}
+ opacity={g.state === "pending" ? 0.7 : 0.95}
+ >
+ {labels(g.id)}
+ </text>
+ );
+ })}
+
+ {/* the sweep — a head and a fading trail, turning while listening */}
+ {sweep && (
+ <g className="deck-ring-sweep" data-testid="deck-ring-sweep">
+ {Array.from({ length: 12 }, (_, i) => {
+ const a1 = -i * 3;
+ const a0 = a1 - 3.2;
+ return (
+ <path
+ key={i}
+ d={arcPath(C, C, R * 0.965, a0, a1)}
+ fill="none"
+ stroke={stroke}
+ strokeWidth={i === 0 ? 3 : 2}
+ opacity={(0.9 * (12 - i)) / 12}
+ strokeLinecap="butt"
+ />
+ );
+ })}
+ </g>
+ )}
+
+ {/* the ping — once, when the boot completes */}
+ {ping !== null && (
+ <circle
+ key={ping}
+ className="deck-ring-ping"
+ cx={C}
+ cy={C}
+ r={R * 0.985}
+ fill="none"
+ stroke={stroke}
+ strokeWidth={1.5}
+ style={{ transformOrigin: "center", transformBox: "fill-box" }}
+ />
+ )}
+ </g>
+
+ {/* a faint scale between reticle and arcs — the ring's inner edge */}
+ <circle
+ cx={C}
+ cy={C}
+ r={Math.max(reticle / 2 + 18, R * 0.62)}
+ fill="none"
+ stroke={stroke}
+ strokeWidth={1}
+ strokeDasharray="2 8"
+ opacity={0.22}
+ />
+ </svg>
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index 0eae5c6d20..4fd80fa00f 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -4485,7 +4485,28 @@
"ide_state_asking": "fragt dich",
"ide_state_failed": "fehlgeschlagen",
"ide_state_exited": "beendet",
- "ide_state_idle": "ruht"
+ "ide_state_idle": "ruht",
+ "boot_phase": "Startsequenz",
+ "standby_phase": "Bereitschaft",
+ "boot_title": "{name} startet",
+ "boot_gate_link": "Link",
+ "boot_gate_voice": "Stimme",
+ "boot_gate_brain": "Brain",
+ "boot_gate_wake": "Wake",
+ "boot_link_pending": "verbinde mit dem Assistenten",
+ "boot_link_ok": "verbunden",
+ "boot_voice_pending": "Sprachsystem startet",
+ "boot_voice_ok": "Stimme bereit",
+ "boot_brain_pending": "lese das Brain",
+ "boot_brain_off": "kein Brain eingerichtet – API-Keys öffnen",
+ "boot_wake_pending": "schärfe das Wake-Word",
+ "boot_wake_ok": "höre auf „{0}“",
+ "boot_wake_off": "Wake-Word aus – der Orb oder der Hotkey startet ein Gespräch",
+ "standby_since": "seit {0}",
+ "standby_still": "Stimme ruht",
+ "standby_error": "Stimme meldet einen Fehler – siehe Log",
+ "standby_hint": "Das Board öffnet sich, sobald du sprichst.",
+ "open_board": "Board öffnen"
},
"modes_view": {
"title": "Modi",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index 3ec486894e..1751c86485 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -4485,7 +4485,28 @@
"ide_state_asking": "asking you",
"ide_state_failed": "failed",
"ide_state_exited": "exited",
- "ide_state_idle": "idle"
+ "ide_state_idle": "idle",
+ "boot_phase": "boot sequence",
+ "standby_phase": "standby",
+ "boot_title": "{name} starting",
+ "boot_gate_link": "link",
+ "boot_gate_voice": "voice",
+ "boot_gate_brain": "brain",
+ "boot_gate_wake": "wake",
+ "boot_link_pending": "connecting to the assistant",
+ "boot_link_ok": "connected",
+ "boot_voice_pending": "voice stack starting",
+ "boot_voice_ok": "voice ready",
+ "boot_brain_pending": "reading the brain",
+ "boot_brain_off": "no brain configured — open API keys",
+ "boot_wake_pending": "arming the wake word",
+ "boot_wake_ok": "listening for “{0}”",
+ "boot_wake_off": "wake word off — the orb or the hotkey starts a talk",
+ "standby_since": "since {0}",
+ "standby_still": "voice idle",
+ "standby_error": "voice reported an error — see the log",
+ "standby_hint": "The board opens the moment you speak.",
+ "open_board": "Open the board"
},
"modes_view": {
"title": "Modes",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index ec55c20ffd..7fa08a474c 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -4485,7 +4485,28 @@
"ide_state_asking": "te pregunta",
"ide_state_failed": "falló",
"ide_state_exited": "terminado",
- "ide_state_idle": "inactivo"
+ "ide_state_idle": "inactivo",
+ "boot_phase": "secuencia de arranque",
+ "standby_phase": "en espera",
+ "boot_title": "{name} arrancando",
+ "boot_gate_link": "enlace",
+ "boot_gate_voice": "voz",
+ "boot_gate_brain": "cerebro",
+ "boot_gate_wake": "wake",
+ "boot_link_pending": "conectando con el asistente",
+ "boot_link_ok": "conectado",
+ "boot_voice_pending": "arrancando el sistema de voz",
+ "boot_voice_ok": "voz lista",
+ "boot_brain_pending": "leyendo el cerebro",
+ "boot_brain_off": "sin cerebro configurado — abre las claves API",
+ "boot_wake_pending": "armando la palabra de activación",
+ "boot_wake_ok": "escuchando «{0}»",
+ "boot_wake_off": "palabra de activación apagada — el orbe o el atajo inician la charla",
+ "standby_since": "desde {0}",
+ "standby_still": "voz en reposo",
+ "standby_error": "la voz reportó un error — mira el registro",
+ "standby_hint": "El tablero se abre en cuanto hables.",
+ "open_board": "Abrir el tablero"
},
"modes_view": {
"title": "Modos",
diff --git a/jarvis/ui/web/frontend/src/lib/deckStandby.test.ts b/jarvis/ui/web/frontend/src/lib/deckStandby.test.ts
new file mode 100644
index 0000000000..6c0162d5af
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/lib/deckStandby.test.ts
@@ -0,0 +1,167 @@
+import { describe, expect, test } from "vitest";
+import {
+ arcPath,
+ gatesFor,
+ polar,
+ resolvePhase,
+ reticleSizeFor,
+ revealDelayMs,
+ ringSizeFor,
+ ringTicks,
+ type GateInput,
+ type PhaseInput,
+} from "@/lib/deckStandby";
+
+/**
+ * The deck's opening act (2026-08-18): boot while the app comes up, standby
+ * until somebody speaks, the board from the first turn on — forward only.
+ */
+
+const READY: PhaseInput = {
+ connected: true,
+ voiceReady: true,
+ boardOpen: false,
+ turnIndex: 0,
+ messageCount: 0,
+ voiceEngaged: false,
+};
+
+describe("resolvePhase", () => {
+ test("boots while the link or the voice stack is still coming up", () => {
+ expect(resolvePhase({ ...READY, connected: false, voiceReady: false })).toBe("boot");
+ expect(resolvePhase({ ...READY, connected: true, voiceReady: false })).toBe("boot");
+ expect(resolvePhase({ ...READY, connected: false, voiceReady: true })).toBe("boot");
+ });
+
+ test("stands by once both are up and nobody has spoken", () => {
+ expect(resolvePhase(READY)).toBe("standby");
+ });
+
+ test("the first turn opens the board", () => {
+ expect(resolvePhase({ ...READY, turnIndex: 1 })).toBe("board");
+ });
+
+ test("a conversation that already exists is the board, however it started", () => {
+ expect(resolvePhase({ ...READY, messageCount: 2 })).toBe("board");
+ });
+
+ test("reaching for the voice — a call being set up or live — is the board", () => {
+ expect(resolvePhase({ ...READY, voiceEngaged: true })).toBe("board");
+ });
+
+ test("opening the board by hand wins, even mid-boot", () => {
+ expect(resolvePhase({ ...READY, connected: false, voiceReady: false, boardOpen: true })).toBe("board");
+ });
+
+ test("a person mid-conversation is never sent back to the start screen", () => {
+ // The link dropped for a moment: the board holds.
+ expect(resolvePhase({ ...READY, connected: false, turnIndex: 3 })).toBe("board");
+ });
+});
+
+const GATES_START: GateInput = {
+ connected: false,
+ voiceReady: false,
+ brainProvider: "",
+ wakeEnabled: null,
+ settled: false,
+};
+
+function state(gates: ReturnType<typeof gatesFor>): string[] {
+ return gates.map((g) => `${g.id}:${g.state}`);
+}
+
+describe("gatesFor", () => {
+ test("everything is pending before the link is up", () => {
+ expect(state(gatesFor(GATES_START))).toEqual([
+ "link:pending",
+ "voice:pending",
+ "brain:pending",
+ "wake:pending",
+ ]);
+ });
+
+ test("the gates light in boot order — link, voice, then the facts", () => {
+ expect(state(gatesFor({ ...GATES_START, connected: true }))).toEqual([
+ "link:ok",
+ "voice:pending",
+ "brain:pending",
+ "wake:pending",
+ ]);
+ expect(
+ state(gatesFor({ ...GATES_START, connected: true, voiceReady: true, brainProvider: "openrouter", wakeEnabled: true })),
+ ).toEqual(["link:ok", "voice:ok", "brain:ok", "wake:ok"]);
+ });
+
+ test("a brain that is known before the voice is up is ok already", () => {
+ expect(state(gatesFor({ ...GATES_START, connected: true, brainProvider: "groq" }))[2]).toBe("brain:ok");
+ });
+
+ test("the wake fact waits for the boot: a switched-off wake word is 'off', not pending", () => {
+ expect(state(gatesFor({ ...GATES_START, connected: true, wakeEnabled: false }))[3]).toBe("wake:pending");
+ expect(state(gatesFor({ ...GATES_START, connected: true, voiceReady: true, wakeEnabled: false }))[3]).toBe(
+ "wake:off",
+ );
+ });
+
+ test("a fact that never arrives is called absent once the dust has settled", () => {
+ const up = { ...GATES_START, connected: true, voiceReady: true };
+ expect(state(gatesFor(up)).slice(2)).toEqual(["brain:pending", "wake:pending"]);
+ expect(state(gatesFor({ ...up, settled: true })).slice(2)).toEqual(["brain:off", "wake:off"]);
+ });
+
+ test("settling never marks anything absent while the boot is still on", () => {
+ expect(state(gatesFor({ ...GATES_START, connected: true, settled: true })).slice(2)).toEqual([
+ "brain:pending",
+ "wake:pending",
+ ]);
+ });
+});
+
+describe("ring geometry", () => {
+ test("polar puts 0° at twelve o'clock and turns clockwise", () => {
+ const [x0, y0] = polar(100, 100, 50, 0);
+ expect(x0).toBeCloseTo(100);
+ expect(y0).toBeCloseTo(50);
+ const [x90, y90] = polar(100, 100, 50, 90);
+ expect(x90).toBeCloseTo(150);
+ expect(y90).toBeCloseTo(100);
+ });
+
+ test("arcPath takes the large-arc flag past 180°", () => {
+ expect(arcPath(100, 100, 50, 0, 90)).toBe("M 100 50 A 50 50 0 0 1 150 100");
+ expect(arcPath(100, 100, 50, 0, 270)).toMatch(/A 50 50 0 1 1 /);
+ });
+
+ test("ticks are weighted every 15° and every 90°", () => {
+ const ticks = ringTicks(3);
+ expect(ticks).toHaveLength(120);
+ expect(ticks.find((t) => t.deg === 0)?.weight).toBe(2);
+ expect(ticks.find((t) => t.deg === 15)?.weight).toBe(1);
+ expect(ticks.find((t) => t.deg === 3)?.weight).toBe(0);
+ expect(ticks.filter((t) => t.weight === 2)).toHaveLength(4);
+ });
+});
+
+describe("sizing", () => {
+ test("the ring fills the shorter side of the stage, within bounds", () => {
+ expect(ringSizeFor(0, 0)).toBe(760);
+ expect(ringSizeFor(1200, 700)).toBe(660);
+ expect(ringSizeFor(400, 900)).toBe(360);
+ expect(ringSizeFor(200, 200)).toBe(260);
+ expect(ringSizeFor(2000, 2000)).toBe(760);
+ });
+
+ test("the reticle is a little over half the ring, within its own bounds", () => {
+ expect(reticleSizeFor(660)).toBe(396);
+ expect(reticleSizeFor(260)).toBe(200);
+ expect(reticleSizeFor(760)).toBe(420);
+ });
+
+ test("the board reveals from the centre outward", () => {
+ expect(revealDelayMs("centre-top")).toBeLessThan(revealDelayMs("centre-bottom"));
+ expect(revealDelayMs("centre-bottom")).toBeLessThan(revealDelayMs("left-top"));
+ expect(revealDelayMs("left-top")).toBe(revealDelayMs("right-top"));
+ expect(revealDelayMs("left-bottom")).toBeGreaterThan(revealDelayMs("right-top"));
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/lib/deckStandby.ts b/jarvis/ui/web/frontend/src/lib/deckStandby.ts
new file mode 100644
index 0000000000..ddff20ed81
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/lib/deckStandby.ts
@@ -0,0 +1,234 @@
+/**
+ * The deck's opening — boot, standby, and the moment the board takes over.
+ *
+ * Before the first turn the mission deck used to show the full board: nine
+ * instruments, most of them saying "nothing yet". The maintainer's verdict
+ * (2026-08-18): boring, and worse at the very start, when the app is still
+ * coming up. So the deck now has THREE phases and one honest rule for moving
+ * between them:
+ *
+ * boot — the link or the voice stack is not up yet. The stage shows
+ * the start sequence: the four gates a voice turn needs (link,
+ * voice, brain, wake), each one lighting up the moment it is
+ * really true, with the time it took.
+ * standby — everything is up, nobody has spoken. The stage is the big
+ * instrument: the orb in a ring that listens, and the same four
+ * gates as standing readouts.
+ * board — the mission control board. Reached the moment a turn opens
+ * (a wake word, a hotkey, a typed message, a press on the orb),
+ * or when the person opens it by hand — and then it STAYS: the
+ * phases only ever move forward within a session, because a
+ * stage that flips back and forth is a stage nobody can read.
+ *
+ * Nothing here is invented: every gate is a store field the header lamps
+ * already show, and the durations are measured on this very screen. Pure
+ * module — no React, no timers — so deckStandby.test.ts can pin all of it.
+ */
+
+export type DeckPhase = "boot" | "standby" | "board";
+
+export type GateId = "link" | "voice" | "brain" | "wake";
+
+/**
+ * `pending` — not true yet (still starting, or waiting on the ones before it).
+ * `ok` — true.
+ * `off` — the ones before it are up and this one is honestly not coming:
+ * no brain configured, wake word switched off. Not a failure of
+ * the boot; a fact of the setup, shown as one.
+ */
+export type GateState = "pending" | "ok" | "off";
+
+export interface Gate {
+ id: GateId;
+ state: GateState;
+}
+
+export const GATE_ORDER: readonly GateId[] = ["link", "voice", "brain", "wake"];
+
+export interface GateInput {
+ connected: boolean;
+ voiceReady: boolean;
+ /** The active brain provider, "" while unknown or unset. */
+ brainProvider: string;
+ /** null while the wake-word config has not been read; otherwise the switch. */
+ wakeEnabled: boolean | null;
+ /**
+ * True once the boot has been complete (link + voice) for long enough that
+ * a brain or wake fact still missing is a real absence, not a fetch that
+ * has not landed. Owned by the caller's clock so this stays pure.
+ */
+ settled: boolean;
+}
+
+/**
+ * The four gates, in the order the boot lights them.
+ *
+ * Link and voice are the app's own: they are pending until true, and the
+ * boot lasts exactly as long as either is pending. Brain and wake are
+ * configuration: pending while the boot is still on or the facts are still
+ * arriving, then `ok`, or `off` once the caller says the dust has settled.
+ */
+export function gatesFor(input: GateInput): Gate[] {
+ const bootDone = input.connected && input.voiceReady;
+ const brain: GateState = input.brainProvider
+ ? "ok"
+ : bootDone && input.settled
+ ? "off"
+ : "pending";
+ let wake: GateState = "pending";
+ if (bootDone) {
+ if (input.wakeEnabled === true) wake = "ok";
+ else if (input.wakeEnabled === false) wake = "off";
+ else if (input.settled) wake = "off";
+ }
+ return [
+ { id: "link", state: input.connected ? "ok" : "pending" },
+ { id: "voice", state: input.voiceReady ? "ok" : "pending" },
+ { id: "brain", state: brain },
+ { id: "wake", state: wake },
+ ];
+}
+
+export interface PhaseInput {
+ connected: boolean;
+ voiceReady: boolean;
+ /** The person (or the deck itself) opened the board — sticky for the session. */
+ boardOpen: boolean;
+ /** Turns opened this session (deck store); 0 before the first. */
+ turnIndex: number;
+ /** Chat messages in the store — a conversation exists, however it started. */
+ messageCount: number;
+ /** A voice call is live, being set up, or paused: the person reached for it. */
+ voiceEngaged: boolean;
+}
+
+/**
+ * Which phase the deck shows.
+ *
+ * Forward only: any sign of a conversation — a turn, a message, a live call,
+ * or the explicit "open the board" — is the board, whatever the boot says
+ * (a person mid-conversation must never be sent back to a start screen).
+ * Without any of that, the boot holds until link and voice are both up, and
+ * then the standby holds until somebody speaks.
+ */
+export function resolvePhase(input: PhaseInput): DeckPhase {
+ if (input.boardOpen || input.turnIndex > 0 || input.messageCount > 0 || input.voiceEngaged) {
+ return "board";
+ }
+ return input.connected && input.voiceReady ? "standby" : "boot";
+}
+
+/**
+ * How long after link + voice are up the boot console stops waiting for the
+ * brain and wake facts and calls a missing one absent.
+ */
+export const SETTLE_MS = 3_000;
+
+/* ------------------------------------------------------------------ */
+/* Ring geometry — the big instrument the standby stage draws */
+/* ------------------------------------------------------------------ */
+
+/** A point on a circle, 0° at twelve o'clock, clockwise (screen coordinates). */
+export function polar(cx: number, cy: number, r: number, deg: number): [number, number] {
+ const rad = ((deg - 90) * Math.PI) / 180;
+ return [cx + r * Math.cos(rad), cy + r * Math.sin(rad)];
+}
+
+/**
+ * The SVG path of an arc from `a0` to `a1` degrees (clockwise) at radius `r`.
+ * Spans of 180° and more take the large-arc flag; a full circle is the
+ * caller's job (draw a circle).
+ */
+export function arcPath(cx: number, cy: number, r: number, a0: number, a1: number): string {
+ const [x0, y0] = polar(cx, cy, r, a0);
+ const [x1, y1] = polar(cx, cy, r, a1);
+ const large = a1 - a0 > 180 ? 1 : 0;
+ return `M ${fmt(x0)} ${fmt(y0)} A ${fmt(r)} ${fmt(r)} 0 ${large} 1 ${fmt(x1)} ${fmt(y1)}`;
+}
+
+function fmt(n: number): string {
+ return Number.isInteger(n) ? String(n) : n.toFixed(2);
+}
+
+/** Where each gate's arc sits on the ring: centred on the compass points. */
+export const GATE_ARC_CENTRE: Record<GateId, number> = {
+ link: 0,
+ voice: 90,
+ brain: 180,
+ wake: 270,
+};
+
+/** Degrees one gate's arc spans — four of them leave a gap at each diagonal. */
+export const GATE_ARC_SPAN = 64;
+
+export interface RingTick {
+ deg: number;
+ /** 0 short, 1 long (every 15°), 2 cardinal (every 90°). */
+ weight: 0 | 1 | 2;
+}
+
+/** The ring's tick marks: one every `step` degrees, weighted for the eye. */
+export function ringTicks(step = 3): RingTick[] {
+ const out: RingTick[] = [];
+ for (let deg = 0; deg < 360; deg += step) {
+ const weight: 0 | 1 | 2 = deg % 90 === 0 ? 2 : deg % 15 === 0 ? 1 : 0;
+ out.push({ deg, weight });
+ }
+ return out;
+}
+
+/* ------------------------------------------------------------------ */
+/* Sizing */
+/* ------------------------------------------------------------------ */
+
+const RING_MIN = 260;
+const RING_MAX = 760;
+const RING_PAD = 20;
+const RETICLE_MIN = 200;
+const RETICLE_MAX = 420;
+/** The reticle's share of the ring — the ring must read as a ring around it. */
+const RETICLE_OF_RING = 0.6;
+
+/**
+ * The ring's diameter for a stage of the given size: as large as the
+ * shorter side allows, within bounds. The maximum until the stage has been
+ * measured, like `orbSizeFor`.
+ */
+export function ringSizeFor(width: number, height: number): number {
+ if (!width || !height) return RING_MAX;
+ const fit = Math.min(width, height) - RING_PAD * 2;
+ return Math.max(RING_MIN, Math.min(RING_MAX, Math.floor(fit)));
+}
+
+/** The orb reticle inside a ring of the given diameter. */
+export function reticleSizeFor(ring: number): number {
+ return Math.max(RETICLE_MIN, Math.min(RETICLE_MAX, Math.round(ring * RETICLE_OF_RING)));
+}
+
+/**
+ * The reveal order of the board's cards when the board takes over — the
+ * centre first, then outward — as a delay in milliseconds for each slot.
+ * Slots are named so the view cannot mis-number them.
+ */
+export type BoardSlot =
+ | "centre-top"
+ | "centre-bottom"
+ | "left-top"
+ | "right-top"
+ | "left-bottom"
+ | "right-bottom";
+
+const REVEAL_BASE_MS = 140;
+const REVEAL_STEP_MS = 90;
+const REVEAL_ORDER: Record<BoardSlot, number> = {
+ "centre-top": 0,
+ "centre-bottom": 1,
+ "left-top": 2,
+ "right-top": 2,
+ "left-bottom": 3,
+ "right-bottom": 3,
+};
+
+export function revealDelayMs(slot: BoardSlot): number {
+ return REVEAL_BASE_MS + REVEAL_ORDER[slot] * REVEAL_STEP_MS;
+}
diff --git a/jarvis/ui/web/frontend/src/store/deck.ts b/jarvis/ui/web/frontend/src/store/deck.ts
index 46c95b1c99..a2a2deede2 100644
--- a/jarvis/ui/web/frontend/src/store/deck.ts
+++ b/jarvis/ui/web/frontend/src/store/deck.ts
@@ -19,6 +19,13 @@ import { readDeckMode, writeDeckMode, type DeckMode } from "@/lib/deckMode";
interface DeckStore extends DeckState {
mode: DeckMode;
setMode: (mode: DeckMode) => void;
+ /**
+ * The board was opened this session — by hand, or because a turn began.
+ * Sticky on purpose: the deck's phases (lib/deckStandby.ts) only move
+ * forward, and a start screen must never come back over a conversation.
+ */
+ boardOpen: boolean;
+ openBoard: () => void;
ingest: (name: string, payload: unknown, tsMs: number) => void;
/** Tests and a fresh session — forget everything but the surface choice. */
resetDeck: () => void;
@@ -27,17 +34,22 @@ interface DeckStore extends DeckState {
export const useDeckStore = create<DeckStore>((set, get) => ({
...emptyDeckState(),
mode: readDeckMode(),
+ boardOpen: false,
setMode: (mode) => {
writeDeckMode(mode);
set({ mode });
},
+ openBoard: () => {
+ if (!get().boardOpen) set({ boardOpen: true });
+ },
+
ingest: (name, payload, tsMs) => {
const before = get();
const after = reduceDeck(before, name, payload, tsMs);
if (after !== before) set(after);
},
- resetDeck: () => set(emptyDeckState()),
+ resetDeck: () => set({ ...emptyDeckState(), boardOpen: false }),
}));
diff --git a/jarvis/ui/web/frontend/src/views/MissionDeckView.phases.test.tsx b/jarvis/ui/web/frontend/src/views/MissionDeckView.phases.test.tsx
new file mode 100644
index 0000000000..feb2f40555
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/views/MissionDeckView.phases.test.tsx
@@ -0,0 +1,138 @@
+import { act, cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";
+import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
+
+/**
+ * The deck's three acts (2026-08-18): the boot sequence while the app comes
+ * up, the standby ring until somebody speaks, the board from the first turn
+ * on — and never back. The instruments themselves are stubbed (each has its
+ * own tests); what is under test is WHICH stage is on, and how the board is
+ * reached.
+ */
+vi.mock("@/components/layout/DockRail", () => ({ DockRail: () => <nav data-testid="dock" /> }));
+vi.mock("@/components/deck/DeckWiki", () => ({
+ WikiCard: ({ className }: { className?: string }) => <section className={className}>wiki</section>,
+}));
+vi.mock("@/components/deck/DeckActivityCards", () => ({
+ IdeGridCard: () => <section>ide</section>,
+ OutputsCard: () => <section>outputs</section>,
+ RunsCard: () => <section>runs</section>,
+ TerminalsCard: () => <section>terminals</section>,
+}));
+vi.mock("@/components/deck/DeckSignalCards", () => ({
+ ApiStatsCard: () => <section>api</section>,
+ CaptureCard: () => <section>capture</section>,
+ LiveCounter: () => <div>counter</div>,
+}));
+vi.mock("@/components/deck/DeckTurnCard", () => ({ TurnCard: () => <section>turn</section> }));
+vi.mock("@/components/deck/DeckLogCard", async () => {
+ const actual = await vi.importActual<typeof import("@/components/deck/DeckLogCard")>(
+ "@/components/deck/DeckLogCard",
+ );
+ return { ...actual, LogCard: () => <section>log</section> };
+});
+vi.mock("@/hooks/useWakeWord", () => ({
+ useWakeWord: () => ({
+ config: {
+ phrase: "Hey Nova",
+ engine: "openwakeword",
+ custom_model_path: "",
+ fuzzy_match_ratio: 0.8,
+ language: "auto",
+ engines: ["openwakeword"],
+ instant_phrases: [],
+ local_whisper_available: false,
+ enabled: true,
+ },
+ loading: false,
+ error: null,
+ refetch: async () => {},
+ saveWakeWord: async () => ({}),
+ setWakeLanguage: async () => {},
+ setWakeActivation: async () => ({}),
+ }),
+}));
+const requestVoiceCall = vi.fn(async () => ({ armed: true }));
+vi.mock("@/lib/voiceApi", () => ({
+ requestVoiceCall: () => requestVoiceCall(),
+ requestVoiceHangup: async () => {},
+}));
+
+import { MissionDeckView } from "@/views/MissionDeckView";
+import { useDeckStore } from "@/store/deck";
+import { useEventStore } from "@/store/events";
+
+function ready() {
+ useEventStore.setState({
+ connected: true,
+ voiceReady: true,
+ wsWarming: false,
+ voiceState: "idle",
+ brainProvider: "openrouter",
+ brainModel: "",
+ assistantName: "Nova",
+ messages: [],
+ thinkingSteps: [],
+ chatThinking: false,
+ activeSection: "chats",
+ });
+}
+
+describe("MissionDeckView — the three acts", () => {
+ beforeEach(() => {
+ useDeckStore.getState().resetDeck();
+ ready();
+ requestVoiceCall.mockClear();
+ });
+ afterEach(() => cleanup());
+
+ test("boots while the app is still coming up — no board", () => {
+ useEventStore.setState({ connected: false, voiceReady: false, wsWarming: true });
+ render(<MissionDeckView />);
+ expect(screen.getByTestId("deck-standby").getAttribute("data-phase")).toBe("boot");
+ expect(screen.queryByTestId("deck-board")).toBeNull();
+ });
+
+ test("stands by once everything is up and nobody has spoken", () => {
+ render(<MissionDeckView />);
+ expect(screen.getByTestId("deck-standby").getAttribute("data-phase")).toBe("standby");
+ expect(screen.queryByTestId("deck-board")).toBeNull();
+ expect(screen.getByText("Say “Hey Nova” — or click the orb.")).toBeTruthy();
+ });
+
+ test("the first turn opens the board, and the board powers on around the orb", async () => {
+ render(<MissionDeckView />);
+ act(() => useDeckStore.getState().ingest("WakeWordDetected", { keyword: "nova" }, Date.now()));
+ expect(screen.getByTestId("deck-board")).toBeTruthy();
+ // Arrived from the standby on this screen: the instruments reveal.
+ expect(screen.getByTestId("deck-slot-left-top").getAttribute("data-reveal")).toBe("true");
+ await waitFor(() => expect(screen.queryByTestId("deck-standby")).toBeNull(), { timeout: 3000 });
+ });
+
+ test("'Open the board' opens it by hand and it stays open", async () => {
+ render(<MissionDeckView />);
+ fireEvent.click(screen.getByRole("button", { name: "Open the board" }));
+ expect(screen.getByTestId("deck-board")).toBeTruthy();
+ expect(useDeckStore.getState().boardOpen).toBe(true);
+ // A dropped link does not send the person back to the start screen.
+ act(() => useEventStore.setState({ connected: false }));
+ expect(screen.getByTestId("deck-board")).toBeTruthy();
+ await waitFor(() => expect(screen.queryByTestId("deck-standby")).toBeNull(), { timeout: 3000 });
+ });
+
+ test("pressing the orb reaches for the voice AND opens the board at once", () => {
+ render(<MissionDeckView />);
+ fireEvent.click(screen.getByRole("button", { name: /saying “Hey Nova”/ }));
+ expect(screen.getByTestId("deck-board")).toBeTruthy();
+ expect(requestVoiceCall).toHaveBeenCalledTimes(1);
+ });
+
+ test("a deck that mounts into a running session is simply the board — no reveal", () => {
+ useEventStore.setState({
+ messages: [{ id: "m1", role: "assistant", content: "Hallo.", ts: Date.now() }],
+ });
+ render(<MissionDeckView />);
+ expect(screen.getByTestId("deck-board")).toBeTruthy();
+ expect(screen.queryByTestId("deck-standby")).toBeNull();
+ expect(screen.getByTestId("deck-slot-left-top").getAttribute("data-reveal")).toBe("false");
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/views/MissionDeckView.tsx b/jarvis/ui/web/frontend/src/views/MissionDeckView.tsx
index b942ffd4b2..afbcd82fe9 100644
--- a/jarvis/ui/web/frontend/src/views/MissionDeckView.tsx
+++ b/jarvis/ui/web/frontend/src/views/MissionDeckView.tsx
@@ -1,10 +1,14 @@
import { useMemo, useRef, type ReactNode } from "react";
+import { AnimatePresence, MotionConfig, motion } from "framer-motion";
import { useEventStore, type VoiceState } from "@/store/events";
import { useDeckStore } from "@/store/deck";
import { VoiceWaveform, type WaveformPhase } from "@/components/overlay/VoiceWaveform";
import { voiceInputLevelRef } from "@/lib/voiceInputLevel";
import { DockRail } from "@/components/layout/DockRail";
-import { DeckOrb } from "@/components/deck/DeckOrb";
+import { DeckOrb, type OrbReadouts } from "@/components/deck/DeckOrb";
+import type { ThinkingStep } from "@/lib/thinkingSteps";
+import { DeckStandby, ORB_TRAVEL } from "@/components/deck/DeckStandby";
+import { DeckReveal } from "@/components/deck/DeckReveal";
import { HudLamp } from "@/components/deck/HudFrame";
import {
IdeGridCard,
@@ -21,6 +25,7 @@ import { useWakeWord } from "@/hooks/useWakeWord";
import { useVoiceCall } from "@/components/agentic/useVoiceCall";
import { useElementSize } from "@/hooks/useElementSize";
import { orbSizeFor, stageVignette } from "@/lib/deckStage";
+import { resolvePhase } from "@/lib/deckStandby";
import { writeDeckMode } from "@/lib/deckMode";
import { cn } from "@/lib/utils";
import { useT } from "@/i18n";
@@ -53,6 +58,16 @@ import { useT } from "@/i18n";
* its title jumps there. The dock on the left is the ONLY place the sections
* are listed — the sidebar steps aside while the deck is up (App.tsx).
*
+ * The board is the deck's THIRD act (maintainer, 2026-08-18: a fresh start
+ * showed nine instruments all saying "nothing yet"). Before the first word
+ * the stage is `DeckStandby` — the boot sequence while the app comes up,
+ * then the listening ring — and the board takes over the moment a turn
+ * opens or the person asks for it (`lib/deckStandby.ts::resolvePhase`,
+ * forward only). The hand-off is choreographed: the standby's ring and
+ * console leave, the orb travels from the ring's centre to its place on the
+ * board (one `layoutId` on both stages), and the instruments power on from
+ * the centre outward (`DeckReveal`).
+ *
* The frames differ on purpose (HudFrame.tsx): brackets for pictures and the
* map, chamfers for readouts, rails for streams — a deck of instruments, not
* a grid of identical boxes. Nothing on this screen is invented: a number the
@@ -78,6 +93,9 @@ export function MissionDeckView({
const cuActive = useDeckStore((s) => s.cu.active);
const wordsSession = useDeckStore((s) => s.wordsSession);
const turnPhase = useDeckStore((s) => s.turn.phase);
+ const turnIndex = useDeckStore((s) => s.turn.index);
+ const boardOpen = useDeckStore((s) => s.boardOpen);
+ const openBoard = useDeckStore((s) => s.openBoard);
const { warming } = useVoiceReadiness();
// The orb is the click-shaped wake word: the same start/stop path the
// classic surface's voice bubble uses, so both do exactly one thing.
@@ -88,12 +106,21 @@ export function MissionDeckView({
const { config: wakeConfig } = useWakeWord();
const wakePhrase = wakeConfig?.phrase.trim() || assistantName;
- // The centre grows with the room it has: as large as the stage allows, never
- // taller than the room left under the headline, and never past the point
- // where the reticle stops reading as an instrument.
- const stageRef = useRef<HTMLDivElement>(null);
- const stage = useElementSize(stageRef);
- const orbSize = orbSizeFor(stage.width, stage.height);
+ // Which act: boot, standby, or the board — forward only for the session.
+ const phase = resolvePhase({
+ connected,
+ voiceReady,
+ boardOpen,
+ turnIndex,
+ messageCount: messages.length,
+ voiceEngaged: callActive || connecting,
+ });
+ // The board powers on with its choreography ONLY when it takes over from
+ // the standby on this very screen. A deck that mounts straight into a
+ // running session (a section change and back) is simply there. Fixed on
+ // the first render so the wrappers never remount because the flag moved.
+ const mountedInto = useRef(phase);
+ const revealBoard = mountedInto.current !== "board";
const running = useMemo(
() => thinkingSteps.filter((s) => s.status === "active"),
@@ -132,8 +159,23 @@ export function MissionDeckView({
const orbPressLabel = callActive
? t("deck.orb_hangup")
: t("deck.orb_call").replace("{0}", wakePhrase);
+ const readouts: OrbReadouts = {
+ nw: t(`deck.mood_${mood}`),
+ ne: `${running.length} ${t("deck.orb_steps")}`,
+ sw: brainProvider || "—",
+ se: `${wordsSession} ${t("deck.orb_words")}`,
+ };
+ // Pressing the orb reaches for the voice — the board opens on the press
+ // itself, so the hand-off plays the moment the person acts, not a second
+ // later when the transport reports back.
+ const pressOrb = () => {
+ openBoard();
+ void toggleCall();
+ };
+ const pressDisabled = callBusy || connecting || !connected;
return (
+ <MotionConfig reducedMotion="user">
<div className="flex h-full min-h-0 flex-col">
{/* Status bar: voice bars, lamps and the live counter left; identity,
brain and the surface switch right. A thin bracket rule underneath. */}
@@ -204,74 +246,168 @@ export function MissionDeckView({
<div className="flex min-h-0 flex-1">
<DockRail />
- <div className="grid min-h-0 flex-1 grid-cols-1 gap-3 overflow-y-auto p-3 lg:grid-cols-[minmax(200px,3fr)_minmax(0,6fr)_minmax(240px,4fr)] lg:grid-rows-[minmax(0,1fr)_minmax(0,0.6fr)] lg:overflow-hidden">
- {/* LEFT top: the log — the terminal of the session */}
- <LogCard className="min-h-0" />
-
- {/* CENTRE top: the response instrument + api on a strip, the orb underneath */}
- <div className="flex min-h-0 flex-col gap-3">
- <div className="grid shrink-0 grid-cols-2 gap-3" style={{ height: "36%" }}>
- <TurnCard className="min-h-0" />
- <ApiStatsCard className="min-h-0" />
- </div>
+ <div className="relative flex min-h-0 min-w-0 flex-1 flex-col">
+ {phase === "board" && (
<div
- ref={stageRef}
- className="flex min-h-0 flex-1 flex-col items-center justify-center gap-2 px-2 text-center"
- style={{ backgroundImage: stageVignette(orbSize) }}
+ data-testid="deck-board"
+ className="grid min-h-0 flex-1 grid-cols-1 gap-3 overflow-y-auto p-3 lg:grid-cols-[minmax(200px,3fr)_minmax(0,6fr)_minmax(240px,4fr)] lg:grid-rows-[minmax(0,1fr)_minmax(0,0.6fr)] lg:overflow-hidden"
>
- <DeckOrb
- steps={running}
- busy={busy}
- size={orbSize}
- readouts={{
- nw: t(`deck.mood_${mood}`),
- ne: `${running.length} ${t("deck.orb_steps")}`,
- sw: brainProvider || "—",
- se: `${wordsSession} ${t("deck.orb_words")}`,
- }}
- onPress={() => void toggleCall()}
- pressLabel={orbPressLabel}
- pressDisabled={callBusy || connecting || !connected}
- />
- <p
- className={cn(
- "max-w-[44ch] text-pretty text-sm leading-relaxed",
- lastAssistant ? "text-foreground" : "text-muted-foreground",
- )}
- >
- {headline}
- </p>
- </div>
- </div>
+ {/* LEFT top: the log — the terminal of the session */}
+ <DeckReveal slot="left-top" reveal={revealBoard} className="flex min-h-0 flex-col">
+ <LogCard className="min-h-0 flex-1" />
+ </DeckReveal>
- {/* RIGHT top: the wiki, in space, tall */}
- <WikiCard className="min-h-0" />
+ {/* CENTRE top: the response instrument + api on a strip, the orb underneath */}
+ <div className="flex min-h-0 flex-col gap-3">
+ <DeckReveal
+ slot="centre-top"
+ reveal={revealBoard}
+ className="grid shrink-0 grid-cols-2 gap-3"
+ style={{ height: "36%" }}
+ >
+ <TurnCard className="min-h-0" />
+ <ApiStatsCard className="min-h-0" />
+ </DeckReveal>
+ <BoardCentre
+ steps={running}
+ busy={busy}
+ readouts={readouts}
+ onPress={pressOrb}
+ pressLabel={orbPressLabel}
+ pressDisabled={pressDisabled}
+ headline={headline}
+ headlineIsAnswer={Boolean(lastAssistant)}
+ reveal={revealBoard}
+ />
+ </div>
- {/* LEFT bottom: outputs and runs */}
- <div className="grid min-h-[8rem] grid-cols-2 gap-3">
- <OutputsCard className="min-h-0" />
- <RunsCard className="min-h-0" />
- </div>
+ {/* RIGHT top: the wiki, in space, tall */}
+ <DeckReveal slot="right-top" reveal={revealBoard} className="flex min-h-0 flex-col">
+ <WikiCard className="min-h-0 flex-1" />
+ </DeckReveal>
- {/* CENTRE bottom: the last capture (briefly), then the ledger; centred and not too wide */}
- <div className="flex min-h-[8rem] items-stretch justify-center">
- <CaptureCard className="w-full max-w-[28rem]" />
- </div>
+ {/* LEFT bottom: outputs and runs */}
+ <DeckReveal slot="left-bottom" reveal={revealBoard} className="grid min-h-[8rem] grid-cols-2 gap-3">
+ <OutputsCard className="min-h-0" />
+ <RunsCard className="min-h-0" />
+ </DeckReveal>
+
+ {/* CENTRE bottom: the last capture (briefly), then the ledger; centred and not too wide */}
+ <DeckReveal
+ slot="centre-bottom"
+ reveal={revealBoard}
+ className="flex min-h-[8rem] items-stretch justify-center"
+ >
+ <CaptureCard className="w-full max-w-[28rem]" />
+ </DeckReveal>
- {/* RIGHT bottom: terminals and the coding workspace */}
- <div className="grid min-h-[8rem] grid-cols-2 gap-3">
- <TerminalsCard className="min-h-0" />
- <IdeGridCard className="min-h-0" />
- </div>
+ {/* RIGHT bottom: terminals and the coding workspace */}
+ <DeckReveal slot="right-bottom" reveal={revealBoard} className="grid min-h-[8rem] grid-cols-2 gap-3">
+ <TerminalsCard className="min-h-0" />
+ <IdeGridCard className="min-h-0" />
+ </DeckReveal>
+ </div>
+ )}
+
+ {/* Before the first word: the boot sequence, then the listening
+ ring. Absolute over the stage so its exit plays over the board
+ powering on underneath. */}
+ <AnimatePresence>
+ {phase !== "board" && (
+ <DeckStandby
+ key="standby"
+ className="absolute inset-0 z-10"
+ phase={phase}
+ steps={running}
+ busy={busy}
+ readouts={readouts}
+ wakeConfig={wakeConfig}
+ onPressOrb={pressOrb}
+ pressLabel={orbPressLabel}
+ pressDisabled={pressDisabled}
+ onOpenBoard={openBoard}
+ />
+ )}
+ </AnimatePresence>
</div>
</div>
</div>
+ </MotionConfig>
);
}
type DeckMood = "ready" | "busy" | "listening" | "speaking" | "fail" | "offline";
+
+/**
+ * The board's centre: the orb on its vignetted stage with the headline under
+ * it. The centre grows with the room it has — as large as the stage allows,
+ * never taller than the room left under the headline, and never past the
+ * point where the reticle stops reading as an instrument. It measures ITSELF
+ * because it mounts with the board, not with the view: a measurement taken
+ * by the view while the standby is up would find no stage and never look
+ * again.
+ */
+function BoardCentre({
+ steps,
+ busy,
+ readouts,
+ onPress,
+ pressLabel,
+ pressDisabled,
+ headline,
+ headlineIsAnswer,
+ reveal,
+}: {
+ steps: ThinkingStep[];
+ busy: boolean;
+ readouts: OrbReadouts;
+ onPress: () => void;
+ pressLabel: string;
+ pressDisabled: boolean;
+ headline: string;
+ /** The headline is the assistant's last answer, not the idle prompt. */
+ headlineIsAnswer: boolean;
+ reveal: boolean;
+}) {
+ const stageRef = useRef<HTMLDivElement>(null);
+ const stage = useElementSize(stageRef);
+ const orbSize = orbSizeFor(stage.width, stage.height);
+ return (
+ <div
+ ref={stageRef}
+ className="flex min-h-0 flex-1 flex-col items-center justify-center gap-2 px-2 text-center"
+ style={{ backgroundImage: stageVignette(orbSize) }}
+ >
+ {/* The same layoutId as the standby's orb: when the board takes over,
+ the orb travels here instead of blinking. */}
+ <motion.div layoutId="deck-orb" layoutDependency={orbSize} transition={ORB_TRAVEL}>
+ <DeckOrb
+ steps={steps}
+ busy={busy}
+ size={orbSize}
+ readouts={readouts}
+ onPress={onPress}
+ pressLabel={pressLabel}
+ pressDisabled={pressDisabled}
+ />
+ </motion.div>
+ <motion.p
+ initial={reveal ? { opacity: 0 } : false}
+ animate={{ opacity: 1 }}
+ transition={{ delay: 0.45, duration: 0.4 }}
+ className={cn(
+ "max-w-[44ch] text-pretty text-sm leading-relaxed",
+ headlineIsAnswer ? "text-foreground" : "text-muted-foreground",
+ )}
+ >
+ {headline}
+ </motion.p>
+ </div>
+ );
+}
+
function waveformPhase(state: VoiceState, connected: boolean): WaveformPhase {
if (!connected) return "idle";
switch (state) {