Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(home): the front page is Voice | Chat on a flat ground
rubenluetke10-beepb6f554731815
diff --git a/jarvis/ui/web/frontend/index.html b/jarvis/ui/web/frontend/index.htmlindex fea0f29dad..e675edcdb2 100644--- a/jarvis/ui/web/frontend/index.html+++ b/jarvis/ui/web/frontend/index.html@@ -45,6 +45,17 @@var root = document.documentElement;root.classList.toggle("dark", mode === "dark");root.style.colorScheme = mode;+ // The ground: a flat theme colour unless the user switched a+ // wallpaper on. Same key and fallback as src/lib/backgroundMode.ts —+ // the class gates the wallpaper readability floor in index.css, so it+ // must be right before the first frame, not a moment after.+ var wallpaper = false;+ try {+ wallpaper = localStorage.getItem("jarvis.background.v1") === "wallpaper";+ } catch (e) {+ /* storage blocked — the flat colour is the default anyway */+ }+ root.classList.toggle("jarvis-wallpaper", wallpaper);})();</script><style>diff --git a/jarvis/ui/web/frontend/src/App.detached.test.tsx b/jarvis/ui/web/frontend/src/App.detached.test.tsxindex e1bf70cb71..ddeae9d9d3 100644--- a/jarvis/ui/web/frontend/src/App.detached.test.tsx+++ b/jarvis/ui/web/frontend/src/App.detached.test.tsx@@ -2,7 +2,6 @@ import { cleanup, render, screen } from "@testing-library/react";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import App from "@/App";-import { useDeckStore } from "@/store/deck";import { useEventStore } from "@/store/events";import { useWallpaperStore } from "@/store/wallpaper";@@ -70,11 +69,10 @@ beforeEach(() => {solo: false,detachedViews: [],});- useWallpaperStore.setState({ mascotOn: true });- // Classic chat is a normal section: the live mascot stays on the ground.- // The mission deck hides it (see the test below) — defaulting to classic- // here keeps the wallpaper assertions about "a normal section" honest.- useDeckStore.setState({ mode: "classic" });+ // The ground is a flat colour by default (2026-08-23); these tests are+ // about the wallpaper layer, so they switch it on. The solid default has+ // its own test below.+ useWallpaperStore.setState({ mascotOn: true, background: "wallpaper" });});afterEach(() => {@@ -101,12 +99,17 @@ describe("App shell around detached coding views", () => {expect(screen.queryByTestId("jarvis-desktop-wallpaper-mascot")).toBeNull();});- it("hides the live mascot while the mission deck is on stage", () => {- useDeckStore.setState({ mode: "deck" });+ it("paints no wallpaper layer at all on the solid ground (the default)", () => {+ useWallpaperStore.setState({ background: "solid" });render(<App />);- expect(screen.getByTestId("jarvis-desktop-wallpaper")).toBeTruthy();+ expect(screen.queryByTestId("jarvis-desktop-wallpaper")).toBeNull();expect(screen.queryByTestId("jarvis-desktop-wallpaper-mascot")).toBeNull();+ // The stage class stays: the solid-ground overrides in index.css key on+ // the root class, not on the stage being absent.+ expect(+ screen.getByTestId("main-view").parentElement?.classList.contains("jarvis-section-stage"),+ ).toBe(true);});it("hides the live mascot on every section except Chats", () => {diff --git a/jarvis/ui/web/frontend/src/App.tsx b/jarvis/ui/web/frontend/src/App.tsxindex 14d59c2e6e..cd463b6b23 100644--- a/jarvis/ui/web/frontend/src/App.tsx+++ b/jarvis/ui/web/frontend/src/App.tsx@@ -1,7 +1,6 @@import { Suspense, lazy, useCallback, useEffect, useState } from "react";import { isSectionId, useEventStore } from "@/store/events";-import { useDeckStore } from "@/store/deck";import { useWebSocket } from "@/hooks/useWebSocket";import { useBrainStatus } from "@/hooks/useBrainStatus";import { useVoiceStatus } from "@/hooks/useVoiceStatus";@@ -64,6 +63,11 @@ const NAV_COLLAPSED_KEY = "jarvis.sidebar.collapsed.v1";function DesktopWallpaper({ hideMascot = false }: { hideMascot?: boolean }) {const wallpaperUrl = useDesktopWallpaper();const mascotOn = useWallpaperStore((state) => state.mascotOn);+ const background = useWallpaperStore((state) => state.background);+ // A flat theme colour is the default ground (lib/backgroundMode.ts): the+ // picture, its veil and the mascot layer exist only once a wallpaper is+ // switched on. index.css keys the readability floor on the same choice.+ if (background !== "wallpaper") return null;return (<divaria-hidden@@ -226,23 +230,22 @@ export default function App() {});/*- * The sidebar starts COLLAPSED.- *- * Navigation is how you get to the thing, never the thing itself, and the- * window is at its most useful when the work has the width. The icons stay on- * screen, each with its label on hover, so nothing becomes unreachable — this- * is a narrower sidebar, not a hidden one.+ * The sidebar starts EXPANDED (2026-08-23 — it used to start as the icon+ * rail). The front page's own controls live in it now: the Voice | Chat+ * switch, "New chat", the recent runs and chats. A rail would hide the one+ * switch the page is built around. Collapsing is still one click away and+ * is remembered.** Persisted separately from the drag width on purpose: expanding restores the* column the user sized, not the designed default. A storage read that throws- * (private-mode WebView, storage disabled) degrades to the collapsed default+ * (private-mode WebView, storage disabled) degrades to the expanded default* rather than taking the shell down with it.*/const [navCollapsed, setNavCollapsed] = useState<boolean>(() => {try {- return window.localStorage.getItem(NAV_COLLAPSED_KEY) !== "false";+ return window.localStorage.getItem(NAV_COLLAPSED_KEY) === "true";} catch {- return true;+ return false;}});const toggleNav = useCallback(() => {@@ -277,16 +280,6 @@ export default function App() {const activeSection = useEventStore((s) => s.activeSection);const solo = useEventStore((s) => s.solo);const detachedViews = useEventStore((s) => s.detachedViews);- const deckMode = useDeckStore((s) => s.mode);-- /*- * The mission deck is a full stage: it brings its own section dock, so the- * sidebar (and the resizer that belongs to it) steps aside while the deck is- * on screen. Every other section — and the classic chat view behind the- * deck's switch — keeps the sidebar exactly as before; a section reached- * from the dock lands there.- */- const deckOnStage = activeSection === "chats" && deckMode === "deck";/** The realtime broker must exist exactly ONCE across all windows: it@@ -315,11 +308,10 @@ export default function App() {*//** Gigi belongs on the Chats ground only. Every other section was painting- * the same live ghost into empty corners (Tasks, Wiki, Profile, …) and the- * deck already hides him for the same reason as before: two heroes in one- * corner. The wallpaper picture stays; only the mascot layer steps off.+ * the same live ghost into empty corners (Tasks, Wiki, Profile, …). The+ * wallpaper picture stays; only the mascot layer steps off.*/- const hideMascot = activeSection !== "chats" || deckOnStage;+ const hideMascot = activeSection !== "chats";if (solo) {return (@@ -349,24 +341,20 @@ export default function App() {{brokerMounted && <SubscriptionRealtimeTransportBroker />}<DesktopWallpaper hideMascot={hideMascot} />- {!deckOnStage && (- <>- <Sidebar- width={sidebar.size}- collapsed={navCollapsed}- onToggleCollapsed={toggleNav}- />+ <Sidebar+ width={sidebar.size}+ collapsed={navCollapsed}+ onToggleCollapsed={toggleNav}+ />- <PaneResizer- orientation="vertical"- onPointerDown={startSidebarResize}- onDoubleClick={sidebar.reset}- onNudge={sidebar.nudge}- active={sidebar.isResizing}- title="Drag to resize the sidebar — double-click to reset"- />- </>- )}+ <PaneResizer+ orientation="vertical"+ onPointerDown={startSidebarResize}+ onDoubleClick={sidebar.reset}+ onNudge={sidebar.nudge}+ active={sidebar.isResizing}+ title="Drag to resize the sidebar — double-click to reset"+ />{/*The stage column carries NO z-index, and must not get one back.diff --git a/jarvis/ui/web/frontend/src/__tests__/topbarUpdateButton.test.tsx b/jarvis/ui/web/frontend/src/__tests__/topbarUpdateButton.test.tsxindex d4435d745b..417829e3f5 100644--- a/jarvis/ui/web/frontend/src/__tests__/topbarUpdateButton.test.tsx+++ b/jarvis/ui/web/frontend/src/__tests__/topbarUpdateButton.test.tsx@@ -8,7 +8,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { TopBar } from "@/components/layout/TopBar";import { useEventStore } from "@/store/events";-import { useDeckStore } from "@/store/deck";function mockUpdateStatus(body: Record<string, unknown>): void {vi.stubGlobal(@@ -24,8 +23,7 @@ function mockUpdateStatus(body: Record<string, unknown>): void {describe("TopBar update button", () => {beforeEach(() => {- // The mission deck hides this bar; these tests need the global chrome.- useDeckStore.setState({ mode: "classic" });+ // The front page hides this bar; these tests need the global chrome.useEventStore.setState({assistantName: "Assistant",toasts: [],diff --git a/jarvis/ui/web/frontend/src/components/ChatInput.test.tsx b/jarvis/ui/web/frontend/src/components/ChatInput.test.tsxindex a887e7b26e..8d9600aa86 100644--- a/jarvis/ui/web/frontend/src/components/ChatInput.test.tsx+++ b/jarvis/ui/web/frontend/src/components/ChatInput.test.tsx@@ -1,9 +1,19 @@-import { act, cleanup, fireEvent, render, screen } from "@testing-library/react";+import { act, cleanup, fireEvent, render as rtlRender, screen } from "@testing-library/react";+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";import { afterEach, beforeEach, describe, expect, test } from "vitest";import { ChatInput } from "@/components/ChatInput";import { useEventStore } from "@/store/events";+// The composer names the model that will answer (useVoiceEngineDisplay →+// useVoiceMode, a query), so it mounts under a query client like the app.+function render(ui: React.ReactElement) {+ const client = new QueryClient({+ defaultOptions: { queries: { retry: false, staleTime: Infinity } },+ });+ return rtlRender(<QueryClientProvider client={client}>{ui}</QueryClientProvider>);+}+describe("ChatInput offline/warming placeholder", () => {beforeEach(() => {useEventStore.setState({diff --git a/jarvis/ui/web/frontend/src/components/ChatInput.tsx b/jarvis/ui/web/frontend/src/components/ChatInput.tsxindex a7009c942c..853c6e7694 100644--- a/jarvis/ui/web/frontend/src/components/ChatInput.tsx+++ b/jarvis/ui/web/frontend/src/components/ChatInput.tsx@@ -1,7 +1,7 @@import { useEffect, useRef, useState, type KeyboardEvent } from "react";-import { Mic, Send, Square } from "lucide-react";-import { Button } from "@/components/ui/button";+import { ArrowUp, Mic, Square } from "lucide-react";import { getWSClient } from "@/hooks/useWebSocket";+import { useVoiceEngineDisplay } from "@/hooks/useVoiceEngineDisplay";import { useEventStore } from "@/store/events";import { cn } from "@/lib/utils";import { useT } from "@/i18n";@@ -11,10 +11,22 @@ import { useT } from "@/i18n";// wait state permanently.const THINKING_TIMEOUT_MS = 60_000;+/**+ * The composer — a card with the text box and, on its bottom row, dictation,+ * the model that will answer (click to change it) and send.+ *+ * Restyled 2026-08-23 for the new front page (maintainer sketch): one+ * rounded card in the Claude layout. The behaviour is unchanged — same send+ * path, same thread routing, same dictation mirror; only the frame moved.+ */export function ChatInput() {const t = useT();const [value, setValue] = useState("");const connected = useEventStore((s) => s.connected);+ const setActiveSection = useEventStore((s) => s.setActiveSection);+ // What will answer: the classic brain, or the realtime engine when voice+ // mode is realtime — the same resolver the header and the sidebar use.+ const engine = useVoiceEngineDisplay();const wsWarming = useEventStore((s) => s.wsWarming);const chatThinking = useEventStore((s) => s.chatThinking);const setChatThinking = useEventStore((s) => s.setChatThinking);@@ -154,11 +166,19 @@ export function ChatInput() {}}+ const canSend = connected && Boolean(value.trim());+return (- <div className="flex flex-col gap-2">+ <div+ data-testid="chat-composer"+ className={cn(+ "flex flex-col gap-2 rounded-2xl border border-border bg-card p-3 shadow-[0_1px_2px_rgb(var(--scrim-rgb)/0.05),0_8px_24px_rgb(var(--scrim-rgb)/0.06)] transition-[border-color,box-shadow]",+ "focus-within:border-primary/40",+ )}+ >{chatThinking && (<div- className="flex min-w-0 items-center gap-2 rounded-md border border-primary/40 bg-primary/10 px-3 py-1.5 text-xs text-primary"+ className="flex min-w-0 items-center gap-2 rounded-lg border border-primary/30 bg-primary/10 px-3 py-1.5 text-xs text-primary"role="status"aria-live="polite">@@ -175,7 +195,7 @@ export function ChatInput() {)}{dictating && (<div- className="flex items-center gap-2 rounded-md border border-primary/40 bg-primary/10 px-3 py-1.5 text-xs text-primary"+ className="flex items-center gap-2 rounded-lg border border-primary/30 bg-primary/10 px-3 py-1.5 text-xs text-primary"role="status"aria-live="polite">@@ -186,48 +206,71 @@ export function ChatInput() {<span className="font-medium">{t("chats_view.dictation_listening")}</span></div>)}- <div className="flex items-end gap-2">- <textarea- // Marks the composer as the app's fallback dictation sink. The- // delivery path needs to know whether it is on screen at all before- // it hands a transcript to a component that may be unmounted — see- // lib/dictationTarget.ts.- data-jarvis-chat-input=""- value={value}- onChange={(e) => setValue(e.target.value)}- onKeyDown={onKeyDown}- placeholder={- connected- ? t("chats_view.input_placeholder")- : wsWarming- ? t("voice_state.booting")- : t("voice_state.offline")- }- disabled={!connected}- rows={2}- className="jarvis-input-surface flex-1 resize-none rounded-md border border-input px-3 py-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50"- />- <Button+ <textarea+ // Marks the composer as the app's fallback dictation sink. The+ // delivery path needs to know whether it is on screen at all before+ // it hands a transcript to a component that may be unmounted — see+ // lib/dictationTarget.ts.+ data-jarvis-chat-input=""+ value={value}+ onChange={(e) => setValue(e.target.value)}+ onKeyDown={onKeyDown}+ placeholder={+ connected+ ? t("chats_view.input_placeholder")+ : wsWarming+ ? t("voice_state.booting")+ : t("voice_state.offline")+ }+ disabled={!connected}+ rows={2}+ className="max-h-48 w-full resize-none bg-transparent px-1 py-1 text-[15px] leading-relaxed text-foreground placeholder:text-muted-foreground focus-visible:outline-none disabled:opacity-50"+ />+ <div className="flex items-center gap-1.5">+ <buttontype="button"data-jarvis-dictation-triggeronClick={toggleDictation}disabled={!connected}- size="icon"- variant={dictating ? "default" : "outline"}aria-label={dictating ? t("chats_view.dictation_stop") : t("chats_view.dictation_start")}title={dictating ? t("chats_view.dictation_stop") : t("chats_view.dictation_start")}- className={cn(dictating && "animate-jarvis-pulse")}+ className={cn(+ "inline-flex h-8 w-8 items-center justify-center rounded-lg border transition-colors disabled:opacity-50",+ dictating+ ? "animate-jarvis-pulse border-primary/50 bg-primary/15 text-primary"+ : "border-transparent text-muted-foreground hover:bg-secondary hover:text-foreground",+ )}>{dictating ? <Square className="h-4 w-4" /> : <Mic className="h-4 w-4" />}- </Button>- <Button+ </button>+ <span className="flex-1" />+ <button+ type="button"+ onClick={() => setActiveSection("apikeys")}+ title={t("home.model_hint")}+ data-testid="composer-model"+ className="inline-flex h-8 max-w-[280px] items-center gap-1.5 rounded-lg px-2 text-xs text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground"+ >+ <span className="truncate font-medium text-foreground">{engine.providerLabel}</span>+ {engine.model && (+ <span className="truncate font-mono text-[10px] text-muted-foreground">{engine.model}</span>+ )}+ </button>+ <button+ type="button"onClick={send}- disabled={!connected || !value.trim()}- size="icon"+ disabled={!canSend}aria-label="Send"+ data-testid="composer-send"+ className={cn(+ "inline-flex h-8 w-8 items-center justify-center rounded-lg transition-colors",+ canSend+ ? "bg-primary text-primary-foreground hover:bg-primary/90"+ : "bg-secondary text-muted-foreground/60",+ )}>- <Send className="h-4 w-4" />- </Button>+ <ArrowUp className="h-4 w-4" />+ </button></div></div>);diff --git a/jarvis/ui/web/frontend/src/components/home/ChatStage.tsx b/jarvis/ui/web/frontend/src/components/home/ChatStage.tsxnew file mode 100644index 0000000000..9d1fe26ef1--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/home/ChatStage.tsx@@ -0,0 +1,115 @@+import { useEffect, useRef } from "react";++import { useEventStore, type ChatMessage } from "@/store/events";+import { ScrollArea } from "@/components/ui/scroll-area";+import { ChatInput } from "@/components/ChatInput";+import { ThinkingTrace, ThoughtTraceDisclosure } from "@/components/ThinkingTrace";+import { Greeting } from "@/components/home/Greeting";+import { useT } from "@/i18n";+import { cn } from "@/lib/utils";++/**+ * The chat stage — the typed half of the front page.+ *+ * One centred column, like a document: the greeting and the composer sit+ * in the middle of an empty page; once there are messages the column+ * scrolls and the composer docks to the bottom. No second pane — the+ * history moved into the sidebar (components/home/RecentChats), where it is+ * visible from every section instead of only this one.+ *+ * The composer is the one the classic view used (ChatInput): same send+ * path, same dictation, same thread routing. Only the room around it+ * changed.+ */+export function ChatStage() {+ const t = useT();+ const messages = useEventStore((s) => s.messages);+ const chatThinking = useEventStore((s) => s.chatThinking);+ const endRef = useRef<HTMLDivElement | null>(null);+ const hasContent = messages.length > 0 || chatThinking;++ useEffect(() => {+ endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });+ }, [messages.length, chatThinking]);++ if (!hasContent) {+ return (+ <div className="flex min-h-0 flex-1 flex-col items-center" data-testid="chat-stage" data-empty="true">+ <div className="flex w-full max-w-[760px] flex-1 flex-col justify-center gap-8 px-6 pb-20">+ <Greeting subtitle={t("home.chat_empty_title")} />+ <ChatInput />+ </div>+ </div>+ );+ }++ return (+ <div className="flex min-h-0 flex-1 flex-col items-center" data-testid="chat-stage" data-empty="false">+ <ScrollArea className="min-h-0 w-full flex-1">+ <div className="mx-auto flex w-full max-w-[760px] flex-col gap-5 px-6 pb-6 pt-8">+ {messages.map((m) => (+ <MessageRow key={m.id} message={m} />+ ))}+ {chatThinking && <ThinkingTrace />}+ <div ref={endRef} />+ </div>+ </ScrollArea>+ <div className="w-full max-w-[760px] px-6 pb-5 pt-2">+ <ChatInput />+ </div>+ </div>+ );+}++/**+ * One message in the column. The person's lines sit right in a quiet+ * bubble; the assistant's run flush-left with a byline and, when there is+ * one, the "Thought for Ns" disclosure — prose on the page, not a bubble.+ */+function MessageRow({ message }: { message: ChatMessage }) {+ const assistantName = useEventStore((s) => s.assistantName);+ const trace = useEventStore((s) => s.thinkingTraces[message.id]);+ const isUser = message.role === "user";++ if (message.role === "system") {+ return (+ <div className="mx-auto max-w-[85%] rounded-lg border border-border bg-secondary/50 px-3 py-2 text-center text-xs italic text-muted-foreground">+ {message.content}+ </div>+ );+ }++ if (message.role === "preamble") {+ return (+ <div className="flex flex-col gap-1 text-xs italic leading-relaxed text-muted-foreground">+ <span className="font-mono text-[10px] not-italic uppercase tracking-[0.14em] text-muted-foreground">+ {assistantName} · pre-ack+ </span>+ <div className="whitespace-pre-wrap">{message.content}</div>+ </div>+ );+ }++ if (isUser) {+ return (+ <div className="flex justify-end" data-testid="chat-message-user">+ <div className="max-w-[78%] rounded-2xl rounded-br-md border border-border bg-secondary px-4 py-2.5 text-[15px] leading-relaxed text-foreground">+ <div className="whitespace-pre-wrap">{message.content}</div>+ </div>+ </div>+ );+ }++ return (+ <div className="flex flex-col gap-1.5 px-1" data-testid="chat-message-assistant">+ <div className="flex items-center gap-1.5 font-mono text-[10px] uppercase tracking-[0.14em] text-primary">+ <span className="h-1 w-1 rounded-full bg-primary" aria-hidden />+ {assistantName}+ </div>+ {trace && <ThoughtTraceDisclosure trace={trace} />}+ <div className={cn("whitespace-pre-wrap text-[15px] leading-relaxed text-foreground")}>+ {message.content}+ </div>+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/home/Greeting.tsx b/jarvis/ui/web/frontend/src/components/home/Greeting.tsxnew file mode 100644index 0000000000..3a7163aa7c--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/home/Greeting.tsx@@ -0,0 +1,57 @@+import { useUserName } from "@/hooks/useUserName";+import { fill, useT } from "@/i18n";+import { PRODUCT_NAME } from "@/lib/branding";+import { cn } from "@/lib/utils";++/**+ * "Good morning, Ruben" — the front page's opening line, on both stages.+ *+ * The name comes from the Profile (useUserName); without one the greeting+ * simply has no name, it never invents one. The time of day follows the+ * machine's clock. `muted` shrinks it once a conversation is on screen so+ * the words being said, not the greeting, carry the page.+ */+export function Greeting({+ subtitle,+ muted = false,+}: {+ subtitle?: string;+ muted?: boolean;+}) {+ const t = useT();+ const name = useUserName();+ const text = fill(t(greetingKey(new Date().getHours())), {+ name_part: name ? `, ${name}` : "",+ });++ return (+ <div+ className={cn(+ "flex flex-col items-center text-center transition-[opacity,transform]",+ muted && "scale-[0.88] opacity-70",+ )}+ data-testid="home-greeting"+ >+ <h1 className="flex items-center gap-3 font-display text-3xl font-semibold tracking-tight text-foreground [text-wrap:balance]">+ <img+ src="/jarvis-logo.png"+ width={30}+ height={30}+ alt={PRODUCT_NAME}+ className="h-[30px] w-[30px] shrink-0"+ />+ <span>{text}</span>+ </h1>+ {subtitle && !muted && (+ <p className="mt-2 max-w-md text-sm text-muted-foreground">{subtitle}</p>+ )}+ </div>+ );+}++/** Morning until 12, afternoon until 18, evening after. */+export function greetingKey(hour: number): string {+ if (hour < 12) return "home.greeting_morning";+ if (hour < 18) return "home.greeting_afternoon";+ return "home.greeting_evening";+}diff --git a/jarvis/ui/web/frontend/src/components/home/HomeHeader.tsx b/jarvis/ui/web/frontend/src/components/home/HomeHeader.tsxnew file mode 100644index 0000000000..88b48e10b7--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/home/HomeHeader.tsx@@ -0,0 +1,113 @@+import { useEventStore } from "@/store/events";+import { useVoiceEngineDisplay } from "@/hooks/useVoiceEngineDisplay";+import { useVoiceReadiness } from "@/hooks/useVoiceReadiness";+import { useVoiceMode } from "@/hooks/useVoiceMode";+import { TopBarActions } from "@/components/layout/TopBar";+import { CodingModeBadge } from "@/components/layout/CodingModeBadge";+import { MascotGigi } from "@/components/MascotGigi";+import { useT } from "@/i18n";+import { cn } from "@/lib/utils";++/**+ * The front page's header row: who is talking (mascot, name, voice state),+ * what will answer (engine + model — click to change), and the app chrome+ * actions (coding mode, theme, own window, update, restart).+ *+ * Same content the mission deck's header carried, in a calmer frame: plain+ * pills instead of instrument readouts. The shell TopBar steps aside on this+ * section (TopBar.tsx), so this row is the only chrome above the stage.+ */+export function HomeHeader() {+ const t = useT();+ const assistantName = useEventStore((s) => s.assistantName);+ const voiceState = useEventStore((s) => s.voiceState);+ const setActive = useEventStore((s) => s.setActiveSection);+ const { connected, warming, bootWarming, voiceWarming } = useVoiceReadiness();+ const voiceMode = useVoiceMode();+ const engine = useVoiceEngineDisplay();++ const stateLabel = !connected+ ? bootWarming+ ? t("voice_state.booting")+ : t("voice_state.offline")+ : voiceWarming+ ? t("voice_state.starting")+ : voiceMode.connecting+ ? t("voice_state.connecting")+ : t(`voice_state.${voiceState}`);+ const live =+ connected && !warming && (voiceState === "listening" || voiceState === "thinking" || voiceState === "speaking");++ return (+ <header+ data-testid="home-header"+ className="flex h-12 shrink-0 items-center gap-3 border-b border-border px-4"+ >+ <span className="flex h-7 w-7 shrink-0 items-center justify-center" aria-hidden>+ <MascotGigi size={28} reactToVoice enableComments={false} />+ </span>+ <div className="flex min-w-0 items-baseline gap-2">+ <span className="font-display text-sm font-semibold tracking-tight">{assistantName}</span>+ <span+ data-testid="home-voice-state"+ className={cn(+ "truncate font-mono text-[10px] uppercase tracking-[0.14em]",+ live ? "text-primary" : "text-muted-foreground",+ )}+ >+ {stateLabel}+ </span>+ </div>++ <div className="ml-auto flex flex-wrap items-center justify-end gap-2">+ <HeaderPill+ label={t(engine.tier === "realtime" ? "deck.stat_realtime" : "deck.stat_brain")}+ value={engine.providerLabel}+ hot+ onClick={() => setActive("apikeys")}+ testId="home-stat-engine"+ />+ <HeaderPill+ label={t("deck.stat_model")}+ value={engine.model || "—"}+ onClick={() => setActive("apikeys")}+ testId="home-stat-model"+ />+ <CodingModeBadge />+ <TopBarActions />+ </div>+ </header>+ );+}++function HeaderPill({+ label,+ value,+ hot = false,+ onClick,+ testId,+}: {+ label: string;+ value: string;+ hot?: boolean;+ onClick: () => void;+ testId: string;+}) {+ const t = useT();+ return (+ <button+ type="button"+ onClick={onClick}+ title={t("home.model_hint")}+ data-testid={testId}+ className="inline-flex h-7 max-w-[260px] items-center gap-1.5 rounded-md border border-border bg-secondary/40 px-2 text-xs transition-colors hover:border-primary/50"+ >+ <span className="font-mono text-[9px] uppercase tracking-[0.14em] text-muted-foreground">+ {label}+ </span>+ <span className={cn("truncate font-medium", hot ? "text-primary" : "text-foreground")}>+ {value}+ </span>+ </button>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/home/RecentChats.tsx b/jarvis/ui/web/frontend/src/components/home/RecentChats.tsxnew file mode 100644index 0000000000..98190ea604--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/home/RecentChats.tsx@@ -0,0 +1,135 @@+import { useState } from "react";+import { MessageSquare, Mic, Trash2 } from "lucide-react";++import { useConversations } from "@/hooks/useConversations";+import { useEventStore, type ConversationSummary } from "@/store/events";+import { useHomeStore } from "@/store/home";+import { useT } from "@/i18n";+import { cn } from "@/lib/utils";+import { SidebarGroup } from "@/components/home/SidebarGroup";++export const RECENT_CHATS_FOLDED = 3;+export const RECENT_CHATS_UNFOLDED = 15;++/**+ * The last conversations — text threads and voice sessions in one list —+ * from the sidebar. This block is the one long-lived poller of the history+ * (`useConversations({ poll: true })`); the chat stage reads the same store.+ *+ * Opening a row resumes it on the CHAT surface: that is where a stored+ * thread can be read and continued by typing. The voice surface shows the+ * live turn, not an archive.+ */+export function RecentChats() {+ const t = useT();+ const { conversations, activeThreadId, openConversation, removeConversation } =+ useConversations({ poll: true });+ const [open, setOpen] = useState(false);+ const setActive = useEventStore((s) => s.setActiveSection);+ const setSurface = useHomeStore((s) => s.setSurface);++ const shown = conversations.slice(0, open ? RECENT_CHATS_UNFOLDED : RECENT_CHATS_FOLDED);+ const canExpand = conversations.length > RECENT_CHATS_FOLDED;++ return (+ <SidebarGroup+ title={t("sidebar.recent_chats")}+ action={+ canExpand+ ? {+ label: open ? t("sidebar.show_less") : t("sidebar.show_all"),+ onClick: () => setOpen((v) => !v),+ expanded: open,+ }+ : undefined+ }+ testId="recent-chats"+ >+ {shown.length === 0 ? (+ <p className="px-2 py-1 text-[11px] text-muted-foreground/70">{t("sidebar.no_chats")}</p>+ ) : (+ <ul className="space-y-px">+ {shown.map((c) => (+ <ChatRow+ key={`${c.kind}-${c.id}`}+ conversation={c}+ active={c.id === activeThreadId}+ onOpen={() => {+ void openConversation(c.kind, c.id);+ setSurface("chat");+ setActive("chats");+ }}+ onDelete={() => void removeConversation(c.id)}+ />+ ))}+ </ul>+ )}+ </SidebarGroup>+ );+}++function ChatRow({+ conversation,+ active,+ onOpen,+ onDelete,+}: {+ conversation: ConversationSummary;+ active: boolean;+ onOpen: () => void;+ onDelete: () => void;+}) {+ const t = useT();+ const isVoice = conversation.kind === "voice";+ const Icon = isVoice ? Mic : MessageSquare;+ const title = conversation.title || conversation.preview || t("chats_view.new_chat");+ return (+ <li className="group relative">+ <button+ type="button"+ onClick={onOpen}+ title={title}+ data-testid="recent-chat-row"+ className={cn(+ "flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left transition-colors",+ "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",+ active ? "bg-card text-foreground shadow-sm" : "hover:bg-background/60",+ )}+ >+ <Icon+ aria-hidden+ className={cn("h-3.5 w-3.5 shrink-0", active ? "text-primary" : "text-muted-foreground")}+ />+ <span className="min-w-0 flex-1 truncate text-xs text-foreground">{title}</span>+ <span className="shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground">+ {formatWhen(conversation.updated_ms)}+ </span>+ </button>+ {!isVoice && (+ <button+ type="button"+ onClick={(e) => {+ e.stopPropagation();+ onDelete();+ }}+ title={t("chats_view.delete")}+ aria-label={t("chats_view.delete")}+ className="absolute right-1 top-1/2 hidden -translate-y-1/2 rounded-md bg-card p-1 text-muted-foreground transition-colors hover:bg-destructive/15 hover:text-destructive group-hover:block"+ >+ <Trash2 className="h-3 w-3" />+ </button>+ )}+ </li>+ );+}++function formatWhen(ms: number): string {+ if (!ms) return "";+ const d = new Date(ms);+ const today = new Date();+ today.setHours(0, 0, 0, 0);+ if (d.getTime() >= today.getTime()) {+ return d.toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit" });+ }+ return d.toLocaleDateString(undefined, { month: "short", day: "numeric" });+}diff --git a/jarvis/ui/web/frontend/src/components/home/RecentRuns.tsx b/jarvis/ui/web/frontend/src/components/home/RecentRuns.tsxnew file mode 100644index 0000000000..942b150ecd--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/home/RecentRuns.tsx@@ -0,0 +1,126 @@+import { useState } from "react";++import { useRuns } from "@/hooks/useRuns";+import { OutcomeDot } from "@/components/runs/OutcomeBadge";+import type { RunListItem } from "@/components/runs/types";+import { useEventStore } from "@/store/events";+import { useRunFocusStore } from "@/store/runFocus";+import { fill, useT } from "@/i18n";+import { cn } from "@/lib/utils";+import { SidebarGroup } from "@/components/home/SidebarGroup";++/** How many runs the block shows folded. The sketch says three. */+export const RECENT_RUNS_FOLDED = 3;+/** How many it shows unfolded — enough to scan, never a second inspector. */+export const RECENT_RUNS_UNFOLDED = 12;++/**+ * The last runs, at a glance, from the sidebar (maintainer sketch,+ * 2026-08-23): outcome dot, what was said, when, and how long. A row opens+ * the Run Inspector on that run. Reads the same query the inspector uses, so+ * there is one fetch and one cache for both.+ */+export function RecentRuns() {+ const t = useT();+ const { data: runs } = useRuns();+ const [open, setOpen] = useState(false);+ const setActive = useEventStore((s) => s.setActiveSection);+ const focus = useRunFocusStore((s) => s.focus);++ const all = runs ?? [];+ const shown = all.slice(0, open ? RECENT_RUNS_UNFOLDED : RECENT_RUNS_FOLDED);+ const canExpand = all.length > RECENT_RUNS_FOLDED;++ return (+ <SidebarGroup+ title={t("sidebar.recent_runs")}+ action={+ canExpand+ ? {+ label: open ? t("sidebar.show_less") : t("sidebar.show_all"),+ onClick: () => setOpen((v) => !v),+ expanded: open,+ }+ : undefined+ }+ testId="recent-runs"+ >+ {shown.length === 0 ? (+ <p className="px-2 py-1 text-[11px] text-muted-foreground/70">{t("sidebar.no_runs")}</p>+ ) : (+ <ul className="space-y-px">+ {shown.map((run) => (+ <RunRow+ key={run.session_id}+ run={run}+ onOpen={() => {+ focus(run.session_id);+ setActive("run_inspector");+ }}+ />+ ))}+ </ul>+ )}+ </SidebarGroup>+ );+}++function RunRow({ run, onOpen }: { run: RunListItem; onOpen: () => void }) {+ const t = useT();+ const live = run.ended_ms === null;+ const title = run.preview || run.session_id.slice(0, 8);+ const meta = live+ ? t("sidebar.run_live")+ : fill(t("sidebar.run_meta"), {+ turns: run.turn_count,+ duration: formatDuration(run.duration_s),+ });+ return (+ <li>+ <button+ type="button"+ onClick={onOpen}+ title={title}+ data-testid="recent-run-row"+ className={cn(+ "group grid w-full grid-cols-[auto_1fr_auto] items-center gap-x-2 rounded-lg px-2 py-1.5 text-left transition-colors",+ "hover:bg-background/60 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",+ )}+ >+ <OutcomeDot+ outcome={live ? "live" : run.outcome}+ className={cn(live && "bg-primary animate-jarvis-pulse")}+ />+ <span className="truncate text-xs text-foreground">{title}</span>+ <span className="font-mono text-[10px] tabular-nums text-muted-foreground">+ {formatClock(run.started_ms)}+ </span>+ <span className="col-start-2 truncate font-mono text-[10px] text-muted-foreground/80">+ {meta}+ </span>+ </button>+ </li>+ );+}++function formatDuration(seconds: number | null): string {+ if (seconds === null || !Number.isFinite(seconds)) return "—";+ const s = Math.max(0, Math.round(seconds));+ if (s < 60) return `${s}s`;+ const m = Math.floor(s / 60);+ const rest = s % 60;+ if (m < 60) return rest ? `${m}m ${rest}s` : `${m}m`;+ const h = Math.floor(m / 60);+ return `${h}h ${m % 60}m`;+}++function formatClock(ms: number): string {+ if (!ms) return "";+ const d = new Date(ms);+ const today = new Date();+ today.setHours(0, 0, 0, 0);+ if (d.getTime() >= today.getTime()) {+ return d.toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit" });+ }+ return d.toLocaleDateString(undefined, { month: "short", day: "numeric" });+}diff --git a/jarvis/ui/web/frontend/src/components/home/SidebarGroup.tsx b/jarvis/ui/web/frontend/src/components/home/SidebarGroup.tsxnew file mode 100644index 0000000000..10588eb938--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/home/SidebarGroup.tsx@@ -0,0 +1,48 @@+import { ChevronDown } from "lucide-react";++import { cn } from "@/lib/utils";++/**+ * A titled block in the sidebar — the uppercase mono label with an optional+ * action on the right ("Show all"), and whatever rows sit under it. Shared by+ * the recent-runs and recent-chats blocks so the two cannot drift apart.+ */+export function SidebarGroup({+ title,+ action,+ children,+ testId,+}: {+ title: string;+ action?: { label: string; onClick: () => void; expanded?: boolean };+ children: React.ReactNode;+ testId?: string;+}) {+ return (+ <section data-testid={testId} className="px-1">+ <div className="flex items-center justify-between px-2 pb-1 pt-2">+ <span className="font-mono text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground">+ {title}+ </span>+ {action && (+ <button+ type="button"+ onClick={action.onClick}+ aria-expanded={action.expanded}+ className="flex items-center gap-0.5 rounded-md px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-background/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"+ >+ {action.label}+ <ChevronDown+ aria-hidden+ className={cn(+ "h-3 w-3 transition-transform",+ action.expanded && "rotate-180",+ )}+ />+ </button>+ )}+ </div>+ {children}+ </section>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/home/SurfaceSwitch.tsx b/jarvis/ui/web/frontend/src/components/home/SurfaceSwitch.tsxnew file mode 100644index 0000000000..1f6c86ff00--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/home/SurfaceSwitch.tsx@@ -0,0 +1,87 @@+import { MessageSquare, Mic } from "lucide-react";++import { useHomeStore } from "@/store/home";+import { useEventStore } from "@/store/events";+import type { HomeSurface } from "@/lib/homeSurface";+import { useT } from "@/i18n";+import { cn } from "@/lib/utils";++/**+ * `Voice | Chat` — the front page's one switch, at the top of the sidebar.+ *+ * Pressing either half also lands on the front page: from any other section+ * the switch is the fastest way back to talking, and a switch that only+ * changed a hidden preference would read as broken.+ */+export function SurfaceSwitch({ className }: { className?: string }) {+ const t = useT();+ const surface = useHomeStore((s) => s.surface);+ const setSurface = useHomeStore((s) => s.setSurface);+ const setActive = useEventStore((s) => s.setActiveSection);++ const pick = (next: HomeSurface) => {+ setSurface(next);+ setActive("chats");+ };++ return (+ <div+ role="tablist"+ aria-label={t("sidebar.surface_hint")}+ data-testid="home-surface-switch"+ className={cn(+ "grid grid-cols-2 gap-0.5 rounded-xl border border-border bg-secondary p-0.5",+ className,+ )}+ >+ <SurfaceTab+ active={surface === "voice"}+ onClick={() => pick("voice")}+ icon={<Mic aria-hidden className="h-3.5 w-3.5" />}+ label={t("sidebar.surface_voice")}+ testId="home-surface-voice"+ />+ <SurfaceTab+ active={surface === "chat"}+ onClick={() => pick("chat")}+ icon={<MessageSquare aria-hidden className="h-3.5 w-3.5" />}+ label={t("sidebar.surface_chat")}+ testId="home-surface-chat"+ />+ </div>+ );+}++function SurfaceTab({+ active,+ onClick,+ icon,+ label,+ testId,+}: {+ active: boolean;+ onClick: () => void;+ icon: React.ReactNode;+ label: string;+ testId: string;+}) {+ return (+ <button+ type="button"+ role="tab"+ aria-selected={active}+ data-testid={testId}+ onClick={onClick}+ className={cn(+ "flex items-center justify-center gap-1.5 rounded-[10px] px-2 py-1.5 text-xs font-medium transition-colors",+ "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",+ active+ ? "bg-card text-foreground shadow-sm"+ : "text-muted-foreground hover:text-foreground",+ )}+ >+ {icon}+ {label}+ </button>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/home/VoiceStage.test.tsx b/jarvis/ui/web/frontend/src/components/home/VoiceStage.test.tsxnew file mode 100644index 0000000000..31274e5bb6--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/home/VoiceStage.test.tsx@@ -0,0 +1,58 @@+import { describe, expect, it } from "vitest";++import { hintFor, recentLines, waveformPhase } from "@/components/home/VoiceStage";+import { greetingKey } from "@/components/home/Greeting";+import type { ChatMessage } from "@/store/events";++const t = (key: string) => key;++function msg(role: ChatMessage["role"], content: string, i: number): ChatMessage {+ return { id: `m${i}`, role, content, ts: i };+}++describe("VoiceStage helpers", () => {+ it("keeps only the last spoken/typed lines, in order", () => {+ const all: ChatMessage[] = [+ msg("system", "boot", 0),+ msg("user", "one", 1),+ msg("preamble", "pre", 2),+ msg("assistant", "two", 3),+ msg("user", "three", 4),+ msg("assistant", "four", 5),+ ];+ expect(recentLines(all, 3).map((m) => m.content)).toEqual(["two", "three", "four"]);+ expect(recentLines(all, 10).map((m) => m.content)).toEqual(["one", "two", "three", "four"]);+ });++ it("maps the voice state onto the waveform phases, idle when offline", () => {+ expect(waveformPhase("listening", false)).toBe("idle");+ expect(waveformPhase("listening", true)).toBe("listening");+ expect(waveformPhase("thinking", true)).toBe("working");+ expect(waveformPhase("speaking", true)).toBe("speaking");+ expect(waveformPhase("error", true)).toBe("error");+ expect(waveformPhase("paused", true)).toBe("idle");+ });++ it("names the wake phrase in the idle hint and the state otherwise", () => {+ const base = { connected: true, warming: false, connecting: false, t };+ expect(hintFor({ ...base, voiceState: "idle", wakePhrase: "Hey Nova" })).toBe("home.hint_idle");+ expect(hintFor({ ...base, voiceState: "idle", wakePhrase: "" })).toBe("home.hint_idle_nowake");+ expect(hintFor({ ...base, voiceState: "listening", wakePhrase: "" })).toBe("home.hint_listening");+ expect(hintFor({ ...base, voiceState: "speaking", wakePhrase: "" })).toBe("home.hint_speaking");+ expect(hintFor({ ...base, connecting: true, voiceState: "idle", wakePhrase: "" })).toBe(+ "home.hint_connecting",+ );+ expect(hintFor({ ...base, connected: false, voiceState: "idle", wakePhrase: "" })).toBe(+ "home.hint_offline",+ );+ expect(+ hintFor({ ...base, connected: false, warming: true, voiceState: "idle", wakePhrase: "" }),+ ).toBe("home.hint_warming");+ });++ it("greets by the hour", () => {+ expect(greetingKey(8)).toBe("home.greeting_morning");+ expect(greetingKey(13)).toBe("home.greeting_afternoon");+ expect(greetingKey(21)).toBe("home.greeting_evening");+ });+});diff --git a/jarvis/ui/web/frontend/src/components/home/VoiceStage.tsx b/jarvis/ui/web/frontend/src/components/home/VoiceStage.tsxnew file mode 100644index 0000000000..dac66faa60--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/home/VoiceStage.tsx@@ -0,0 +1,234 @@+import { useEffect, useMemo, useRef } from "react";++import { useEventStore, type ChatMessage, type VoiceState } from "@/store/events";+import { VoiceWaveform, type WaveformPhase } from "@/components/overlay/VoiceWaveform";+import { voiceInputLevelRef } from "@/lib/voiceInputLevel";+import { useVoiceCall } from "@/components/agentic/useVoiceCall";+import { useVoiceReadiness } from "@/hooks/useVoiceReadiness";+import { useVoiceEngineDisplay } from "@/hooks/useVoiceEngineDisplay";+import { useWakeWord } from "@/hooks/useWakeWord";+import { fill, useT } from "@/i18n";+import { cn } from "@/lib/utils";+import { Greeting } from "@/components/home/Greeting";++/** How many finished lines the lane keeps above the bar. */+const TRANSCRIPT_LINES = 6;++/**+ * The voice stage — what the front page opens on.+ *+ * Vertically centred, one column: the greeting, the last few lines of the+ * conversation, the Jarvis bar, and one quiet line that says what to do+ * next. No microphone button (maintainer, 2026-08-23): you tap the bar, or+ * you say the wake word. The bar IS the control — the same start/stop path+ * the IDE's voice bubble uses, so there is exactly one way voice begins.+ *+ * The transcript lane reads the same `messages` the chat stage shows (a+ * spoken turn lands there as MessageSent, like a typed one) plus the live,+ * not-yet-final transcription, so what you are saying appears while you say+ * it. Older lines scroll away; this is the live turn, not an archive — the+ * archive is one click away in the sidebar's recent chats.+ */+export function VoiceStage() {+ const t = useT();+ const assistantName = useEventStore((s) => s.assistantName);+ const voiceState = useEventStore((s) => s.voiceState);+ const messages = useEventStore((s) => s.messages);+ const transcription = useEventStore((s) => s.transcription);+ const transcriptionFinal = useEventStore((s) => s.transcriptionFinal);+ const { connected, warming } = useVoiceReadiness();+ const engine = useVoiceEngineDisplay();+ const { active: callActive, busy: callBusy, connecting, toggleCall } = useVoiceCall();+ const { config: wakeConfig } = useWakeWord();+ const wakePhrase = wakeConfig?.phrase.trim() || "";++ const lines = useMemo(() => recentLines(messages, TRANSCRIPT_LINES), [messages]);+ const liveLine = transcription && !transcriptionFinal ? transcription : "";++ const laneEnd = useRef<HTMLDivElement | null>(null);+ useEffect(() => {+ laneEnd.current?.scrollIntoView({ block: "end" });+ }, [lines.length, liveLine]);++ const phase = waveformPhase(voiceState, connected);+ const pressDisabled = callBusy || connecting || !connected;+ const hint = hintFor({ connected, warming, connecting, voiceState, wakePhrase, t });+ const barLabel = callActive ? t("home.bar_stop") : t("home.bar_start");++ return (+ <div className="flex min-h-0 flex-1 flex-col items-center overflow-hidden" data-testid="voice-stage">+ <div className="flex min-h-0 w-full max-w-[760px] flex-1 flex-col justify-center gap-7 px-6 pb-14 pt-6">+ <Greeting subtitle={t("home.voice_subtitle")} muted={lines.length > 0 || Boolean(liveLine)} />++ <div+ className="flex max-h-[40vh] min-h-[96px] flex-col justify-end gap-3 overflow-y-auto px-1 scrollbar-jarvis"+ data-testid="voice-transcript"+ aria-live="polite"+ >+ {lines.map((m) => (+ <TranscriptLine+ key={m.id}+ who={m.role === "user" ? t("home.transcript_you") : assistantName}+ text={m.content}+ user={m.role === "user"}+ />+ ))}+ {liveLine && (+ <TranscriptLine who={t("home.transcript_you")} text={liveLine} user live />+ )}+ <div ref={laneEnd} />+ </div>++ <div className="flex flex-col items-center gap-3">+ <button+ type="button"+ onClick={() => void toggleCall()}+ disabled={pressDisabled}+ aria-label={barLabel}+ title={barLabel}+ data-testid="jarvis-bar"+ data-phase={phase}+ className={cn(+ "group relative flex h-16 w-full items-center gap-4 rounded-full border border-border bg-card pl-5 pr-3 text-left shadow-[0_1px_2px_rgb(var(--scrim-rgb)/0.06),0_12px_32px_rgb(var(--scrim-rgb)/0.08)] transition-[box-shadow,border-color]",+ "hover:border-primary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",+ "disabled:cursor-default disabled:opacity-80",+ callActive && "border-primary/50",+ )}+ >+ <span+ className={cn(+ "flex shrink-0 items-center gap-2 font-mono text-[10px] uppercase tracking-[0.16em]",+ callActive ? "text-primary" : "text-muted-foreground",+ )}+ >+ <span+ aria-hidden+ className={cn(+ "h-2 w-2 rounded-full",+ callActive ? "bg-primary animate-jarvis-pulse" : "bg-muted-foreground/40",+ )}+ />+ {t(`voice_state.${connecting ? "connecting" : voiceState}`)}+ </span>+ <VoiceWaveform+ levelRef={voiceInputLevelRef}+ phase={phase}+ count={28}+ frame={false}+ className="h-12 min-w-0 flex-1"+ />+ <span className="hidden shrink-0 items-center gap-1.5 rounded-full border border-border bg-secondary/60 px-2.5 py-1 font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground sm:flex">+ {engine.providerLabel}+ </span>+ </button>+ <p+ className="font-mono text-[11px] tracking-[0.04em] text-muted-foreground"+ data-testid="voice-hint"+ >+ {hint}+ </p>+ </div>+ </div>+ </div>+ );+}++function TranscriptLine({+ who,+ text,+ user,+ live = false,+}: {+ who: string;+ text: string;+ user: boolean;+ live?: boolean;+}) {+ return (+ <div+ className="grid grid-cols-[64px_1fr] items-baseline gap-x-4"+ data-testid={live ? "transcript-live" : "transcript-line"}+ >+ <span className="truncate text-right font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground">+ {who}+ </span>+ <span+ className={cn(+ "whitespace-pre-wrap",+ user ? "text-[15px] text-muted-foreground" : "font-display text-[17px] leading-snug text-foreground",+ live && "italic",+ )}+ >+ {text}+ {live && (+ <span className="ml-0.5 inline-block h-[1em] w-0.5 translate-y-0.5 animate-pulse bg-primary motion-reduce:animate-none" aria-hidden />+ )}+ </span>+ </div>+ );+}++/** The last N spoken/typed lines worth showing: user and assistant only. */+export function recentLines(messages: ChatMessage[], limit: number): ChatMessage[] {+ const out: ChatMessage[] = [];+ for (let i = messages.length - 1; i >= 0 && out.length < limit; i--) {+ const m = messages[i];+ if (m.role === "user" || m.role === "assistant") out.push(m);+ }+ return out.reverse();+}++export function waveformPhase(state: VoiceState, connected: boolean): WaveformPhase {+ if (!connected) return "idle";+ switch (state) {+ case "connecting":+ return "connecting";+ case "listening":+ return "listening";+ case "thinking":+ return "working";+ case "speaking":+ return "speaking";+ case "error":+ return "error";+ default:+ return "idle";+ }+}++/** One line under the bar: what to do, or what is happening. */+export function hintFor({+ connected,+ warming,+ connecting,+ voiceState,+ wakePhrase,+ t,+}: {+ connected: boolean;+ warming: boolean;+ connecting: boolean;+ voiceState: VoiceState;+ wakePhrase: string;+ t: (key: string) => string;+}): string {+ if (!connected) return warming ? t("home.hint_warming") : t("home.hint_offline");+ if (warming) return t("home.hint_warming");+ if (connecting) return t("home.hint_connecting");+ switch (voiceState) {+ case "listening":+ return t("home.hint_listening");+ case "thinking":+ return t("home.hint_thinking");+ case "speaking":+ return t("home.hint_speaking");+ case "paused":+ return t("home.hint_paused");+ case "error":+ return t("home.hint_error");+ default:+ return wakePhrase+ ? fill(t("home.hint_idle"), { wake: wakePhrase })+ : t("home.hint_idle_nowake");+ }+}diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.section-health.test.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.section-health.test.tsxindex 2e4ca2a889..c6c4b82df5 100644--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.section-health.test.tsx+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.section-health.test.tsx@@ -8,7 +8,8 @@* fresh install isn't permanently flagged.*/import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";-import { cleanup, render, screen } from "@testing-library/react";+import { cleanup, render as rtlRender, screen } from "@testing-library/react";+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";import type { SectionHealth } from "@/hooks/useProviders";@@ -44,6 +45,15 @@ vi.mock("@/hooks/useProviders", async (importOriginal) => {import { Sidebar } from "@/components/layout/Sidebar";import { useEventStore } from "@/store/events";+// The sidebar carries the recent-runs block (a query) since 2026-08-23, so it+// mounts under a query client like the app does.+function render(ui: React.ReactElement) {+ const client = new QueryClient({+ defaultOptions: { queries: { retry: false, staleTime: Infinity } },+ });+ return rtlRender(<QueryClientProvider client={client}>{ui}</QueryClientProvider>);+}+beforeEach(() => {mockHealth = {};useEventStore.setState({ activeSection: "chats" });diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsxindex f1ecf35d09..97181ba40a 100644--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx@@ -115,9 +115,10 @@ describe("Sidebar voice header", () => {expect(container.querySelector(".gigi-bubble")).toBeNull();});- test("still shows the live transcription in its own box while listening", () => {- // The transcript is already surfaced by the sidebar's dedicated box, so- // dropping the mascot bubble loses no information.+ test("no longer shows the live transcription — that lane moved to the voice stage", () => {+ // Since 2026-08-23 the transcript is read on the front page itself+ // (components/home/VoiceStage), where it has the room to be read; the+ // sidebar box would be a second, cramped copy of the same words.useEventStore.setState({voiceState: "listening",transcription: "auflegen",@@ -126,9 +127,13 @@ describe("Sidebar voice header", () => {renderSidebar();- // getByText throws if absent or if it matches more than once — so a single- // hit proves the transcript survives exactly once (no duplicate bubble).- expect(screen.getByText("auflegen")).toBeTruthy();+ expect(screen.queryByText("auflegen")).toBeNull();+ });++ test("carries the Voice | Chat switch and a New chat button", () => {+ renderSidebar();+ expect(screen.getByTestId("home-surface-switch")).toBeTruthy();+ expect(screen.getByTestId("sidebar-new-chat")).toBeTruthy();});});@@ -175,7 +180,9 @@ describe("Sidebar header avatar", () => {act(() => {logo.dispatchEvent(new Event("error"));- vi.runAllTimers();+ // Past the first retry delay only: the sidebar also owns a polling+ // interval (recent chats), so running ALL timers would never return.+ vi.advanceTimersByTime(2_000);});expect(logo.getAttribute("src")).toBe("/jarvis-logo.png?retry=1");diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsxindex 51a1c775c4..0d19547865 100644--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx@@ -3,6 +3,7 @@ import {ChevronRight,PanelLeftClose,PanelLeftOpen,+ Plus,} from "lucide-react";import {NAV_GROUPS,@@ -20,6 +21,11 @@ import { cn } from "@/lib/utils";import { useMemo, useState } from "react";import { useT } from "@/i18n";import { BrowserRealtimeControl } from "@/components/voice/BrowserRealtimeControl";+import { SurfaceSwitch } from "@/components/home/SurfaceSwitch";+import { RecentRuns } from "@/components/home/RecentRuns";+import { RecentChats } from "@/components/home/RecentChats";+import { useConversations } from "@/hooks/useConversations";+import { useHomeStore } from "@/store/home";import { PRODUCT_NAME } from "@/lib/branding";// A logo request that fails once (backend restarting, dist mid-rebuild) would@@ -99,8 +105,15 @@ export function Sidebar({const setActive = useEventStore((s) => s.setActiveSection);const voiceState = useEventStore((s) => s.voiceState);const assistantName = useEventStore((s) => s.assistantName);- const transcription = useEventStore((s) => s.transcription);- const transcriptionFinal = useEventStore((s) => s.transcriptionFinal);+ // "+ New chat" lands on the chat surface of the front page with an empty+ // thread — the sidebar owns the history now, so it owns this too.+ const { newChat } = useConversations();+ const setSurface = useHomeStore((s) => s.setSurface);+ const startNewChat = () => {+ newChat();+ setSurface("chat");+ setActive("chats");+ };// Shared readiness derivation (same source the banner + chat empty-state use).const { connected, voiceWarming, bootWarming, warming } = useVoiceReadiness();@@ -289,30 +302,21 @@ export function Sidebar({</div>{!railed && (<>- <div className="jarvis-input-surface mt-3 min-h-[20px] rounded-md px-2 py-1.5 text-xs text-muted-foreground">- {transcription ? (- <span- className={cn(- "font-mono",- !transcriptionFinal && "italic text-foreground/70",- )}- >- {tailTruncate(transcription, 48)}- {!transcriptionFinal && (- <span- className="ml-px animate-pulse motion-reduce:animate-none"- aria-hidden="true"- >- ▍- </span>- )}- </span>- ) : (- <span className="text-muted-foreground/50">- {t("sidebar.wake_hint")}- </span>- )}- </div>+ {/* The front page's one switch (maintainer sketch, 2026-08-23):+ Voice or Chat. The live transcript that used to sit here moved+ onto the voice stage itself, where it has the room to be read. */}+ <SurfaceSwitch className="mt-3" />+ <button+ type="button"+ onClick={startNewChat}+ data-testid="sidebar-new-chat"+ className="mt-2 flex w-full items-center gap-2 rounded-lg border border-border bg-card px-2.5 py-1.5 text-xs font-medium text-foreground transition-colors hover:border-primary/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"+ >+ <span className="flex h-4 w-4 items-center justify-center rounded bg-primary text-primary-foreground">+ <Plus aria-hidden className="h-3 w-3" />+ </span>+ {t("sidebar.new_chat")}+ </button><BrowserRealtimeControl /></>)}@@ -325,6 +329,9 @@ export function Sidebar({<DockRail className="min-h-0 flex-1" />) : (<nav className="flex-1 overflow-y-auto scrollbar-jarvis p-2">+ <RecentRuns />+ <RecentChats />+ <div className="mx-1 mb-1 mt-2 border-t border-border/60" aria-hidden />{NAV_GROUPS.map((group, groupIndex) => (<ulkey={groupIndex}@@ -501,15 +508,3 @@ function NavRow({</li>);}--/** Keep the NEWEST words of a growing transcript visible.- *- * Head truncation froze the line on the first 48 characters the moment a- * sentence outgrew the box: the user kept talking and the display stopped- * moving, which reads as "it stopped hearing me". Dropping the oldest end- * instead makes the line scroll along with the speech. */-function tailTruncate(s: string, n: number): string {- if (s.length <= n) return s;- return "…" + s.slice(s.length - (n - 1));-}-diff --git a/jarvis/ui/web/frontend/src/components/layout/ThemeToggle.tsx b/jarvis/ui/web/frontend/src/components/layout/ThemeToggle.tsxnew file mode 100644index 0000000000..ba962bdf10--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/layout/ThemeToggle.tsx@@ -0,0 +1,40 @@+import { Moon, Sun } from "lucide-react";++import { useOptionalTheme } from "@/hooks/useTheme";+import { useT } from "@/i18n";+import { cn } from "@/lib/utils";++/**+ * Light ↔ dark, one click, from the app chrome.+ *+ * The full preference (including "follow the system") stays in Settings; this+ * is the quick flip the maintainer asked for in the top bar (2026-08-23).+ * Flipping from "system" resolves to the concrete opposite of what is on+ * screen, so the button always does the visible thing.+ */+export function ThemeToggle({ className }: { className?: string }) {+ const t = useT();+ // Outside the provider (an isolated mount) there is nothing to flip: the+ // rest of the actions keep rendering, this one steps aside.+ const ctx = useOptionalTheme();+ if (!ctx) return null;+ const { theme, toggle } = ctx;+ const dark = theme === "dark";+ const label = dark ? t("home.theme_to_light") : t("home.theme_to_dark");+ const Icon = dark ? Sun : Moon;+ return (+ <button+ type="button"+ onClick={toggle}+ title={label}+ aria-label={label}+ data-testid="theme-toggle"+ className={cn(+ "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-border bg-secondary/40 text-muted-foreground transition-colors hover:border-primary/50 hover:text-foreground",+ className,+ )}+ >+ <Icon aria-hidden className="h-3.5 w-3.5" />+ </button>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/layout/TopBar.test.tsx b/jarvis/ui/web/frontend/src/components/layout/TopBar.test.tsxindex 04f26b86ce..6c53962a6f 100644--- a/jarvis/ui/web/frontend/src/components/layout/TopBar.test.tsx+++ b/jarvis/ui/web/frontend/src/components/layout/TopBar.test.tsx@@ -2,7 +2,6 @@ import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/reimport { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { TopBar, TopBarActions } from "./TopBar";import { useEventStore } from "@/store/events";-import { useDeckStore } from "@/store/deck";vi.mock("@/hooks/useUpdate", () => ({useUpdate: () => ({ status: { managed: false, update_available: false } }),@@ -12,16 +11,16 @@ vi.mock("@/components/MascotGigi", () => ({}));// The bar is section-aware now, so every test below states which screen it is-// on rather than inheriting whatever a previous one left behind. Classic-// chat keeps the global bar; the mission deck renders no bar of its own-// (the actions live in that header — see the deck describe below).+// on rather than inheriting whatever a previous one left behind. The front+// page ("chats") renders no bar of its own — its header carries the actions+// (see the front-page describe below); a detachable section that keeps the+// bar stands in for the general case.beforeEach(() => {useEventStore.setState({- activeSection: "chats",+ activeSection: "dictation",solo: false,detachedViews: [],});- useDeckStore.setState({ mode: "classic" });});afterEach(() => vi.restoreAllMocks());@@ -152,16 +151,15 @@ describe("TopBar restart button", () => {* through that Restart button, so a refactor that quietly drops it from the IDE* would leave the section with no way to pick up its own rebuild.*/-describe("TopBar on the mission deck", () => {- it("renders no bar of its own there — the deck header carries the actions", () => {- useDeckStore.setState({ mode: "deck" });+describe("TopBar on the front page", () => {+ it("renders no bar of its own there — the home header carries the actions", () => {+ useEventStore.setState({ activeSection: "chats" });const { container } = render(<TopBar />);expect(container.firstChild).toBeNull();});it("restores the global bar in the main window while chats is detached", () => {- useDeckStore.setState({ mode: "deck" });- useEventStore.setState({ detachedViews: ["chats"] });+ useEventStore.setState({ activeSection: "chats", detachedViews: ["chats"] });const { container } = render(<TopBar />);expect(container.firstChild).not.toBeNull();expect(screen.getByRole("button", { name: /^restart$/i })).toBeTruthy();diff --git a/jarvis/ui/web/frontend/src/components/layout/TopBar.tsx b/jarvis/ui/web/frontend/src/components/layout/TopBar.tsxindex 4a408cf6b1..a6d1e3f245 100644--- a/jarvis/ui/web/frontend/src/components/layout/TopBar.tsx+++ b/jarvis/ui/web/frontend/src/components/layout/TopBar.tsx@@ -2,11 +2,11 @@ import { useCallback, useEffect, useRef, useState } from "react";import { AppWindow, Download, RotateCw } from "lucide-react";import { useEventStore, type SectionId } from "@/store/events";-import { useDeckStore } from "@/store/deck";import { useUpdate } from "@/hooks/useUpdate";import { useT } from "@/i18n";import { cn } from "@/lib/utils";import { CodingModeBadge } from "@/components/layout/CodingModeBadge";+import { ThemeToggle } from "@/components/layout/ThemeToggle";import { hasEmbeddedDesktopBridge } from "@/components/voice/BrowserRealtimeControl";import { openExternalUrl } from "@/lib/openExternal";@@ -52,7 +52,6 @@ export function TopBar() {const activeSection = useEventStore((s) => s.activeSection);const solo = useEventStore((s) => s.solo);const detachedViews = useEventStore((s) => s.detachedViews);- const deckMode = useDeckStore((s) => s.mode);// The coding workspace takes the actions into its own toolbar row, under// every id that reaches it. The rule is "the section carries the actions// itself" — a section that does not would lose Restart, which is the one@@ -66,14 +65,13 @@ export function TopBar() {}/*- * The deck already has a header. A second empty strip above it was the- * boring row. Same rule as the IDE: this bar steps aside, the actions- * move into that header (`MissionDeckView`). While chats is detached the- * main window is a placeholder and needs the bar back.+ * The front page already has a header. A second empty strip above it was+ * the boring row. Same rule as the IDE: this bar steps aside, the actions+ * move into that header (`HomeView`). While chats is detached the main+ * window is a placeholder and needs the bar back.*/- const deckOnStage = activeSection === "chats" && deckMode === "deck";const chatsDetached = !solo && detachedViews.includes("chats");- if (deckOnStage && !chatsDetached) {+ if (activeSection === "chats" && !chatsDetached) {return null;}@@ -99,6 +97,7 @@ export function TopBar() {export function TopBarActions() {return (<>+ <ThemeToggle /><DetachButton /><UpdateButton /><RestartButton />diff --git a/jarvis/ui/web/frontend/src/components/overlay/VoiceWaveform.tsx b/jarvis/ui/web/frontend/src/components/overlay/VoiceWaveform.tsxindex e18cb3746d..48ed4f5c3b 100644--- a/jarvis/ui/web/frontend/src/components/overlay/VoiceWaveform.tsx+++ b/jarvis/ui/web/frontend/src/components/overlay/VoiceWaveform.tsx@@ -119,12 +119,19 @@ function VoiceWaveformImpl({phase,count = LIVE_BAR_COUNT,className,+ frame = true,}: {/** Normalized 0..1 microphone level, written by the audio callback. */levelRef: MutableRefObject<number>;phase: WaveformPhase;count?: number;className?: string;+ /**+ * Draw the pill around the bars. Off when the bars sit inside a frame the+ * caller already drew (the front page's Jarvis bar), so the waveform does+ * not arrive as a capsule inside a capsule.+ */+ frame?: boolean;}) {// One ref on the group rather than one per bar: an inline ref callback is a// new function on every render, so React would detach and re-attach all@@ -242,19 +249,21 @@ function VoiceWaveformImpl({data-phase={phase}aria-hidden="true">- <rect- x={PILL_X}- y={PILL_Y}- width={PILL_W}- height={PILL_H}- rx={PILL_R}- strokeWidth={1.6}- className={cn("fill-card", tone.rim)}- style={{- strokeOpacity: tone.rimOpacity,- transition: "stroke 300ms ease, stroke-opacity 300ms ease",- }}- />+ {frame && (+ <rect+ x={PILL_X}+ y={PILL_Y}+ width={PILL_W}+ height={PILL_H}+ rx={PILL_R}+ strokeWidth={1.6}+ className={cn("fill-card", tone.rim)}+ style={{+ strokeOpacity: tone.rimOpacity,+ transition: "stroke 300ms ease, stroke-opacity 300ms ease",+ }}+ />+ )}<gref={row}className={tone.bars}diff --git a/jarvis/ui/web/frontend/src/hooks/useApplyWallpaper.ts b/jarvis/ui/web/frontend/src/hooks/useApplyWallpaper.tsindex 1957629d8e..a95404a984 100644--- a/jarvis/ui/web/frontend/src/hooks/useApplyWallpaper.ts+++ b/jarvis/ui/web/frontend/src/hooks/useApplyWallpaper.ts@@ -27,10 +27,16 @@ import { useWallpaperStore } from "@/store/wallpaper";*/export function useApplyWallpaper(): (item: WallpaperEntry | null) => void {const select = useWallpaperStore((state) => state.select);+ const setBackground = useWallpaperStore((state) => state.setBackground);const { theme: current, setPreference } = useTheme();return useCallback((item: WallpaperEntry | null) => {+ // Picking a picture is the act of wanting a wallpaper: the app paints+ // on a flat colour by default, and this is the one place that turns the+ // artwork on (lib/backgroundMode.ts). The "Solid colour" control in the+ // Wallpaper section is the way back.+ setBackground("wallpaper");if (item === null) {select(null, current);return;@@ -45,6 +51,6 @@ export function useApplyWallpaper(): (item: WallpaperEntry | null) => void {select(item.isDefault ? null : item.id, item.theme);setPreference(item.theme);},- [select, setPreference, current],+ [select, setBackground, setPreference, current],);}diff --git a/jarvis/ui/web/frontend/src/hooks/useConversations.ts b/jarvis/ui/web/frontend/src/hooks/useConversations.tsnew file mode 100644index 0000000000..e6484e315b--- /dev/null+++ b/jarvis/ui/web/frontend/src/hooks/useConversations.ts@@ -0,0 +1,88 @@+import { useCallback, useEffect } from "react";++import { useEventStore, type ConversationKind } from "@/store/events";+import {+ deleteTextConversation,+ detailToMessages,+ fetchConversations,+ resumeConversation,+} from "@/lib/chatsApi";++/** How often the history list is re-read while a poller is mounted. */+export const CONVERSATIONS_REFRESH_MS = 5000;++/**+ * The unified chat history (text threads + voice sessions) and the three+ * things anyone does with it: open one, start a new one, delete one.+ *+ * Lifted out of the old two-pane chat view so the sidebar's "recent chats"+ * block and the chat stage read ONE list and act on it the same way. The+ * list itself lives in the event store; `poll` says whether this mount keeps+ * it fresh (GET /api/chats is a fast local query). Exactly one long-lived+ * mount should poll — the sidebar — so a second surface showing the same+ * list does not double the traffic.+ */+export function useConversations({ poll = false }: { poll?: boolean } = {}) {+ const conversations = useEventStore((s) => s.conversations);+ const activeThreadId = useEventStore((s) => s.activeThreadId);+ const activeKind = useEventStore((s) => s.activeKind);+ const setConversations = useEventStore((s) => s.setConversations);+ const setActiveConversation = useEventStore((s) => s.setActiveConversation);+ const setMessages = useEventStore((s) => s.setMessages);++ const refresh = useCallback(async () => {+ try {+ setConversations(await fetchConversations());+ } catch {+ /* offline / headless — leave the list as-is */+ }+ }, [setConversations]);++ useEffect(() => {+ if (!poll) return;+ void refresh();+ const id = window.setInterval(() => void refresh(), CONVERSATIONS_REFRESH_MS);+ return () => window.clearInterval(id);+ }, [poll, refresh]);++ const openConversation = useCallback(+ async (kind: ConversationKind, id: string) => {+ setActiveConversation(kind, id);+ try {+ const detail = await resumeConversation(kind, id);+ setMessages(detailToMessages(detail));+ } catch {+ setMessages([]);+ }+ },+ [setActiveConversation, setMessages],+ );++ const newChat = useCallback(() => {+ setActiveConversation("text", null);+ setMessages([]);+ }, [setActiveConversation, setMessages]);++ const removeConversation = useCallback(+ async (id: string) => {+ try {+ await deleteTextConversation(id);+ } catch {+ /* the list refresh below shows what is really there */+ }+ if (useEventStore.getState().activeThreadId === id) newChat();+ void refresh();+ },+ [newChat, refresh],+ );++ return {+ conversations,+ activeThreadId,+ activeKind,+ refresh,+ openConversation,+ newChat,+ removeConversation,+ };+}diff --git a/jarvis/ui/web/frontend/src/hooks/useTheme.tsx b/jarvis/ui/web/frontend/src/hooks/useTheme.tsxindex a3b7eb64b2..ba415dbd0c 100644--- a/jarvis/ui/web/frontend/src/hooks/useTheme.tsx+++ b/jarvis/ui/web/frontend/src/hooks/useTheme.tsx@@ -207,6 +207,16 @@ export function useTheme(): ThemeCtx {return ctx;}+/**+ * The theme switch WHEN there is one. For a control that flips the theme but+ * is carried by chrome that also renders in isolation (the top-bar actions,+ * reused by views and their unit tests): undefined outside the provider, so+ * the control can step aside instead of taking its whole bar down.+ */+export function useOptionalTheme(): ThemeCtx | undefined {+ return useContext(Ctx);+}+/*** The current theme for components that merely want to MATCH it.*diff --git a/jarvis/ui/web/frontend/src/hooks/useUserName.ts b/jarvis/ui/web/frontend/src/hooks/useUserName.tsnew file mode 100644index 0000000000..1964264cbd--- /dev/null+++ b/jarvis/ui/web/frontend/src/hooks/useUserName.ts@@ -0,0 +1,27 @@+import { useQuery } from "@tanstack/react-query";++interface ProfileUser {+ user?: { name?: string | null } | null;+}++/**+ * The person's own name, as the Profile section knows it — for the front+ * page greeting. Same query key as the Profile view, so the two share one+ * fetch and one cache. Null while loading, on a headless host, or when the+ * profile simply has no name yet; the greeting then drops the name rather+ * than inventing one.+ */+export function useUserName(): string | null {+ const { data } = useQuery({+ queryKey: ["profile"],+ queryFn: async (): Promise<ProfileUser> => {+ const res = await fetch("/api/profile");+ if (!res.ok) throw new Error(`HTTP ${res.status}`);+ return (await res.json()) as ProfileUser;+ },+ staleTime: 60_000,+ retry: false,+ });+ const name = data?.user?.name;+ return typeof name === "string" && name.trim() ? name.trim() : null;+}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex fd4497acb4..ec05ec69ea 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -452,6 +452,18 @@},"sidebar": {"collapse": "Navigation einklappen",+ "surface_voice": "Voice",+ "surface_chat": "Chat",+ "surface_hint": "Startseite zwischen Sprache und getipptem Chat umschalten",+ "new_chat": "Neuer Chat",+ "recent_runs": "Letzte Runs",+ "recent_chats": "Letzte Chats",+ "show_all": "Alle anzeigen",+ "show_less": "Weniger anzeigen",+ "no_runs": "Noch keine Runs",+ "no_chats": "Noch keine Unterhaltungen",+ "run_meta": "{turns} Turns · {duration}",+ "run_live": "live","expand": "Navigation ausklappen","wake_hint": "Sag dein Wake-Word…","brain_label": "Brain",@@ -494,6 +506,34 @@"local": "Lokal, kein Key nötig"},"chats_view": {+ "home": {+ "greeting_morning": "Guten Morgen{name_part}",+ "greeting_afternoon": "Guten Tag{name_part}",+ "greeting_evening": "Guten Abend{name_part}",+ "voice_subtitle": "Sag dein Wake‑Wort oder tippe auf die Leiste — die Unterhaltung erscheint hier.",+ "transcript_you": "Du",+ "hint_idle": "Sag „{wake}“ oder tippe auf die Leiste",+ "hint_idle_nowake": "Tippe auf die Leiste, um zu starten",+ "hint_listening": "Ich höre zu…",+ "hint_thinking": "Denke nach…",+ "hint_speaking": "Spreche…",+ "hint_paused": "Pausiert — tippe auf die Leiste, um weiterzumachen",+ "hint_connecting": "Verbinde…",+ "hint_warming": "Voice startet…",+ "hint_offline": "Voice ist offline",+ "hint_error": "Voice hat ein Problem — tippe auf die Leiste, um es erneut zu versuchen",+ "bar_start": "Tippen, um die Unterhaltung zu starten",+ "bar_stop": "Tippen, um die Unterhaltung zu beenden",+ "chat_empty_title": "Wie kann ich helfen?",+ "composer_hint": "Enter sendet · Shift+Enter für eine neue Zeile",+ "model_hint": "Verwendetes Modell — zum Ändern klicken",+ "theme_to_light": "Zum hellen Modus wechseln",+ "theme_to_dark": "Zum dunklen Modus wechseln",+ "background_label": "Hintergrund",+ "background_solid": "Einfarbig",+ "background_wallpaper": "Hintergrundbild",+ "background_hint": "Die App zeichnet standardmäßig auf einer einfarbigen Fläche. Wähle unten ein Bild, um es als Hintergrund zu nutzen; „Einfarbig“ bringt die schlichte Fläche zurück."+ },"title": "Chat","subtitle": "Rede mit deinem Assistenten oder schreibe — beides landet im selben Event-Bus.","thinking_aria": "Dein Assistent denkt nach",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex 99653ee531..d732345f02 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -452,6 +452,18 @@},"sidebar": {"collapse": "Collapse the navigation",+ "surface_voice": "Voice",+ "surface_chat": "Chat",+ "surface_hint": "Switch the front page between voice and typed chat",+ "new_chat": "New chat",+ "recent_runs": "Recent runs",+ "recent_chats": "Recent chats",+ "show_all": "Show all",+ "show_less": "Show less",+ "no_runs": "No runs yet",+ "no_chats": "No conversations yet",+ "run_meta": "{turns} turns · {duration}",+ "run_live": "live","expand": "Expand the navigation","wake_hint": "Say your wake word…","brain_label": "Brain",@@ -494,6 +506,34 @@"local": "Local, no key needed"},"chats_view": {+ "home": {+ "greeting_morning": "Good morning{name_part}",+ "greeting_afternoon": "Good afternoon{name_part}",+ "greeting_evening": "Good evening{name_part}",+ "voice_subtitle": "Say your wake word or tap the bar — the conversation shows up here.",+ "transcript_you": "You",+ "hint_idle": "Say “{wake}” or tap the bar to start",+ "hint_idle_nowake": "Tap the bar to start",+ "hint_listening": "Listening…",+ "hint_thinking": "Thinking…",+ "hint_speaking": "Speaking…",+ "hint_paused": "Paused — tap the bar to continue",+ "hint_connecting": "Connecting…",+ "hint_warming": "Voice is starting up…",+ "hint_offline": "Voice is offline",+ "hint_error": "Voice ran into a problem — tap the bar to try again",+ "bar_start": "Tap to start the conversation",+ "bar_stop": "Tap to end the conversation",+ "chat_empty_title": "How can I help?",+ "composer_hint": "Enter to send · Shift+Enter for a new line",+ "model_hint": "Model in use — click to change it",+ "theme_to_light": "Switch to light mode",+ "theme_to_dark": "Switch to dark mode",+ "background_label": "Background",+ "background_solid": "Solid colour",+ "background_wallpaper": "Wallpaper",+ "background_hint": "The app paints on a plain colour by default. Pick a picture below to use it as your wallpaper; “Solid colour” brings the plain ground back."+ },"title": "Chat","subtitle": "Talk to your assistant or type — both go through the same event bus.","thinking_aria": "Your assistant is thinking",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex 6e9ed7c7a7..b215904794 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -452,6 +452,18 @@},"sidebar": {"collapse": "Contraer la navegación",+ "surface_voice": "Voz",+ "surface_chat": "Chat",+ "surface_hint": "Cambiar la página de inicio entre voz y chat escrito",+ "new_chat": "Nuevo chat",+ "recent_runs": "Últimas ejecuciones",+ "recent_chats": "Chats recientes",+ "show_all": "Mostrar todo",+ "show_less": "Mostrar menos",+ "no_runs": "Aún no hay ejecuciones",+ "no_chats": "Aún no hay conversaciones",+ "run_meta": "{turns} turnos · {duration}",+ "run_live": "en vivo","expand": "Expandir la navegación","wake_hint": "Di tu palabra de activación…","brain_label": "Cerebro",@@ -494,6 +506,34 @@"local": "Local, no necesita clave"},"chats_view": {+ "home": {+ "greeting_morning": "Buenos días{name_part}",+ "greeting_afternoon": "Buenas tardes{name_part}",+ "greeting_evening": "Buenas noches{name_part}",+ "voice_subtitle": "Di tu palabra de activación o toca la barra — la conversación aparece aquí.",+ "transcript_you": "Tú",+ "hint_idle": "Di «{wake}» o toca la barra para empezar",+ "hint_idle_nowake": "Toca la barra para empezar",+ "hint_listening": "Escuchando…",+ "hint_thinking": "Pensando…",+ "hint_speaking": "Hablando…",+ "hint_paused": "En pausa — toca la barra para continuar",+ "hint_connecting": "Conectando…",+ "hint_warming": "La voz se está iniciando…",+ "hint_offline": "La voz está desconectada",+ "hint_error": "La voz tuvo un problema — toca la barra para intentarlo de nuevo",+ "bar_start": "Toca para iniciar la conversación",+ "bar_stop": "Toca para terminar la conversación",+ "chat_empty_title": "¿En qué puedo ayudar?",+ "composer_hint": "Enter envía · Shift+Enter para una nueva línea",+ "model_hint": "Modelo en uso — haz clic para cambiarlo",+ "theme_to_light": "Cambiar al modo claro",+ "theme_to_dark": "Cambiar al modo oscuro",+ "background_label": "Fondo",+ "background_solid": "Color sólido",+ "background_wallpaper": "Fondo de pantalla",+ "background_hint": "La app se dibuja sobre un color liso por defecto. Elige una imagen abajo para usarla de fondo; «Color sólido» devuelve la superficie lisa."+ },"title": "Chat","subtitle": "Habla con tu asistente o escribe — ambos pasan por el mismo bus de eventos.","thinking_aria": "Tu asistente está pensando",diff --git a/jarvis/ui/web/frontend/src/index.css b/jarvis/ui/web/frontend/src/index.cssindex 07d9ce88c1..7ed222b37e 100644--- a/jarvis/ui/web/frontend/src/index.css+++ b/jarvis/ui/web/frontend/src/index.css@@ -420,30 +420,37 @@* exist for; each is a bare `R G B` list meant for `rgb(var(--x) / <alpha>)`.*/:root {- /* --- Light: warm paper, dark gold ------------------------------------ */- --background: 42 33% 96%; /* warm ivory behind the artwork */- --foreground: 240 9% 18%; /* #2B2B33 warm near-black */- --card: 42 33% 96%; /* ivory glass, never a white plastic rectangle */- --card-foreground: 240 9% 18%;- --popover: 42 33% 97%;- --popover-foreground: 240 9% 18%;+ /* --- Light: warm paper, dark gold ------------------------------------+ The ground is a solid colour by default (2026-08-23, maintainer: the+ app no longer opens on a wallpaper). Warm paper rather than pure+ white, a white card ON the paper so surfaces read as surfaces, and+ hairlines a touch warmer than grey. */+ --background: 48 33% 97%; /* #FAF9F5 warm paper */+ --foreground: 60 2% 8%; /* #141413 ink */+ --card: 0 0% 100%; /* white card on paper */+ --card-foreground: 60 2% 8%;+ --popover: 0 0% 100%;+ --popover-foreground: 60 2% 8%;/* #A86B00. The signal-yellow of the dark theme is 1.4:1 on paper — abutton nobody can read. This is the same gold the light terminal themealready uses for its cursor, at 5.1:1 against --background. */--primary: 38 100% 33%;--primary-foreground: 0 0% 100%; /* white on gold */- --secondary: 42 22% 90%; /* warm recessed surface */- --secondary-foreground: 240 9% 18%;- --muted: 42 22% 90%;- --muted-foreground: 240 6% 30%;+ --secondary: 52 29% 95%; /* #F5F4ED recessed surface, hover */+ --secondary-foreground: 60 2% 8%;+ --muted: 52 29% 95%;+ --muted-foreground: 51 6% 40%; /* #6C6A5F */--accent: 38 100% 33%;--accent-foreground: 0 0% 100%;--destructive: 6 63% 46%; /* #C0392B — the light terminal's red */--destructive-foreground: 0 0% 100%;- --border: 40 14% 72%;- --input: 42 22% 90%;+ --border: 50 21% 89%; /* #E8E6DC */+ --input: 52 29% 95%;--ring: 38 100% 33%;--radius: 0.75rem;+ /* The navigation column's own ground — a shade below the paper, so the+ rail reads as a rail without a border doing all the work. */+ --sidebar: 48 25% 92%; /* #F0EEE6 *//* --- Effect channels (see the note above) ---------------------------- *//* The accent as raw channels, for glows / grid lines / halos. */@@ -458,7 +465,7 @@--sheen-rgb: 43 43 51;/* The ground colour of the app shell as channels, for glass pills thatmust read as "the app, blurred" rather than a grey rectangle. */- --shell-rgb: 246 242 232;+ --shell-rgb: 250 249 245;/* Light mode changes the interface ink, not the chosen wallpaper. Fullytransparent surfaces were tried first, but with user-chosen wallpapers@@ -514,31 +521,35 @@}.dark {- /* --- Dark: matte black, signal yellow — the product default ---------- */- --background: 0 0% 4%; /* #0A0A0A matte-black */- --foreground: 0 0% 96%; /* #F4F4F5 */- --card: 0 0% 6%; /* #0F0F0F */- --card-foreground: 0 0% 96%;- --popover: 0 0% 6%;- --popover-foreground: 0 0% 96%;+ /* --- Dark: warm charcoal, signal yellow — the product default --------+ Not pure black any more (2026-08-23): a warm charcoal ground, a rail+ one step darker, a card one step lighter. Same family as the light+ paper, so toggling the theme changes the value, not the temperature. */+ --background: 60 3% 15%; /* #262624 charcoal */+ --foreground: 48 23% 95%; /* #F5F4EF */+ --card: 60 2% 18%; /* #30302E */+ --card-foreground: 48 23% 95%;+ --popover: 60 2% 18%;+ --popover-foreground: 48 23% 95%;--primary: 50 100% 52%; /* #FFD60A signal-yellow */--primary-foreground: 0 0% 4%; /* black on yellow */- --secondary: 0 0% 10%; /* #1A1A1A */- --secondary-foreground: 0 0% 96%;- --muted: 0 0% 10%;- --muted-foreground: 0 0% 56%; /* #8F8F8F */+ --secondary: 60 2% 21%; /* #363634 recessed surface, hover */+ --secondary-foreground: 48 23% 95%;+ --muted: 60 2% 21%;+ --muted-foreground: 47 5% 59%; /* #9C9A92 */--accent: 50 100% 52%;--accent-foreground: 0 0% 4%;--destructive: 0 84% 60%;- --destructive-foreground: 0 0% 96%;- --border: 0 0% 14%; /* #242424 */- --input: 0 0% 10%;+ --destructive-foreground: 48 23% 95%;+ --border: 40 3% 23%; /* #3B3A38 */+ --input: 60 2% 21%;--ring: 50 100% 52%;+ --sidebar: 30 3% 12%; /* #1F1E1D */--accent-rgb: 255 214 10;--scrim-rgb: 0 0 0;--sheen-rgb: 255 255 255;- --shell-rgb: 10 10 10;+ --shell-rgb: 38 38 36;--surface-card-alpha: 0.6;--surface-panel-alpha: 0.58;@@ -3041,3 +3052,87 @@transform: none !important;}}++/*+ * ===========================================================================+ * Solid ground — the default since 2026-08-23+ * ===========================================================================+ *+ * The app opens on a plain theme colour now; a wallpaper is an opt-in+ * (`lib/backgroundMode.ts`, toggled by the Wallpaper section). The whole+ * readability floor above — glass alphas, text halos, SVG outline rings,+ * token floors — exists to keep ink legible over arbitrary artwork, and+ * every one of those treatments is a defect on a flat colour: a halo around+ * text on paper reads as a printing error, and a 60 % glass card on its own+ * ground is just a slightly wrong card.+ *+ * So the floor is switched off as a whole wherever <html> lacks the+ * `jarvis-wallpaper` class (set by the boot script in index.html and kept in+ * step by the wallpaper store). Placed in the utilities layer on purpose:+ * a later layer beats an earlier one regardless of specificity, so these+ * few rules undo the components-layer floor without having to out-specify+ * each of its selectors one by one. Rules that live in the utilities layer+ * themselves are matched at equal specificity and simply come later.+ */+@layer utilities {+ :root:not(.jarvis-wallpaper) {+ /* Opaque surfaces: the card tokens ARE the surface hierarchy now. */+ --surface-card-alpha: 1;+ --surface-panel-alpha: 1;+ --surface-control-alpha: 1;+ --surface-stage-alpha: 1;+ --surface-wiki-pane-alpha: 1;+ --surface-wiki-stage-alpha: 1;+ }++ /* No halos, no outline rings, no re-floored tokens. `inherit` hands the+ custom property back to the value <html> carries for the active theme. */+ :root:not(.jarvis-wallpaper) .jarvis-section-stage,+ :root:not(.jarvis-wallpaper) .jarvis-nav-surface,+ :root:not(.jarvis-wallpaper) .jarvis-shell-surface,+ :root:not(.jarvis-wallpaper) [data-testid="agentic-toolbar"],+ :root:not(.jarvis-wallpaper) [data-testid="agentic-chat-rail"] {+ --muted-foreground: inherit;+ --border: inherit;+ text-shadow: none;+ }++ :root:not(.jarvis-wallpaper) .jarvis-nav-surface svg,+ :root:not(.jarvis-wallpaper) .jarvis-shell-surface svg,+ :root:not(.jarvis-wallpaper) [data-testid="agentic-toolbar"] svg,+ :root:not(.jarvis-wallpaper) [data-testid="agentic-chat-rail"] svg {+ filter: none;+ }++ /* The chrome gets a ground of its own on a flat colour: the nav column+ one step below the page, the top bar on the page itself. */+ :root:not(.jarvis-wallpaper) .jarvis-nav-surface {+ background: hsl(var(--sidebar));+ }++ :root:not(.jarvis-wallpaper) .jarvis-shell-surface {+ background: hsl(var(--background));+ -webkit-backdrop-filter: none;+ backdrop-filter: none;+ }++ /* The glass surfaces become the plain card / control / panel they stand+ for. No blur: there is nothing behind them to blur. */+ :root:not(.jarvis-wallpaper) .jarvis-message-surface,+ :root:not(.jarvis-wallpaper) .jarvis-panel-surface {+ background: hsl(var(--card));+ -webkit-backdrop-filter: none;+ backdrop-filter: none;+ }++ :root:not(.jarvis-wallpaper) .jarvis-input-surface {+ background: hsl(var(--input));+ -webkit-backdrop-filter: none;+ backdrop-filter: none;+ }++ /* The pictures-only stage keeps its own flat ground either way. */+ :root:not(.jarvis-wallpaper) .jarvis-visualization-stage {+ background: hsl(var(--background));+ }+}diff --git a/jarvis/ui/web/frontend/src/lib/backgroundMode.test.ts b/jarvis/ui/web/frontend/src/lib/backgroundMode.test.tsnew file mode 100644index 0000000000..22a04fd03c--- /dev/null+++ b/jarvis/ui/web/frontend/src/lib/backgroundMode.test.ts@@ -0,0 +1,37 @@+import { afterEach, beforeEach, describe, expect, it } from "vitest";++import {+ BACKGROUND_MODE_KEY,+ WALLPAPER_CLASS,+ applyBackgroundClass,+ readBackgroundMode,+ writeBackgroundMode,+} from "@/lib/backgroundMode";++describe("backgroundMode", () => {+ beforeEach(() => {+ window.localStorage.clear();+ document.documentElement.classList.remove(WALLPAPER_CLASS);+ });+ afterEach(() => {+ document.documentElement.classList.remove(WALLPAPER_CLASS);+ });++ it("defaults to the solid ground", () => {+ expect(readBackgroundMode()).toBe("solid");+ });++ it("round-trips the wallpaper choice and ignores garbage", () => {+ writeBackgroundMode("wallpaper");+ expect(readBackgroundMode()).toBe("wallpaper");+ window.localStorage.setItem(BACKGROUND_MODE_KEY, "nonsense");+ expect(readBackgroundMode()).toBe("solid");+ });++ it("stamps the root class only for the wallpaper", () => {+ applyBackgroundClass("wallpaper");+ expect(document.documentElement.classList.contains(WALLPAPER_CLASS)).toBe(true);+ applyBackgroundClass("solid");+ expect(document.documentElement.classList.contains(WALLPAPER_CLASS)).toBe(false);+ });+});diff --git a/jarvis/ui/web/frontend/src/lib/backgroundMode.ts b/jarvis/ui/web/frontend/src/lib/backgroundMode.tsnew file mode 100644index 0000000000..89c507fdaa--- /dev/null+++ b/jarvis/ui/web/frontend/src/lib/backgroundMode.ts@@ -0,0 +1,55 @@+/**+ * What the app is painted ON: a flat theme colour, or a wallpaper.+ *+ * The flat colour is the default (maintainer, 2026-08-23): the app no longer+ * opens on artwork. A wallpaper stays one click away in the Wallpaper+ * section — choosing a picture there switches this to `wallpaper`, and the+ * "Solid colour" control switches it back. Every wallpaper pick the user has+ * made is kept either way; this only says whether it is shown.+ *+ * Two readers must agree on the answer before the first paint: the inline+ * boot script in index.html (which stamps the `jarvis-wallpaper` class on+ * <html> so the wallpaper readability floor in index.css applies from the+ * first frame) and the wallpaper store once React owns the document. Both+ * read THIS key with THIS fallback — keep them in lockstep.+ */++export type BackgroundMode = "solid" | "wallpaper";++export const BACKGROUND_MODE_KEY = "jarvis.background.v1";+export const DEFAULT_BACKGROUND_MODE: BackgroundMode = "solid";++/** The class index.css keys the wallpaper readability floor on. */+export const WALLPAPER_CLASS = "jarvis-wallpaper";++export function isBackgroundMode(value: unknown): value is BackgroundMode {+ return value === "solid" || value === "wallpaper";+}++export function readBackgroundMode(): BackgroundMode {+ if (typeof window === "undefined") return DEFAULT_BACKGROUND_MODE;+ try {+ const raw = window.localStorage.getItem(BACKGROUND_MODE_KEY);+ return isBackgroundMode(raw) ? raw : DEFAULT_BACKGROUND_MODE;+ } catch {+ // Private mode / storage disabled — the flat colour still has to paint.+ return DEFAULT_BACKGROUND_MODE;+ }+}++export function writeBackgroundMode(mode: BackgroundMode): void {+ try {+ window.localStorage.setItem(BACKGROUND_MODE_KEY, mode);+ } catch {+ /* not being able to remember the choice must not break applying it */+ }+}++/**+ * Put the document into the given mode — the class is what index.css reads.+ * Idempotent, safe to call on every store change.+ */+export function applyBackgroundClass(mode: BackgroundMode): void {+ if (typeof document === "undefined") return;+ document.documentElement.classList.toggle(WALLPAPER_CLASS, mode === "wallpaper");+}diff --git a/jarvis/ui/web/frontend/src/lib/homeSurface.ts b/jarvis/ui/web/frontend/src/lib/homeSurface.tsnew file mode 100644index 0000000000..16244ce864--- /dev/null+++ b/jarvis/ui/web/frontend/src/lib/homeSurface.ts@@ -0,0 +1,40 @@+/**+ * Which surface the front page ("chats" section) shows: the voice stage with+ * the Jarvis bar, or the typed chat.+ *+ * The two are one section with one switch at the top of the sidebar+ * (maintainer sketch, 2026-08-23) — `Voice | Chat` — not two sections: both+ * talk to the same assistant and share one history. Voice is the default;+ * it is what the product is for, and the typed chat is one click away.+ *+ * Persisted in localStorage so the choice survives a reload and a rebuild.+ * A broken or absent value falls back to voice: a corrupted preference must+ * land somewhere usable, never on a blank screen.+ */++export type HomeSurface = "voice" | "chat";++const STORAGE_KEY = "jarvis.home.surface.v1";+const DEFAULT_SURFACE: HomeSurface = "voice";++export function isHomeSurface(value: unknown): value is HomeSurface {+ return value === "voice" || value === "chat";+}++export function readHomeSurface(): HomeSurface {+ if (typeof window === "undefined") return DEFAULT_SURFACE;+ try {+ const raw = window.localStorage.getItem(STORAGE_KEY);+ return isHomeSurface(raw) ? raw : DEFAULT_SURFACE;+ } catch {+ return DEFAULT_SURFACE;+ }+}++export function writeHomeSurface(surface: HomeSurface): void {+ try {+ window.localStorage.setItem(STORAGE_KEY, surface);+ } catch {+ /* not being able to remember the choice must not break switching it */+ }+}diff --git a/jarvis/ui/web/frontend/src/store/home.ts b/jarvis/ui/web/frontend/src/store/home.tsnew file mode 100644index 0000000000..c1c8a44426--- /dev/null+++ b/jarvis/ui/web/frontend/src/store/home.ts@@ -0,0 +1,23 @@+import { create } from "zustand";++import { readHomeSurface, writeHomeSurface, type HomeSurface } from "@/lib/homeSurface";++/**+ * The front page's own store: which surface (voice / chat) is on screen.+ *+ * Lives apart from the big event store because it is read by exactly two+ * places — the sidebar switch that sets it and the home view that renders+ * it — and because nothing about it comes over the WebSocket.+ */+interface HomeStore {+ surface: HomeSurface;+ setSurface: (surface: HomeSurface) => void;+}++export const useHomeStore = create<HomeStore>((set) => ({+ surface: readHomeSurface(),+ setSurface: (surface) => {+ writeHomeSurface(surface);+ set({ surface });+ },+}));diff --git a/jarvis/ui/web/frontend/src/store/runFocus.ts b/jarvis/ui/web/frontend/src/store/runFocus.tsnew file mode 100644index 0000000000..a87b0c1892--- /dev/null+++ b/jarvis/ui/web/frontend/src/store/runFocus.ts@@ -0,0 +1,26 @@+import { create } from "zustand";++/**+ * A one-shot hand-off: "open the Run Inspector ON this run".+ *+ * The sidebar's recent-runs block lives outside the inspector, whose+ * selection is local state. Setting the focus here and switching sections+ * lets the inspector pick that run up on mount and clear the hand-off, so a+ * later visit starts on the newest run as before.+ */+interface RunFocusStore {+ sessionId: string | null;+ focus: (sessionId: string) => void;+ /** Take the pending hand-off (and clear it). Null when nothing is pending. */+ take: () => string | null;+}++export const useRunFocusStore = create<RunFocusStore>((set, get) => ({+ sessionId: null,+ focus: (sessionId) => set({ sessionId }),+ take: () => {+ const id = get().sessionId;+ if (id !== null) set({ sessionId: null });+ return id;+ },+}));diff --git a/jarvis/ui/web/frontend/src/store/wallpaper.ts b/jarvis/ui/web/frontend/src/store/wallpaper.tsindex 5f1571de25..3b7c99c000 100644--- a/jarvis/ui/web/frontend/src/store/wallpaper.ts+++ b/jarvis/ui/web/frontend/src/store/wallpaper.ts@@ -1,6 +1,13 @@import { create } from "zustand";import { cachedTheme, type Theme } from "@/hooks/useTheme";+import {+ BACKGROUND_MODE_KEY,+ applyBackgroundClass,+ readBackgroundMode,+ writeBackgroundMode,+ type BackgroundMode,+} from "@/lib/backgroundMode";import { bundledWallpaperUrl } from "@/lib/bundledWallpapers";/**@@ -180,6 +187,12 @@ function readFavorites(): string[] {}interface WallpaperStore {+ /**+ * Whether the app is painted on a wallpaper at all, or on the flat theme+ * colour (the default). Independent of WHICH picture is picked: the picks+ * survive a switch to solid, and come back when the wallpaper returns.+ */+ background: BackgroundMode;/** Each theme's chosen wallpaper id, or null for the bundled default. */selections: Record<Theme, string | null>;/** Favourited wallpaper ids, oldest first. Shared by both themes. */@@ -190,6 +203,8 @@ interface WallpaperStore {select: (id: string | null, theme: Theme) => void;/** Show or hide the live mascot on the wallpaper. */setMascotOn: (on: boolean) => void;+ /** Paint on the flat colour, or on the chosen wallpaper. */+ setBackground: (mode: BackgroundMode) => void;/*** Drop one wallpaper everywhere it is remembered — every theme slot and the* favourites. For a picture that no longer exists: an id kept for a deleted@@ -215,6 +230,7 @@ interface WallpaperStore {}export const useWallpaperStore = create<WallpaperStore>((set, get) => ({+ background: readBackgroundMode(),selections: readSelections(),favorites: readFavorites(),mascotOn: readMascotOn(),@@ -273,12 +289,21 @@ export const useWallpaperStore = create<WallpaperStore>((set, get) => ({}set({ mascotOn: on });},- adopt: () =>+ setBackground: (mode) => {+ writeBackgroundMode(mode);+ applyBackgroundClass(mode);+ set({ background: mode });+ },+ adopt: () => {+ const background = readBackgroundMode();+ applyBackgroundClass(background);set({+ background,selections: readSelections(),favorites: readFavorites(),mascotOn: readMascotOn(),- }),+ });+ },reconcile: (themeOf) => {try {for (const slot of ["light", "dark"] as Theme[]) {@@ -317,7 +342,12 @@ export function installWallpaperSync(): () => void {THEME_KEYS.dark,FAVORITES_KEY,MASCOT_KEY,+ BACKGROUND_MODE_KEY,]);+ // The boot script already stamped the class for the first paint; this+ // re-applies it once the store exists, which is also what heals a document+ // whose boot script could not read storage.+ applyBackgroundClass(useWallpaperStore.getState().background);const onStorage = (event: StorageEvent) => {if (event.key !== null && !watched.has(event.key)) return;useWallpaperStore.getState().adopt();diff --git a/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsx b/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsxindex 2ec18113ce..7fbe10ae6a 100644--- a/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsx+++ b/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsx@@ -1,88 +1,84 @@import { describe, it, expect, afterEach, beforeEach, vi } from "vitest";import { cleanup, fireEvent, render, screen } from "@testing-library/react";import { ChatsSurface } from "@/views/ChatsSurface";+import { SurfaceSwitch } from "@/components/home/SurfaceSwitch";+import { useHomeStore } from "@/store/home";+import { readHomeSurface } from "@/lib/homeSurface";/**- * 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.+ * The front page is one section with one switch: Voice (the Jarvis bar) or+ * Chat (the typed column). What is under test is the shell's switching and+ * persistence, not what either stage renders — both stages and the header+ * are stubbed.*/-vi.mock("@/views/ChatsView", () => ({- ChatsView: ({ headerAccessory }: { headerAccessory?: React.ReactNode }) => (- <div data-testid="classic">- classic- {headerAccessory}- </div>- ),+vi.mock("@/components/home/HomeHeader", () => ({+ HomeHeader: () => <div data-testid="home-header-stub" />,+}));+vi.mock("@/components/home/VoiceStage", () => ({+ VoiceStage: () => <div data-testid="voice">voice</div>,+}));+vi.mock("@/components/home/ChatStage", () => ({+ ChatStage: () => <div data-testid="chat">chat</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";+const STORAGE_KEY = "jarvis.home.surface.v1";-describe("ChatsSurface", () => {+describe("ChatsSurface (the front page)", () => {beforeEach(() => {window.localStorage.clear();+ useHomeStore.setState({ surface: readHomeSurface() });});afterEach(cleanup);- it("shows the deck by default", () => {+ it("opens on the voice stage by default", () => {render(<ChatsSurface />);- expect(screen.getByTestId("deck")).toBeTruthy();- expect(screen.queryByTestId("classic")).toBeNull();+ expect(screen.getByTestId("voice")).toBeTruthy();+ expect(screen.queryByTestId("chat")).toBeNull();+ expect(screen.getByTestId("home-view").getAttribute("data-surface")).toBe("voice");});- it("falls back to the classic chat view and remembers it", () => {- render(<ChatsSurface />);+ it("switches to the chat stage from the sidebar switch and remembers it", () => {+ render(+ <>+ <SurfaceSwitch />+ <ChatsSurface />+ </>,+ );- fireEvent.click(screen.getByRole("button"));+ fireEvent.click(screen.getByTestId("home-surface-chat"));- // 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");+ expect(screen.getByTestId("chat")).toBeTruthy();+ expect(screen.queryByTestId("voice")).toBeNull();+ expect(window.localStorage.getItem(STORAGE_KEY)).toBe("chat");+ expect(screen.getByTestId("home-surface-chat").getAttribute("aria-selected")).toBe("true");});- it("opens on the classic view when that is the stored choice", () => {- window.localStorage.setItem(STORAGE_KEY, "classic");+ it("opens on the chat stage when that is the stored choice", () => {+ window.localStorage.setItem(STORAGE_KEY, "chat");+ useHomeStore.setState({ surface: readHomeSurface() });render(<ChatsSurface />);- expect(screen.getByTestId("classic")).toBeTruthy();+ expect(screen.getByTestId("chat")).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("switches back to voice", () => {+ window.localStorage.setItem(STORAGE_KEY, "chat");+ useHomeStore.setState({ surface: readHomeSurface() });+ render(+ <>+ <SurfaceSwitch />+ <ChatsSurface />+ </>,+ );+ fireEvent.click(screen.getByTestId("home-surface-voice"));+ expect(screen.getByTestId("voice")).toBeTruthy();+ expect(window.localStorage.getItem(STORAGE_KEY)).toBe("voice");});- 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");+ it("lands on voice when the stored value is corrupt", () => {+ window.localStorage.setItem(STORAGE_KEY, "garbage");+ useHomeStore.setState({ surface: readHomeSurface() });render(<ChatsSurface />);- expect(screen.getByTestId("deck")).toBeTruthy();+ expect(screen.getByTestId("voice")).toBeTruthy();});});diff --git a/jarvis/ui/web/frontend/src/views/ChatsSurface.tsx b/jarvis/ui/web/frontend/src/views/ChatsSurface.tsxindex 47d068d087..88cfbe6946 100644--- a/jarvis/ui/web/frontend/src/views/ChatsSurface.tsx+++ b/jarvis/ui/web/frontend/src/views/ChatsSurface.tsx@@ -1,29 +1,15 @@-import { ChatsView } from "@/views/ChatsView";-import { MissionDeckView, SurfaceSwitch } from "@/views/MissionDeckView";-import { useDeckStore } from "@/store/deck";+import { HomeView } from "@/views/HomeView";/**- * The "chats" section: the mission deck, with the classic chat view one click- * behind it.+ * The "chats" section: the front page (views/HomeView) — the voice stage+ * with the Jarvis bar, or the typed chat, chosen by the switch at the top of+ * the sidebar.*- * 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 in the deck store rather than here: the app shell reads it to- * hide the sidebar while the deck (which brings its own dock) is on screen.+ * Until 2026-08-23 this was the mission deck with the classic two-pane chat+ * one switch behind it. The deck is off the front page now (maintainer: no+ * dashboard to read before you can speak); its code stays in+ * views/MissionDeckView for the day it returns as a section of its own.*/export function ChatsSurface() {- const mode = useDeckStore((s) => s.mode);- const setMode = useDeckStore((s) => s.setMode);- const accessory = <SurfaceSwitch mode={mode} onChange={setMode} />;-- return mode === "classic" ? (- <ChatsView headerAccessory={accessory} />- ) : (- <MissionDeckView headerAccessory={accessory} />- );+ return <HomeView />;}diff --git a/jarvis/ui/web/frontend/src/views/HomeView.tsx b/jarvis/ui/web/frontend/src/views/HomeView.tsxnew file mode 100644index 0000000000..7ba4e9269d--- /dev/null+++ b/jarvis/ui/web/frontend/src/views/HomeView.tsx@@ -0,0 +1,29 @@+import { useHomeStore } from "@/store/home";+import { HomeHeader } from "@/components/home/HomeHeader";+import { VoiceStage } from "@/components/home/VoiceStage";+import { ChatStage } from "@/components/home/ChatStage";++/**+ * The front page — the "chats" section.+ *+ * One header that carries the app chrome (the shell TopBar steps aside here,+ * same rule as the IDE), and under it one of two stages chosen by the+ * `Voice | Chat` switch at the top of the sidebar (store/home.ts):+ *+ * Voice — the Jarvis bar, centred, with the live transcript above it.+ * Chat — a plain typed chat: one centred column, composer at the bottom.+ *+ * Both talk to the same assistant through the same event bus and share one+ * history; the switch changes how you address it, not whom. Replaces the+ * mission deck as the front page (maintainer, 2026-08-23): a plain ground,+ * no instruments, nothing that has to be read before you can speak.+ */+export function HomeView() {+ const surface = useHomeStore((s) => s.surface);+ return (+ <div className="flex h-full min-h-0 flex-col" data-testid="home-view" data-surface={surface}>+ <HomeHeader />+ {surface === "chat" ? <ChatStage /> : <VoiceStage />}+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/views/RunInspectorView.tsx b/jarvis/ui/web/frontend/src/views/RunInspectorView.tsxindex 7bb7bce84c..84b5af52bf 100644--- a/jarvis/ui/web/frontend/src/views/RunInspectorView.tsx+++ b/jarvis/ui/web/frontend/src/views/RunInspectorView.tsx@@ -3,11 +3,16 @@ import { useT } from "@/i18n";import { useRuns } from "@/hooks/useRuns";import { RunList } from "@/components/runs/RunList";import { RunDetail } from "@/components/runs/RunDetail";+import { useRunFocusStore } from "@/store/runFocus";export function RunInspectorView() {const t = useT();const { data: runs, isError } = useRuns();- const [selected, setSelected] = useState<string | null>(null);+ // A run handed over from elsewhere (the sidebar's recent-runs block) is+ // the first pick; otherwise the newest run, as before.+ const [selected, setSelected] = useState<string | null>(() =>+ useRunFocusStore.getState().take(),+ );useEffect(() => {if (selected === null && runs && runs.length > 0) setSelected(runs[0].session_id);diff --git a/jarvis/ui/web/frontend/src/views/WallpaperView.tsx b/jarvis/ui/web/frontend/src/views/WallpaperView.tsxindex 4189b89f1d..649b59b2a5 100644--- a/jarvis/ui/web/frontend/src/views/WallpaperView.tsx+++ b/jarvis/ui/web/frontend/src/views/WallpaperView.tsx@@ -17,7 +17,7 @@ import {X,} from "lucide-react";-import { translate, useLocaleChunk } from "@/i18n";+import { translate, useLocaleChunk, useT } from "@/i18n";import { Button } from "@/components/ui/button";import { ScrollArea } from "@/components/ui/scroll-area";import { ViewHeader } from "@/views/ChatsView";@@ -88,14 +88,17 @@ function SegmentButton({onClick,children,"aria-label": ariaLabel,+ "data-testid": testId,}: {active: boolean;onClick: () => void;children: React.ReactNode;"aria-label"?: string;+ "data-testid"?: string;}) {return (<button+ data-testid={testId}type="button"onClick={onClick}aria-label={ariaLabel}@@ -524,6 +527,7 @@ function WallpaperPreview({* as it actually is.*/export function WallpaperView() {+ const t = useT();const { data, isLoading } = useWallpaperCatalog();const { data: uploads } = useWallpaperUploads();const { add, setTheme: retheme, remove } = useUploadMutations();@@ -534,6 +538,8 @@ export function WallpaperView() {const selectedId = useWallpaperStore((state) => state.selections[activeTheme]);const favorites = useWallpaperStore((state) => state.favorites);const mascotOn = useWallpaperStore((state) => state.mascotOn);+ const background = useWallpaperStore((state) => state.background);+ const setBackground = useWallpaperStore((state) => state.setBackground);const toggleFavorite = useWallpaperStore((state) => state.toggleFavorite);const setMascotOn = useWallpaperStore((state) => state.setMascotOn);const forget = useWallpaperStore((state) => state.forget);@@ -794,6 +800,35 @@ export function WallpaperView() {{!data?.libraryAvailable && <LibraryDownloadBanner />}+ {/* The ground itself: a flat theme colour (the default since 2026-08-23)+ or the chosen picture. Picking any tile below switches to the+ picture; this is the way back. The picks survive either way. */}+ <div+ className="flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-border px-6 py-3"+ data-testid="wallpaper-background-mode"+ >+ <span className="text-xs font-medium text-foreground">{t("home.background_label")}</span>+ <div className="flex items-center gap-1 rounded-lg border border-border p-0.5">+ <SegmentButton+ active={background === "solid"}+ onClick={() => setBackground("solid")}+ data-testid="background-solid"+ >+ {t("home.background_solid")}+ </SegmentButton>+ <SegmentButton+ active={background === "wallpaper"}+ onClick={() => setBackground("wallpaper")}+ data-testid="background-wallpaper"+ >+ {t("home.background_wallpaper")}+ </SegmentButton>+ </div>+ <span className="min-w-0 flex-1 text-xs text-muted-foreground">+ {t("home.background_hint")}+ </span>+ </div>+<div className="flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-border px-6 py-3"><div className="flex items-center gap-1 rounded-lg border border-border p-0.5"><SegmentButton active={theme === "all"} onClick={() => setTheme("all")}>diff --git a/jarvis/ui/web/frontend/tailwind.config.ts b/jarvis/ui/web/frontend/tailwind.config.tsindex 11b79a5198..6f0dc73dc7 100644--- a/jarvis/ui/web/frontend/tailwind.config.ts+++ b/jarvis/ui/web/frontend/tailwind.config.ts@@ -18,6 +18,8 @@ const config: Config = {ring: "hsl(var(--ring))",background: "hsl(var(--background))",foreground: "hsl(var(--foreground))",+ // The navigation column's own ground (one step below the page).+ sidebar: "hsl(var(--sidebar))",primary: {DEFAULT: "hsl(var(--primary))",foreground: "hsl(var(--primary-foreground))",