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(chat): one front-page chat with a voice mode and an assistant card
rubenluetke10-beepe1db1ec3f968
diff --git a/jarvis/ui/web/frontend/src/components/agentchat/AgentTimeline.tsx b/jarvis/ui/web/frontend/src/components/agentchat/AgentTimeline.tsxindex f9b8d194e6..de9ff984dd 100644--- a/jarvis/ui/web/frontend/src/components/agentchat/AgentTimeline.tsx+++ b/jarvis/ui/web/frontend/src/components/agentchat/AgentTimeline.tsx@@ -1,9 +1,10 @@-import { memo } from "react";+import { Fragment, memo } from "react";import { ChatMarkdown, MediaPreview, mediaKind } from "@/components/agentchat/ChatMarkdown";import { CircleAlert, FileText, ImageIcon } from "lucide-react";import { InternalMessageBubble, type InternalParticipant } from "./InternalMessageBubble";import { MessageWithChips } from "./ToolChoiceChips";import { ProviderLogo } from "@/components/providers/ProviderLogo";+import { GigiMark } from "@/components/GigiMark";import { effortLabel } from "./AgentComposer";import { TurnTrace, type Decide } from "./WorkTrace";import type { TimelineItem, TurnItem, TextBlock } from "./reduce";@@ -18,6 +19,7 @@ export function AgentTimeline({onDecide,recipientName,agentsById,+ bubbles = false,}: {items: TimelineItem[];assistantName: string;@@ -27,157 +29,236 @@ export function AgentTimeline({recipientName?: string;/** Sender faces by agent id, where the caller has a roster. */agentsById?: Record<string, InternalParticipant>;+ /**+ * The front page's messenger look (2026-10-01): your words in a signal-blue+ * bubble on the right, the assistant's answers in card bubbles on the left+ * under a small face, and a centred time stamp wherever the conversation+ * paused. The Agentic IDE keeps the document look (the default).+ */+ bubbles?: boolean;}) {const t = useT();+ const stamps = bubbles ? timeStamps(items) : null;return (<>{items.map((item) => {- if (item.type === "internal") {- return (- <InternalMessageBubble- key={item.id}- item={item}- sender={agentsById?.[item.message.sender_id] ?? null}- recipientName={recipientName ?? assistantName}- />- );- }- if (item.type === "user") {- if (item.origin === "control") return <div key={item.id} data-message-id={item.id} className="text-xs text-muted-foreground">{t("slash.control_turn")}{item.attachments.map((file) => <span key={file.name} className="ml-2">{file.name}</span>)}</div>;- return (- <div- key={item.id}- className="flex justify-end"- data-testid="agent-message-user"- data-message-id={item.id}- >- <div className="jarvis-user-bubble max-w-[85%] rounded-lg px-4 py-3 text-reading">- <MessageWithChips text={item.text} choices={item.toolChoices ?? []} />- {item.attachments.length > 0 && (- <div- data-testid="agent-message-attachments"- className={cn("flex flex-wrap gap-row", item.text && "mt-2.5")}- >- {item.attachments.map((file) =>- // The picture itself, where there is one to fetch: a- // screenshot dropped on a pane is a thing the person- // wants to SEE in their turn, not a file name with an- // icon (maintainer, 2026-08-27). A file with no url —- // a document, or the front page's chat, whose drops- // are read and not stored — keeps the chip.- file.url && (mediaKind(file.url) === "video" || mediaKind(file.url) === "audio") ? (- <MediaPreview key={file.name} src={file.url} label={file.name} kind={mediaKind(file.url)!} />- ) : (file.kind === "image" || (file.url && mediaKind(file.url) === "image")) && file.url ? (- <img- key={file.name}- src={file.url}- alt={file.name}- title={file.name}- loading="lazy"- decoding="async"- data-testid="agent-message-image"- // A picture is its own fill. The frame and the wash- // behind it were describing an object that was- // already fully described.- className="max-h-60 max-w-full rounded-lg object-contain"- />- ) : (- <span- key={file.name}- // The receipt says whether the model could actually- // READ it. "sent" and "could not be read" are the two- // outcomes, and the second happens for real wherever no- // provider can see an image.- title={- file.describedBy === "none"- ? t("agent_chat.attach_not_described")- : file.name- }- // No box. The user bubble is the loudest surface the- // ladder has, so a chip inside it has nowhere to step- // up to; the icon and the mono name carry the chip's- // whole job on their own.- className="flex items-center gap-1.5 text-micro opacity-80"- >- {file.kind === "image" ? (- <ImageIcon className="h-3 w-3 shrink-0" aria-hidden />- ) : (- <FileText className="h-3 w-3 shrink-0" aria-hidden />- )}- <span className="max-w-[12rem] truncate font-mono">{file.name}</span>- </span>- ),- )}- </div>- )}- </div>- </div>- );- }- if (item.type === "error") {- return (- <div- key={item.id}- data-message-id={item.id}- // Fault ink on a normal surface. A red-washed panel makes the- // failure the brightest object on the screen and buries what it- // says under what it looks like.- className="mx-auto flex max-w-[85%] items-center gap-row rounded-lg bg-card px-4 py-3 text-body text-destructive"- >- <CircleAlert className="h-3.5 w-3.5 shrink-0" aria-hidden />- <span>{item.text}</span>+ const stamp = stamps?.get(item.id);+ const node = renderItem(item);+ return stamp ? (+ <Fragment key={item.id}>+ <div className="flex justify-center pt-2" data-testid="agent-time-stamp" aria-hidden>+ <span className="text-xs font-medium text-muted-foreground">{stamp}</span></div>- );- }- if (item.type === "notice") {- if (item.kind === "native_goal_verdict") return <p key={item.id} className="text-xs text-muted-foreground">{t("slash.verifying")}</p>;- // The society reporting back on a task Jarvis handed out: the- // agent's name as the headline, its summary underneath. Muted and- // centred like a stamp — it is not Jarvis speaking.- const headline =- item.kind === "society_result"- ? t(item.status === "done" ? "society.chat.result_done" : "society.chat.result_blocked").replace(- "{0}",- item.agentName || t("society.chat.result_agent"),- )- : item.agentName;- return (- <div- key={item.id}- data-message-id={item.id}- className="mx-auto flex max-w-[85%] flex-col gap-0.5 rounded-lg bg-card px-4 py-3 text-body"- >- {headline ? <span className="font-medium text-foreground">{headline}</span> : null}- {item.text ? <ChatMarkdown text={item.text} className="text-muted-foreground" /> : null}- </div>- );- }- return (- <Turn- key={item.id}- turn={item}- assistantName={assistantName}- providerLabel={providerLabel(item.provider)}- onDecide={onDecide}- />- );+ {node}+ </Fragment>+ ) : node;})}</>);++ function renderItem(item: TimelineItem) {+ if (item.type === "internal") {+ return (+ <InternalMessageBubble+ key={item.id}+ item={item}+ sender={agentsById?.[item.message.sender_id] ?? null}+ recipientName={recipientName ?? assistantName}+ />+ );+ }+ if (item.type === "user") {+ if (item.origin === "control") return <div key={item.id} data-message-id={item.id} className="text-xs text-muted-foreground">{t("slash.control_turn")}{item.attachments.map((file) => <span key={file.name} className="ml-2">{file.name}</span>)}</div>;+ return (+ <div+ key={item.id}+ className="flex justify-end"+ data-testid="agent-message-user"+ data-message-id={item.id}+ >+ <div+ className={cn(+ "text-reading",+ bubbles+ ? "jarvis-chat-out max-w-[78%] rounded-3xl rounded-br-lg px-4 py-2.5"+ : "jarvis-user-bubble max-w-[85%] rounded-lg px-4 py-3",+ )}+ >+ <MessageWithChips text={item.text} choices={item.toolChoices ?? []} />+ {item.attachments.length > 0 && (+ <div+ data-testid="agent-message-attachments"+ className={cn("flex flex-wrap gap-row", item.text && "mt-2.5")}+ >+ {item.attachments.map((file) =>+ // The picture itself, where there is one to fetch: a+ // screenshot dropped on a pane is a thing the person+ // wants to SEE in their turn, not a file name with an+ // icon (maintainer, 2026-08-27). A file with no url —+ // a document, or the front page's chat, whose drops+ // are read and not stored — keeps the chip.+ file.url && (mediaKind(file.url) === "video" || mediaKind(file.url) === "audio") ? (+ <MediaPreview key={file.name} src={file.url} label={file.name} kind={mediaKind(file.url)!} />+ ) : (file.kind === "image" || (file.url && mediaKind(file.url) === "image")) && file.url ? (+ <img+ key={file.name}+ src={file.url}+ alt={file.name}+ title={file.name}+ loading="lazy"+ decoding="async"+ data-testid="agent-message-image"+ // A picture is its own fill. The frame and the wash+ // behind it were describing an object that was+ // already fully described.+ className="max-h-60 max-w-full rounded-lg object-contain"+ />+ ) : (+ <span+ key={file.name}+ // The receipt says whether the model could actually+ // READ it. "sent" and "could not be read" are the two+ // outcomes, and the second happens for real wherever no+ // provider can see an image.+ title={+ file.describedBy === "none"+ ? t("agent_chat.attach_not_described")+ : file.name+ }+ // No box. The user bubble is the loudest surface the+ // ladder has, so a chip inside it has nowhere to step+ // up to; the icon and the mono name carry the chip's+ // whole job on their own.+ className="flex items-center gap-1.5 text-micro opacity-80"+ >+ {file.kind === "image" ? (+ <ImageIcon className="h-3 w-3 shrink-0" aria-hidden />+ ) : (+ <FileText className="h-3 w-3 shrink-0" aria-hidden />+ )}+ <span className="max-w-[12rem] truncate font-mono">{file.name}</span>+ </span>+ ),+ )}+ </div>+ )}+ </div>+ </div>+ );+ }+ if (item.type === "error") {+ return (+ <div+ key={item.id}+ data-message-id={item.id}+ // Fault ink on a normal surface. A red-washed panel makes the+ // failure the brightest object on the screen and buries what it+ // says under what it looks like.+ className="mx-auto flex max-w-[85%] items-center gap-row rounded-lg bg-card px-4 py-3 text-body text-destructive"+ >+ <CircleAlert className="h-3.5 w-3.5 shrink-0" aria-hidden />+ <span>{item.text}</span>+ </div>+ );+ }+ if (item.type === "notice") {+ if (item.kind === "native_goal_verdict") return <p key={item.id} className="text-xs text-muted-foreground">{t("slash.verifying")}</p>;+ // The society reporting back on a task Jarvis handed out: the+ // agent's name as the headline, its summary underneath. Muted and+ // centred like a stamp — it is not Jarvis speaking.+ const headline =+ item.kind === "society_result"+ ? t(item.status === "done" ? "society.chat.result_done" : "society.chat.result_blocked").replace(+ "{0}",+ item.agentName || t("society.chat.result_agent"),+ )+ : item.agentName;+ return (+ <div+ key={item.id}+ data-message-id={item.id}+ className="mx-auto flex max-w-[85%] flex-col gap-0.5 rounded-lg bg-card px-4 py-3 text-body"+ >+ {headline ? <span className="font-medium text-foreground">{headline}</span> : null}+ {item.text ? <ChatMarkdown text={item.text} className="text-muted-foreground" /> : null}+ </div>+ );+ }+ return (+ <Turn+ key={item.id}+ turn={item}+ assistantName={assistantName}+ providerLabel={providerLabel(item.provider)}+ onDecide={onDecide}+ bubbles={bubbles}+ />+ );+ }}-const Turn = memo(function Turn({ turn, assistantName, providerLabel, onDecide }: {- turn: TurnItem; assistantName: string; providerLabel: string; onDecide: Decide;+/** A pause this long between two messages earns a new time stamp. */+const STAMP_GAP_MS = 20 * 60 * 1000;++function itemTime(item: TimelineItem): number {+ return item.type === "turn" ? item.startedMs : item.tsMs;+}++/**+ * Which items open with a time stamp, and what it says: the first one, and+ * every one after a pause of {@link STAMP_GAP_MS}. Today shows the clock+ * only; any other day leads with the date, the way a messenger does.+ */+export function timeStamps(items: TimelineItem[], now: Date = new Date()): Map<string, string> {+ const out = new Map<string, string>();+ let last = 0;+ for (const item of items) {+ const ts = itemTime(item);+ if (!ts || !Number.isFinite(ts)) continue;+ if (!last || ts - last >= STAMP_GAP_MS) out.set(item.id, stampLabel(new Date(ts), now));+ last = ts;+ }+ return out;+}++function stampLabel(at: Date, now: Date): string {+ const time = at.toLocaleTimeString(undefined, { hour: "numeric", minute: "2-digit" });+ if (at.toDateString() === now.toDateString()) return time;+ const date = at.toLocaleDateString(undefined, {+ month: "short",+ day: "numeric",+ ...(at.getFullYear() === now.getFullYear() ? {} : { year: "numeric" }),+ });+ return `${date}, ${time}`;+}++const Turn = memo(function Turn({ turn, assistantName, providerLabel, onDecide, bubbles = false }: {+ turn: TurnItem; assistantName: string; providerLabel: string; onDecide: Decide; bubbles?: boolean;}) {const t = useT();return <div className="flex min-w-0 flex-col gap-3" data-testid="agent-turn" data-message-id={turn.id} data-status={turn.status}><div className="flex flex-wrap items-center gap-2 text-xs text-muted-foreground">+ {bubbles ? <GigiMark size={20} className="rounded-full" /> : null}<span className="font-medium text-foreground">{assistantName}</span><ProviderLogo providerId={turn.provider} label={providerLabel} size="sm" /><span>{providerLabel}{turn.model ? ` · ${turn.model}` : ""}</span>{turn.effort ? <span>{effortLabel(turn.effort, t)}</span> : null}</div>- <TurnTrace turn={turn} onDecide={onDecide} renderText={(text, id) => <Prose block={{ kind: "text", text, id }} />} />+ <TurnTrace+ turn={turn}+ onDecide={onDecide}+ renderText={(text, id) =>+ bubbles ? (+ text.trim() ? (+ <div className="w-fit max-w-full rounded-3xl rounded-tl-lg bg-card px-5 py-1.5" data-testid="agent-bubble">+ <Prose block={{ kind: "text", text, id }} />+ </div>+ ) : null+ ) : (+ <Prose block={{ kind: "text", text, id }} />+ )+ }+ /></div>;});diff --git a/jarvis/ui/web/frontend/src/components/home/AssistantChat.tsx b/jarvis/ui/web/frontend/src/components/home/AssistantChat.tsxnew file mode 100644index 0000000000..004ffd3228--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/home/AssistantChat.tsx@@ -0,0 +1,73 @@+import { lazy, Suspense, useCallback, useState } from "react";++import { AssistantProfilePanel } from "@/components/home/AssistantProfilePanel";+import { ChatTopBar } from "@/components/home/ChatTopBar";+import { VoiceStage } from "@/components/home/VoiceStage";+import { useT } from "@/i18n";+import { useHomeStore } from "@/store/home";++const ChatStage = lazy(() =>+ import("@/components/home/ChatStage").then((module) => ({ default: module.ChatStage })),+);++const PANEL_KEY = "jarvis.home.assistant-panel.v1";++function readPanelOpen(): boolean {+ try {+ return window.localStorage.getItem(PANEL_KEY) !== "closed";+ } catch {+ return true;+ }+}++function writePanelOpen(open: boolean): void {+ try {+ window.localStorage.setItem(PANEL_KEY, open ? "open" : "closed");+ } catch {+ /* not remembering the choice must not stop the panel from toggling */+ }+}++/**+ * The front page: ONE chat with the assistant (2026-10-01).+ *+ * A top bar (who, what they are doing, the voice-mode button), the+ * conversation under it, and the assistant card on the right on wide+ * windows. Voice mode is a state of this chat, not another page: it swaps+ * the typed column for the spoken transcript and the Jarvis bar, and the+ * same button brings the typing back. The card's open/closed choice is+ * remembered per browser.+ */+export function AssistantChat() {+ const t = useT();+ const surface = useHomeStore((s) => s.surface);+ const [panelOpen, setPanelOpen] = useState(readPanelOpen);+ const togglePanel = useCallback(() => {+ setPanelOpen((open) => {+ writePanelOpen(!open);+ return !open;+ });+ }, []);++ return (+ <div className="flex min-h-0 flex-1" data-testid="assistant-chat">+ <div className="flex min-w-0 flex-1 flex-col">+ <ChatTopBar panelOpen={panelOpen} onTogglePanel={togglePanel} />+ {surface === "chat" ? (+ <Suspense+ fallback={+ <div role="status" className="flex min-h-0 flex-1 items-center justify-center text-sm text-muted-foreground">+ {t("common.loading")}+ </div>+ }+ >+ <ChatStage />+ </Suspense>+ ) : (+ <VoiceStage />+ )}+ </div>+ {panelOpen && <AssistantProfilePanel onClose={togglePanel} />}+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/home/AssistantProfilePanel.test.tsx b/jarvis/ui/web/frontend/src/components/home/AssistantProfilePanel.test.tsxnew file mode 100644index 0000000000..26c3858a56--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/home/AssistantProfilePanel.test.tsx@@ -0,0 +1,91 @@+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import { cleanup, render, screen, waitFor } from "@testing-library/react";++import { AssistantProfilePanel, chatFacts } from "@/components/home/AssistantProfilePanel";+import { timeStamps } from "@/components/agentchat/AgentTimeline";+import type { TimelineItem } from "@/components/agentchat/reduce";+import { useEventStore } from "@/store/events";++vi.mock("@/components/MascotGigi", () => ({ MascotGigi: () => <div data-testid="mascot" /> }));++const MIN = 60_000;++function user(id: string, tsMs: number, origin?: "control"): TimelineItem {+ return { type: "user", id, text: id, attachments: [], tsMs, ...(origin ? { origin } : {}) };+}++function turn(id: string, startedMs: number, tools: number): TimelineItem {+ return {+ type: "turn", id, provider: "p", model: "m", effort: "", runner: "api", status: "done",+ blocks: [+ { kind: "text", id: `${id}-t`, text: "hi" },+ ...Array.from({ length: tools }, (_, i) => ({+ kind: "tool" as const, callId: `${id}-${i}`, name: "x", input: {}, output: null, isError: false,+ })),+ ],+ startedMs, durationMs: 1, usage: null, liveUsage: null, costUsd: null, error: null,+ } as TimelineItem;+}++describe("timeStamps", () => {+ it("stamps the first message and every one after a 20-minute pause", () => {+ const t0 = new Date(2026, 9, 1, 9, 0).getTime();+ const items = [user("a", t0), turn("b", t0 + MIN, 0), user("c", t0 + 5 * MIN), user("d", t0 + 40 * MIN)];+ const stamps = timeStamps(items, new Date(2026, 9, 1, 12, 0));+ expect([...stamps.keys()]).toEqual(["a", "d"]);+ });++ it("leads with the date when the message is not from today", () => {+ const t0 = new Date(2026, 8, 24, 8, 13).getTime();+ const label = timeStamps([user("a", t0)], new Date(2026, 9, 1)).get("a") ?? "";+ expect(label).toContain(",");+ });+});++describe("chatFacts", () => {+ it("counts what the person wrote, the answers and the tool calls", () => {+ const facts = chatFacts([user("a", 10), turn("b", 20, 3), user("c", 30, "control"), turn("d", 40, 1)]);+ expect(facts).toEqual({ messages: 1, answers: 2, tools: 4, startedMs: 10 });+ });+});++describe("AssistantProfilePanel", () => {+ beforeEach(() => {+ useEventStore.setState({ assistantName: "George", connected: true, voiceState: "idle" });+ vi.stubGlobal(+ "fetch",+ vi.fn(async (url: string) => {+ if (String(url).startsWith("/api/settings/agent-instructions")) {+ return new Response(+ JSON.stringify({ content: "x", exists: true, filename: "George.md", template: "", char_count: 1200 }),+ { status: 200 },+ );+ }+ if (String(url).startsWith("/api/wiki/health")) {+ return new Response(JSON.stringify({ ok: true, health: { vault_pages: 42, last_write: null } }), { status: 200 });+ }+ return new Response("{}", { status: 404 });+ }),+ );+ });++ afterEach(() => {+ cleanup();+ vi.unstubAllGlobals();+ });++ it("shows the name, the soul file and the wiki page count from real reads", async () => {+ render(<AssistantProfilePanel onClose={() => {}} />);+ expect(screen.getByTestId("assistant-panel-name").textContent).toBe("George");+ await waitFor(() => expect(screen.getByTestId("assistant-tile-memory").textContent).toContain("42"));+ const soul = screen.getByTestId("assistant-tile-soul").textContent ?? "";+ expect(soul).toContain("George.md");+ expect(soul).toMatch(/1[.,]?200/);+ });++ it("never shows an invented number while the reads are in flight", () => {+ vi.stubGlobal("fetch", vi.fn(() => new Promise<Response>(() => {})));+ render(<AssistantProfilePanel onClose={() => {}} />);+ expect(screen.getByTestId("assistant-tile-memory").textContent).not.toMatch(/\d/);+ });+});diff --git a/jarvis/ui/web/frontend/src/components/home/AssistantProfilePanel.tsx b/jarvis/ui/web/frontend/src/components/home/AssistantProfilePanel.tsxnew file mode 100644index 0000000000..fd67284dff--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/home/AssistantProfilePanel.tsx@@ -0,0 +1,318 @@+import { useEffect, useMemo, useState, type ReactNode } from "react";+import { ArrowUpRight, AudioLines, Keyboard, Loader2, Plus, X } from "lucide-react";++import { useAgentChat } from "@/components/agentchat/AgentChatStoreContext";+import { MascotGigi } from "@/components/MascotGigi";+import { ProviderLogo } from "@/components/providers/ProviderLogo";+import { ScrollArea } from "@/components/ui/scroll-area";+import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";+import { TONE_DOT, useAssistantStatus, useVoiceModeSwitch } from "@/components/home/assistantStatus";+import { useAgentInstructions } from "@/hooks/useAgentInstructions";+import { fill, useT } from "@/i18n";+import { startNewTextChat } from "@/lib/newChat";+import { cn } from "@/lib/utils";+import { fetchWikiHealth, type WikiHealthSnapshot } from "@/lib/wikiApi";+import { useEventStore } from "@/store/events";+import type { TimelineItem } from "@/components/agentchat/reduce";++/**+ * The assistant card — the right-hand column of the front page.+ *+ * Who you are talking to, as a contact card in a messenger: the living+ * mascot in a round frame (it reacts to the voice), the name, what it is+ * doing right now, and the two things you do with an assistant — talk to it+ * or start over. Under that two tabs:+ *+ * Overview — two vivid tiles that open what makes this assistant YOURS:+ * Soul (the standing-instructions file it reads every turn)+ * and Memory (the wiki it writes to), plus the model this chat+ * runs on.+ * This chat — plain facts about the conversation on screen, counted from+ * its own timeline.+ *+ * Every number comes from a real read; while a read is in flight the tile+ * shows a placeholder bar, never an invented zero.+ */+export function AssistantProfilePanel({ onClose }: { onClose: () => void }) {+ const t = useT();+ const assistantName = useEventStore((s) => s.assistantName);+ const status = useAssistantStatus();+ const voice = useVoiceModeSwitch();++ return (+ <aside+ className="hidden w-[320px] shrink-0 flex-col border-l border-border bg-sidebar xl:flex"+ data-testid="assistant-panel"+ aria-label={assistantName}+ >+ <div className="flex justify-end px-3 pt-3">+ <button+ type="button"+ onClick={onClose}+ aria-label={t("assistant_chat.panel_close")}+ title={t("assistant_chat.panel_close")}+ data-testid="assistant-panel-close"+ className="flex h-8 w-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"+ >+ <X aria-hidden className="h-4 w-4" />+ </button>+ </div>+ <ScrollArea className="min-h-0 flex-1">+ <div className="flex flex-col items-center px-5 pb-6">+ <div className="relative">+ <div+ className={cn(+ "flex h-28 w-28 items-center justify-center overflow-hidden rounded-full border border-border bg-card shadow-float transition-shadow",+ status.tone === "live" && "ring-4 ring-accent/40",+ )}+ >+ <MascotGigi size={84} reactToVoice enableComments={false} />+ </div>+ <span+ aria-hidden+ className={cn(+ "absolute bottom-1.5 right-1.5 h-4 w-4 rounded-full ring-4 ring-sidebar",+ TONE_DOT[status.tone],+ status.tone === "live" && "animate-jarvis-pulse",+ )}+ />+ </div>+ <h2 className="mt-4 text-xl font-semibold text-foreground-strong" data-testid="assistant-panel-name">+ {assistantName}+ </h2>+ <p className="mt-1 flex items-center gap-1.5 text-sm text-muted-foreground" data-testid="assistant-panel-status">+ {status.tone === "busy" || status.tone === "live" ? (+ <Loader2 aria-hidden className="h-3.5 w-3.5 animate-spin text-accent motion-reduce:animate-none" />+ ) : null}+ {status.label}+ </p>++ <div className="mt-5 grid w-full grid-cols-2 gap-2">+ <button+ type="button"+ onClick={voice.toggle}+ disabled={voice.busy}+ data-testid="assistant-panel-talk"+ className={cn(+ "flex h-10 items-center justify-center gap-2 rounded-full text-sm font-medium transition-colors",+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60",+ "bg-accent text-accent-foreground hover:bg-accent/90",+ )}+ >+ {voice.on ? <Keyboard aria-hidden className="h-4 w-4" /> : <AudioLines aria-hidden className="h-4 w-4" />}+ {t(voice.on ? "assistant_chat.voice_exit" : "assistant_chat.talk")}+ </button>+ <button+ type="button"+ onClick={() => {+ voice.exit();+ startNewTextChat();+ }}+ data-testid="assistant-panel-new-chat"+ className="flex h-10 items-center justify-center gap-2 rounded-full border border-border bg-card text-sm font-medium text-foreground transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"+ >+ <Plus aria-hidden className="h-4 w-4" />+ {t("assistant_chat.new_chat")}+ </button>+ </div>++ <Tabs defaultValue="overview" className="mt-6 w-full">+ <TabsList className="grid w-full grid-cols-2">+ <TabsTrigger value="overview" data-testid="assistant-tab-overview">{t("assistant_chat.tab_overview")}</TabsTrigger>+ <TabsTrigger value="chat" data-testid="assistant-tab-chat">{t("assistant_chat.tab_chat")}</TabsTrigger>+ </TabsList>+ <TabsContent value="overview" className="mt-4 space-y-4">+ <div className="grid grid-cols-2 gap-3">+ <SoulTile />+ <MemoryTile />+ </div>+ <BrainRow />+ </TabsContent>+ <TabsContent value="chat" className="mt-4">+ <ChatFacts />+ </TabsContent>+ </Tabs>+ </div>+ </ScrollArea>+ </aside>+ );+}++function SoulTile() {+ const t = useT();+ const assistantName = useEventStore((s) => s.assistantName);+ const setActiveSection = useEventStore((s) => s.setActiveSection);+ const { config, loading, error } = useAgentInstructions();+ const value = loading+ ? null+ : error || !config+ ? t("assistant_chat.memory_unknown")+ : config.exists+ ? fill(t("assistant_chat.soul_chars"), { count: config.char_count.toLocaleString() })+ : t("assistant_chat.soul_empty");+ const file = config?.filename || `${assistantName}.md`;+ return (+ <VividTile+ kind="soul"+ title={t("assistant_chat.soul")}+ subtitle={file}+ value={value}+ hint={fill(t("assistant_chat.soul_open"), { file, name: assistantName })}+ onOpen={() => setActiveSection("agent-instructions")}+ testId="assistant-tile-soul"+ />+ );+}++function MemoryTile() {+ const t = useT();+ const assistantName = useEventStore((s) => s.assistantName);+ const setActiveSection = useEventStore((s) => s.setActiveSection);+ const [health, setHealth] = useState<WikiHealthSnapshot | null | undefined>(undefined);+ useEffect(() => {+ let alive = true;+ void fetchWikiHealth().then((snapshot) => {+ if (alive) setHealth(snapshot);+ });+ return () => {+ alive = false;+ };+ }, []);+ const value =+ health === undefined+ ? null+ : health === null+ ? t("assistant_chat.memory_unknown")+ : fill(t("assistant_chat.memory_pages"), { count: health.vault_pages.toLocaleString() });+ // The last time something was written to the wiki, when this run has seen+ // a write; the health record lives in memory and starts empty after a boot.+ const lastWrite = health?.last_write?.ok && health.last_write.ts+ ? new Date(health.last_write.ts * 1000).toLocaleDateString(undefined, { month: "2-digit", day: "2-digit", year: "2-digit" })+ : null;+ return (+ <VividTile+ kind="memory"+ title={t("assistant_chat.memory")}+ subtitle={lastWrite ?? t("assistant_chat.memory_hint")}+ value={value}+ hint={fill(t("assistant_chat.memory_open"), { name: assistantName })}+ onOpen={() => setActiveSection("memory")}+ testId="assistant-tile-memory"+ />+ );+}++function VividTile({+ kind,+ title,+ subtitle,+ value,+ hint,+ onOpen,+ testId,+}: {+ kind: "soul" | "memory";+ title: string;+ subtitle: string;+ /** Null while the read is in flight — drawn as a placeholder bar. */+ value: string | null;+ hint: string;+ onOpen: () => void;+ testId: string;+}) {+ return (+ <button+ type="button"+ onClick={onOpen}+ title={hint}+ aria-label={hint}+ data-testid={testId}+ className={cn(+ kind === "soul" ? "jarvis-tile-soul" : "jarvis-tile-memory",+ "group flex aspect-[4/5] flex-col rounded-2xl p-3.5 text-left shadow-float transition-transform duration-200",+ "hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar motion-reduce:transition-none motion-reduce:hover:translate-y-0",+ )}+ >+ <span className="text-lg font-bold uppercase leading-tight tracking-tight">{title}</span>+ <span className="mt-0.5 truncate font-mono text-xs uppercase tracking-wide opacity-85">{subtitle}</span>+ <span className="mt-auto flex items-end justify-between gap-2">+ {value === null ? (+ <span aria-hidden className="h-3 w-16 animate-pulse rounded bg-current opacity-30 motion-reduce:animate-none" />+ ) : (+ <span className="font-mono text-xs font-semibold leading-tight">{value}</span>+ )}+ <ArrowUpRight aria-hidden className="h-4 w-4 shrink-0 opacity-80 transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5 motion-reduce:transition-none" />+ </span>+ </button>+ );+}++/** The provider and model this chat runs on — the composer's picks, read back. */+function BrainRow() {+ const t = useT();+ const draft = useAgentChat((s) => s.draft);+ const catalog = useAgentChat((s) => s.catalog);+ const provider = catalog?.providers.find((p) => p.id === draft.provider);+ const model = provider?.curated_models.find((m) => m.id === draft.model)?.label || draft.model;+ return (+ <div className="rounded-xl border border-border bg-card px-3.5 py-3" data-testid="assistant-brain">+ <div className="text-xs font-medium text-muted-foreground">{t("assistant_chat.brain")}</div>+ {provider ? (+ <div className="mt-1.5 flex min-w-0 items-center gap-2 text-sm text-foreground">+ <ProviderLogo providerId={provider.id} label={provider.label} size="sm" />+ <span className="truncate font-medium">{provider.label}</span>+ <span className="truncate text-muted-foreground">· {model || t("agent_chat.model_default")}</span>+ </div>+ ) : (+ <div className="mt-1.5 text-sm text-muted-foreground">{t("assistant_chat.brain_none")}</div>+ )}+ </div>+ );+}++/** What this conversation holds, counted from its own timeline. */+export function chatFacts(items: TimelineItem[]) {+ let messages = 0;+ let answers = 0;+ let tools = 0;+ let startedMs = 0;+ for (const item of items) {+ const ts = item.type === "turn" ? item.startedMs : item.tsMs;+ if (ts && (!startedMs || ts < startedMs)) startedMs = ts;+ if (item.type === "user" && item.origin !== "control") messages += 1;+ if (item.type === "turn") {+ answers += 1;+ tools += item.blocks.filter((b) => b.kind === "tool").length;+ }+ }+ return { messages, answers, tools, startedMs };+}++function ChatFacts() {+ const t = useT();+ const items = useAgentChat((s) => s.timeline.items);+ const facts = useMemo(() => chatFacts(items), [items]);+ if (!items.length) {+ return <p className="px-1 text-sm text-muted-foreground" data-testid="assistant-chat-empty">{t("assistant_chat.chat_empty")}</p>;+ }+ const started = facts.startedMs+ ? new Date(facts.startedMs).toLocaleString(undefined, { month: "short", day: "numeric", hour: "numeric", minute: "2-digit" })+ : "—";+ return (+ <dl className="divide-y divide-border rounded-xl border border-border bg-card" data-testid="assistant-chat-facts">+ <Fact label={t("assistant_chat.chat_started")}>{started}</Fact>+ <Fact label={t("assistant_chat.chat_messages")}>{facts.messages}</Fact>+ <Fact label={t("assistant_chat.chat_answers")}>{facts.answers}</Fact>+ <Fact label={t("assistant_chat.chat_tools")}>{facts.tools}</Fact>+ </dl>+ );+}++function Fact({ label, children }: { label: string; children: ReactNode }) {+ return (+ <div className="flex items-center justify-between gap-3 px-3.5 py-2.5 text-sm">+ <dt className="text-muted-foreground">{label}</dt>+ <dd className="font-medium tabular-nums text-foreground">{children}</dd>+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/home/ChatStage.tsx b/jarvis/ui/web/frontend/src/components/home/ChatStage.tsxindex 4966b04e62..b9b34de7b2 100644--- a/jarvis/ui/web/frontend/src/components/home/ChatStage.tsx+++ b/jarvis/ui/web/frontend/src/components/home/ChatStage.tsx@@ -14,7 +14,9 @@ import { VoiceThreadStage } from "@/components/home/VoiceThreadStage";import type { ApprovalDecision } from "@/lib/agentChatApi";import { fill, useT } from "@/i18n";import { folderLeaf } from "@/lib/folderPath";-import { FolderCode } from "lucide-react";+import { AudioLines, FolderCode } from "lucide-react";+import { useVoiceModeSwitch } from "@/components/home/assistantStatus";+import { useWakeWord } from "@/hooks/useWakeWord";/*** The chat stage — the typed half of the front page: Jarvis with a keyboard.@@ -210,7 +212,10 @@ function ChatStageContent() {) : (<FolderHeadline folder={cwd} subtitle={subtitle} />)}- <AgentComposer autoFocus />+ <div className="flex flex-col gap-4">+ <AgentComposer autoFocus />+ {isJarvis && <TalkInvitation />}+ </div></div></div>);@@ -228,6 +233,7 @@ function ChatStageContent() {assistantName={isJarvis ? assistantName : t("agent_chat.surface_agent")}providerLabel={providerLabel}onDecide={onDecide}+ bubbles={isJarvis}/><div ref={spacerRef} aria-hidden data-testid="chat-bottom-spacer" className="shrink-0" /></div>@@ -261,6 +267,34 @@ function FolderHeadline({ folder, subtitle }: { folder: string; subtitle: string);}+/**+ * Under the empty front-page composer: the way into voice mode, for someone+ * who would rather talk. The same switch as the top bar's button+ * (useVoiceModeSwitch) — and, when a wake word is set, the reminder that+ * saying it works from anywhere.+ */+function TalkInvitation() {+ const t = useT();+ const voice = useVoiceModeSwitch();+ const { config } = useWakeWord();+ const wake = config?.phrase.trim() || "";+ return (+ <div className="flex flex-wrap items-center justify-center gap-x-2 gap-y-1 text-sm text-muted-foreground" data-testid="chat-talk-invitation">+ <button+ type="button"+ onClick={voice.enter}+ disabled={voice.busy}+ data-testid="chat-talk-invitation-start"+ className="flex items-center gap-2 rounded-full px-3 py-1.5 font-medium text-foreground transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60"+ >+ <AudioLines aria-hidden className="h-4 w-4 text-accent" />+ {t("assistant_chat.talk_cta")}+ </button>+ {wake && <span>{fill(t("assistant_chat.talk_cta_wake"), { wake })}</span>}+ </div>+ );+}+/** Room kept under the turn so the composer's shadow never kisses the text. */const TURN_BOTTOM_PAD_PX = 24;diff --git a/jarvis/ui/web/frontend/src/components/home/ChatTopBar.tsx b/jarvis/ui/web/frontend/src/components/home/ChatTopBar.tsxnew file mode 100644index 0000000000..358862c692--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/home/ChatTopBar.tsx@@ -0,0 +1,111 @@+import { AudioLines, Keyboard, Loader2, PanelRightClose, PanelRightOpen } from "lucide-react";++import { GigiMark } from "@/components/GigiMark";+import { TONE_DOT, useAssistantStatus, useVoiceModeSwitch } from "@/components/home/assistantStatus";+import { fill, useT } from "@/i18n";+import { cn } from "@/lib/utils";+import { useEventStore } from "@/store/events";++/**+ * The front page's top bar: who you are talking to, what they are doing, and+ * the one button that turns the chat into a spoken conversation.+ *+ * Left, the assistant as a pill — face, name, status dot; clicking it shows+ * or hides the assistant card on the right. Centre, a status pill that only+ * appears when there is news (working, listening, speaking, offline): "Ready"+ * is the normal state and earns no space. Right, the voice-mode button —+ * outlined while you type, filled in the signal hue while voice mode is on,+ * with a live ping while the microphone is actually open.+ */+export function ChatTopBar({+ panelOpen,+ onTogglePanel,+}: {+ panelOpen: boolean;+ onTogglePanel: () => void;+}) {+ const t = useT();+ const assistantName = useEventStore((s) => s.assistantName);+ const status = useAssistantStatus();+ const voice = useVoiceModeSwitch();+ const news = status.tone !== "ready";++ return (+ <header className="relative flex h-14 shrink-0 items-center gap-2 px-4" data-testid="chat-top-bar">+ <button+ type="button"+ onClick={onTogglePanel}+ title={fill(t(panelOpen ? "assistant_chat.panel_close" : "assistant_chat.panel_open"), { name: assistantName })}+ data-testid="chat-top-assistant"+ className="flex h-9 min-w-0 items-center gap-2 rounded-full border border-border bg-card py-1 pl-1 pr-3.5 text-sm font-semibold text-foreground-strong transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"+ >+ <span className="relative shrink-0">+ <GigiMark size={28} className="rounded-full" />+ <span+ aria-hidden+ className={cn(+ "absolute -right-0.5 -top-0.5 h-2.5 w-2.5 rounded-full ring-2 ring-card",+ TONE_DOT[status.tone],+ status.tone === "live" && "animate-jarvis-pulse",+ )}+ />+ </span>+ <span className="truncate">{assistantName}</span>+ </button>++ {news && (+ <div+ role="status"+ data-testid="chat-top-status"+ data-tone={status.tone}+ className="pointer-events-none absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center gap-1.5 rounded-full bg-secondary px-3 py-1.5 text-xs font-medium text-foreground"+ >+ {status.tone === "busy" || status.tone === "live" ? (+ <Loader2 aria-hidden className="h-3.5 w-3.5 animate-spin text-accent motion-reduce:animate-none" />+ ) : (+ <span aria-hidden className={cn("h-1.5 w-1.5 rounded-full", TONE_DOT[status.tone])} />+ )}+ <span>{status.label}</span>+ </div>+ )}++ <div className="ml-auto flex items-center gap-1.5">+ <button+ type="button"+ onClick={voice.toggle}+ aria-pressed={voice.on}+ disabled={voice.busy}+ data-testid="chat-voice-mode"+ title={fill(t(voice.on ? "assistant_chat.voice_exit_hint" : "assistant_chat.voice_enter_hint"), { name: assistantName })}+ className={cn(+ "relative flex h-9 items-center gap-2 rounded-full px-3.5 text-sm font-medium transition-colors",+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60",+ voice.on+ ? "bg-accent text-accent-foreground hover:bg-accent/90"+ : "border border-border bg-card text-foreground hover:bg-secondary",+ )}+ >+ {voice.on ? <Keyboard aria-hidden className="h-4 w-4" /> : <AudioLines aria-hidden className="h-4 w-4" />}+ <span>{t(voice.on ? "assistant_chat.voice_exit" : "assistant_chat.voice_enter")}</span>+ {voice.on && voice.live && (+ <span aria-hidden className="relative ml-0.5 flex h-2 w-2">+ <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-accent-foreground opacity-70 motion-reduce:animate-none" />+ <span className="relative inline-flex h-2 w-2 rounded-full bg-accent-foreground" />+ </span>+ )}+ </button>+ <button+ type="button"+ onClick={onTogglePanel}+ aria-pressed={panelOpen}+ data-testid="chat-panel-toggle"+ aria-label={fill(t(panelOpen ? "assistant_chat.panel_close" : "assistant_chat.panel_open"), { name: assistantName })}+ title={fill(t(panelOpen ? "assistant_chat.panel_close" : "assistant_chat.panel_open"), { name: assistantName })}+ className="hidden h-9 w-9 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring xl:flex"+ >+ {panelOpen ? <PanelRightClose aria-hidden className="h-4 w-4" /> : <PanelRightOpen aria-hidden className="h-4 w-4" />}+ </button>+ </div>+ </header>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/home/VoiceStage.tsx b/jarvis/ui/web/frontend/src/components/home/VoiceStage.tsxindex b52887c23a..af72c5d8b1 100644--- a/jarvis/ui/web/frontend/src/components/home/VoiceStage.tsx+++ b/jarvis/ui/web/frontend/src/components/home/VoiceStage.tsx@@ -114,7 +114,7 @@ export function VoiceStage() {<div className="h-2 shrink-0" aria-hidden />{lines.map((m) =>m.who === "steps" ? (- <div key={m.id} className="pl-[80px]" data-testid="transcript-steps">+ <div key={m.id} className="max-w-[85%] pl-1" data-testid="transcript-steps"><TurnStepssteps={m.steps}live={m.live}@@ -147,9 +147,12 @@ export function VoiceStage() {}/**- * One line of the lane. A LIVE line (words still being said, an answer still- * being produced) is muted and italic with a cursor; the finished line it- * becomes is in full colour — the same words, settled.+ * One line of the lane, drawn as a chat bubble so voice mode reads like the+ * chat it lives in: your words on the right in the signal hue, the+ * assistant's on the left on a card. A LIVE line (words still being said, an+ * answer still being produced) is dimmed and italic with a cursor; the+ * finished line it becomes is the same words, settled. The speaker's name+ * stays for screen readers only — the side says who spoke.*/function TranscriptLine({who,@@ -164,29 +167,22 @@ function TranscriptLine({}) {return (<div- className="grid grid-cols-[64px_1fr] items-baseline gap-x-4"+ className={cn("flex", user ? "justify-end" : "justify-start")}data-testid={live ? (user ? "transcript-live" : "transcript-live-answer") : "transcript-line"}data-who={user ? "user" : "assistant"}>- <span className="truncate text-right font-mono text-micro uppercase tracking-[0.12em] text-muted-foreground">- {who}- </span>+ <span className="sr-only">{who}: </span><spanclassName={cn(- "whitespace-pre-wrap",- user- ? cn("text-lg", live ? "text-muted-foreground/70" : "text-muted-foreground")- : cn(- "font-display text-lg leading-snug",- live ? "text-muted-foreground" : "text-foreground",- ),- live && "italic",+ "max-w-[80%] whitespace-pre-wrap px-4 py-2.5 text-lg leading-snug",+ user ? "jarvis-chat-out rounded-3xl rounded-br-lg" : "rounded-3xl rounded-tl-lg bg-card text-foreground",+ live && "italic opacity-70",)}>{text}{live && (<span- className="ml-0.5 inline-block h-[1em] w-0.5 translate-y-0.5 animate-pulse bg-foreground motion-reduce:animate-none"+ className="ml-0.5 inline-block h-[1em] w-0.5 translate-y-0.5 animate-pulse bg-current motion-reduce:animate-none"aria-hidden/>)}diff --git a/jarvis/ui/web/frontend/src/components/home/assistantStatus.ts b/jarvis/ui/web/frontend/src/components/home/assistantStatus.tsnew file mode 100644index 0000000000..976d5d449a--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/home/assistantStatus.ts@@ -0,0 +1,97 @@+import { useCallback } from "react";++import { useAgentChat } from "@/components/agentchat/AgentChatStoreContext";+import { useVoiceCall } from "@/components/agentic/useVoiceCall";+import { useVoiceReadiness } from "@/hooks/useVoiceReadiness";+import { useT } from "@/i18n";+import { useEventStore } from "@/store/events";+import { useHomeStore } from "@/store/home";++/**+ * What the assistant is doing right now, in one word and one hue — read by+ * the chat's top bar and the assistant card so the two never disagree.+ *+ * A voice call outranks the typed chat: while the microphone is open the+ * spoken state is the news. Otherwise a running typed turn says "is working".+ * Only a dead socket reads as offline — voice still warming up does not take+ * the typed chat down with it.+ */+export type AssistantTone = "ready" | "busy" | "live" | "offline" | "error";++export interface AssistantStatus {+ tone: AssistantTone;+ label: string;+}++export function useAssistantStatus(): AssistantStatus {+ const t = useT();+ const voiceState = useEventStore((s) => s.voiceState);+ const { connected, bootWarming } = useVoiceReadiness();+ const turnRunning = useAgentChat((s) => {+ const items = s.timeline.items;+ for (let i = items.length - 1; i >= 0; i -= 1) {+ const item = items[i];+ if (item.type === "turn") return item.status === "running";+ }+ return false;+ });++ if (!connected) {+ return {+ tone: "offline",+ label: bootWarming ? t("voice_state.booting") : t("assistant_chat.status_offline"),+ };+ }+ if (voiceState === "error") return { tone: "error", label: t("voice_state.error") };+ if (+ voiceState === "connecting" ||+ voiceState === "listening" ||+ voiceState === "thinking" ||+ voiceState === "speaking" ||+ voiceState === "paused"+ ) {+ return { tone: "live", label: t(`voice_state.${voiceState}`) };+ }+ if (turnRunning) return { tone: "busy", label: t("assistant_chat.status_working") };+ return { tone: "ready", label: t("assistant_chat.status_ready") };+}++/** The status dot's fill per tone — status hues only, from theme tokens. */+export const TONE_DOT: Record<AssistantTone, string> = {+ ready: "bg-success",+ busy: "bg-accent",+ live: "bg-accent",+ offline: "bg-muted-foreground",+ error: "bg-destructive",+};++/**+ * Entering and leaving the chat's voice mode — the ONE path the top bar, the+ * assistant card and the empty chat's invitation all use.+ *+ * Entering shows the spoken transcript and opens the microphone through the+ * same start/stop request the Jarvis bar uses (useVoiceCall), so there is+ * still exactly one way a call begins. Leaving ends a running call: "back to+ * typing" with the microphone still open would be a hidden live mic.+ */+export function useVoiceModeSwitch() {+ const surface = useHomeStore((s) => s.surface);+ const setSurface = useHomeStore((s) => s.setSurface);+ const setActiveSection = useEventStore((s) => s.setActiveSection);+ const { active, busy, connecting, toggleCall } = useVoiceCall();+ const { connected } = useVoiceReadiness();+ const on = surface === "voice";++ const enter = useCallback(() => {+ setSurface("voice");+ setActiveSection("chats");+ if (!active && !busy && !connecting && connected) void toggleCall();+ }, [active, busy, connected, connecting, setActiveSection, setSurface, toggleCall]);++ const exit = useCallback(() => {+ if (active && !busy) void toggleCall();+ setSurface("chat");+ }, [active, busy, setSurface, toggleCall]);++ return { on, live: active || connecting, busy, enter, exit, toggle: on ? exit : enter };+}diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsxindex 1c7080b343..0fcf382e56 100644--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx@@ -194,67 +194,25 @@ describe("Sidebar new-conversation button", () => {useEventStore.setState({ conversations: [], messages: [], activeThreadId: null });});- test("offers both kinds and opens typed chat from the voice stage", async () => {+ test("opens an empty typed chat in one click, even from voice mode", async () => {useHomeStore.setState({ surface: "voice", transcript: [] });renderSidebar();const button = screen.getByTestId("sidebar-new-chat");expect(button.textContent).toContain("New chat");await act(async () => { button.click(); await Promise.resolve(); });- expect(useHomeStore.getState().surface).toBe("voice");- expect(useEventStore.getState().activeThreadId).toBe("old-voice-thread");- expect(screen.getByTestId("new-voice-chat")).toBeTruthy();- fireEvent.click(screen.getByTestId("new-text-chat"));expect(useHomeStore.getState().surface).toBe("chat");expect(useEventStore.getState().activeSection).toBe("chats");+ expect(screen.queryByRole("dialog")).toBeNull();});- test("on the chat surface it still opens an empty chat", async () => {+ test("never starts a voice run — voice is a mode inside the chat now", async () => {useHomeStore.setState({ surface: "chat", transcript: [] });-renderSidebar();- const button = screen.getByTestId("sidebar-new-chat");- expect(button.textContent).toContain("New chat");- expect(button.textContent).not.toContain("voice");-- await act(async () => {- button.click();- await Promise.resolve();- });- fireEvent.click(screen.getByTestId("new-text-chat"));-+ await act(async () => { screen.getByTestId("sidebar-new-chat").click(); await Promise.resolve(); });expect(useHomeStore.getState().surface).toBe("chat");const calls = (globalThis.fetch as unknown as { mock: { calls: unknown[][] } }).mock.calls;expect(calls.some((c) => String(c[0]) === "/api/chats/voice/new")).toBe(false);});-- test("opens a fresh voice chat from the chat surface", async () => {- useHomeStore.setState({ surface: "chat", transcript: [], liveReply: "Previous reply" });- renderSidebar();- fireEvent.click(screen.getByTestId("sidebar-new-chat"));- await act(async () => { fireEvent.click(screen.getByTestId("new-voice-chat")); });- expect(fetch).toHaveBeenCalledWith("/api/chats/voice/new", { method: "POST" });- expect(useHomeStore.getState().surface).toBe("voice");- expect(useHomeStore.getState().liveReply).toBe("");- expect(useEventStore.getState().activeSection).toBe("chats");- expect(useEventStore.getState().activeKind).toBe("voice");- expect(useEventStore.getState().activeThreadId).toBeNull();- expect(screen.queryByRole("dialog")).toBeNull();- });-- test("keeps the current conversation if creating a voice chat fails", async () => {- vi.stubGlobal("fetch", vi.fn(async (url: string) =>- String(url) === "/api/chats/voice/new"- ? new Response("", { status: 503 })- : new Response(JSON.stringify([]), { status: 200 }),- ));- useHomeStore.setState({ surface: "chat", transcript: [] });- renderSidebar();- fireEvent.click(screen.getByTestId("sidebar-new-chat"));- await act(async () => { fireEvent.click(screen.getByTestId("new-voice-chat")); });- expect(useHomeStore.getState().surface).toBe("chat");- expect(useEventStore.getState().activeThreadId).toBe("old-voice-thread");- expect(screen.getByRole("dialog")).toBeTruthy();- });});describe("Sidebar header avatar", () => {diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsxindex 4316cae25c..0765f15985 100644--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx@@ -1,6 +1,5 @@import {Loader2,- MessageSquare,Mic,ChevronDown,ChevronLeft,@@ -23,18 +22,15 @@ import { useSectionHealth } from "@/hooks/useProviders";import { usePluginAttention } from "@/hooks/usePluginAttention";import { clsx } from "clsx";import { cn } from "@/lib/utils";-import { useMemo, useRef, useState, type ReactNode } from "react";+import { useMemo, useState, type ReactNode } from "react";import { useT } from "@/i18n";import { RecentChats } from "@/components/home/RecentChats";import { useHomeStore } from "@/store/home";-import { useAgentChatStore } from "@/store/agentChat";import { IdeProjectTree } from "@/components/agentic/IdeProjectTree";import { useIdeProjectsStore } from "@/store/ideProjects";import { useAppInstance } from "@/hooks/useAppInstance";import { usePublishIdentity } from "@/components/marketplace/PublishIdentity";import { GigiMark } from "@/components/GigiMark";-import * as Dialog from "@radix-ui/react-dialog";-import { startNewVoiceRun } from "@/lib/chatsApi";import { startNewTextChat } from "@/lib/newChat";/*@@ -179,9 +175,6 @@ export function Sidebar({// confused; the default app shows nothing here.const appInstance = useAppInstance();const devTag = appInstance?.isDev ? appInstance.name.toUpperCase() : null;- // New chat offers both conversation types independently of the current view.- const newAgentChat = useAgentChatStore((s) => s.newChat);- const setSurface = useHomeStore((s) => s.setSurface);// The front page's nav row names the face the switch picked (Voice / Chat),// see `presentNavItem`.const surface = useHomeStore((s) => s.surface);@@ -220,38 +213,7 @@ export function Sidebar({*/const onIdeSection = IDE_SECTIONS.includes(active);const [moreOpen, setMoreOpen] = useState(false);- const [newChatOpen, setNewChatOpen] = useState(false);- const [startingVoice, setStartingVoice] = useState(false);- const startingVoiceRef = useRef(false);const identity = usePublishIdentity();- const startNewChat = () => {- startNewTextChat();- setNewChatOpen(false);- };- const startVoiceChat = async () => {- if (startingVoiceRef.current) return;- startingVoiceRef.current = true;- setStartingVoice(true);- try {- await startNewVoiceRun();- newAgentChat();- const events = useEventStore.getState();- events.setActiveConversation("voice", null);- events.setMessages([]);- events.seedThinkingTraces({});- events.setTranscription("", true);- useHomeStore.getState().resetTranscript();- useHomeStore.setState({ freshVoicePending: false });- setSurface("voice");- setActive("chats");- setNewChatOpen(false);- } catch {- useEventStore.getState().pushToast("error", `${t("sidebar.new_voice_chat")}: ${t("voice_state.error")}`);- } finally {- startingVoiceRef.current = false;- setStartingVoice(false);- }- };// Shared readiness derivation (same source the banner + chat empty-state use).const { connected, voiceWarming, bootWarming, warming } = useVoiceReadiness();@@ -494,28 +456,15 @@ export function Sidebar({</div>}</nav> : <nav aria-label={t("sidebar.sections")} className="space-y-1 px-2 py-2"><ul className="space-y-1">- <li><Dialog.Root open={newChatOpen} onOpenChange={(open) => { if (!startingVoiceRef.current) setNewChatOpen(open); }}>- <Dialog.Trigger asChild><button type="button" data-testid="sidebar-new-chat" data-tour="new-chat"- aria-label={t("sidebar.new_chat")} title={t("sidebar.new_chat")} className={rowClass}>+ {/* One door: a fresh typed chat. Voice is a mode INSIDE the chat+ now (its top bar's button), so there is nothing to choose+ between here (2026-10-01). */}+ <li><button type="button" data-testid="sidebar-new-chat" data-tour="new-chat"+ aria-label={t("sidebar.new_chat")} title={t("sidebar.new_chat")} className={rowClass}+ onClick={() => { useHomeStore.getState().setSurface("chat"); startNewTextChat(); }}><Plus aria-hidden className="h-4 w-4 shrink-0" />{!railed && <span>{t("sidebar.new_chat")}</span>}- </button></Dialog.Trigger>- <Dialog.Portal>- <Dialog.Overlay className="fixed inset-0 z-[80] bg-background/80 backdrop-blur-sm" />- <Dialog.Content aria-describedby={undefined} className="fixed left-1/2 top-1/2 z-[90] w-[min(360px,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-border bg-popover p-4 text-popover-foreground shadow-xl">- <Dialog.Title className="mb-4 text-lg font-semibold">{t("sidebar.new_chat")}</Dialog.Title>- <div className="space-y-2">- <button type="button" data-testid="new-text-chat" disabled={startingVoice} onClick={startNewChat} className={cn(rowClass, "border border-border py-3 disabled:opacity-50")}>- <MessageSquare aria-hidden className="h-5 w-5" />{t("sidebar.surface_chat")}- </button>- <button type="button" data-testid="new-voice-chat" disabled={startingVoice} onClick={() => void startVoiceChat()} className={cn(rowClass, "border border-border py-3 disabled:opacity-50")}>- {startingVoice ? <Loader2 aria-hidden className="h-5 w-5 animate-spin" /> : <Mic aria-hidden className="h-5 w-5" />}{t("sidebar.new_voice_chat")}- </button>- </div>- <Dialog.Close disabled={startingVoice} className={cn(rowClass, "mt-3 justify-center disabled:opacity-50")}>{t("common.cancel")}</Dialog.Close>- </Dialog.Content>- </Dialog.Portal>- </Dialog.Root></li>+ </button></li>{renderRow(findItem("agents"))}{renderRow(findItem("dictation"))}</ul>diff --git a/jarvis/ui/web/frontend/src/components/layout/navGroups.test.ts b/jarvis/ui/web/frontend/src/components/layout/navGroups.test.tsindex 2dad879f8a..34c57d894b 100644--- a/jarvis/ui/web/frontend/src/components/layout/navGroups.test.ts+++ b/jarvis/ui/web/frontend/src/components/layout/navGroups.test.ts@@ -1,5 +1,5 @@import { describe, expect, it } from "vitest";-import { MessageSquare, Mic } from "lucide-react";+import { MessageSquare } from "lucide-react";import { NAV_GROUPS, presentNavItem } from "@/components/layout/navGroups";@@ -7,14 +7,12 @@ const chats = NAV_GROUPS.flat().find((i) => i.id === "chats")!;const agents = NAV_GROUPS.flat().find((i) => i.id === "agents")!;describe("presentNavItem", () => {- it("names the front page after the face the Voice | Chat switch picked", () => {- const voice = presentNavItem(chats, "voice");- expect(voice.labelKey).toBe("sidebar.surface_voice");- expect(voice.icon).toBe(Mic);-- const chat = presentNavItem(chats, "chat");- expect(chat.labelKey).toBe("sidebar.surface_chat");- expect(chat.icon).toBe(MessageSquare);+ it("names the front page \"Chat\" in either mode — voice mode is a state of the chat", () => {+ for (const surface of ["voice", "chat"] as const) {+ const row = presentNavItem(chats, surface);+ expect(row.labelKey).toBe("sidebar.surface_chat");+ expect(row.icon).toBe(MessageSquare);+ }});it("keeps the section id so the row still lands on the front page", () => {diff --git a/jarvis/ui/web/frontend/src/components/layout/navGroups.ts b/jarvis/ui/web/frontend/src/components/layout/navGroups.tsindex ffd13ee5d6..27b124c761 100644--- a/jarvis/ui/web/frontend/src/components/layout/navGroups.ts+++ b/jarvis/ui/web/frontend/src/components/layout/navGroups.ts@@ -51,19 +51,17 @@ export function resolveNavLabel(t: (key: string) => string, item: NavItem): stri}/**- * The front page is ONE section ("chats") with two faces — the voice stage- * and the typed chat — picked by the `Voice | Chat` switch at the top of the- * sidebar. Its nav row says which face it currently is: Mic + "Voice" or- * bubble + "Chat", the same two words the switch uses. A fixed "Chats" label- * under a switch that says "Voice" read as a contradiction (maintainer,- * 2026-08-23). Every other row passes through unchanged. Pure, so the- * sidebar and the rail present the row identically.+ * The front page is ONE section ("chats"): a chat with a voice mode inside it+ * (2026-10-01; before that, a `Voice | Chat` switch picked between two faces+ * and this row was renamed after the face). The row is "Chat" whatever mode+ * the chat is in — voice mode is a state of the chat, not another place.+ * Every other row passes through unchanged. Pure, so the sidebar and the+ * rail present the row identically; the surface argument stays so callers+ * need not change.*/-export function presentNavItem(item: NavItem, surface: HomeSurface): NavItem {+export function presentNavItem(item: NavItem, _surface?: HomeSurface): NavItem {if (item.id !== "chats") return item;- return surface === "voice"- ? { ...item, labelKey: "sidebar.surface_voice", icon: Mic, fallbackLabel: "Voice" }- : { ...item, labelKey: "sidebar.surface_chat", icon: MessageSquare, fallbackLabel: "Chat" };+ return { ...item, labelKey: "sidebar.surface_chat", icon: MessageSquare, fallbackLabel: "Chat" };}export interface NavItem {diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex 75979d65f7..d9c9d75e39 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -667,6 +667,40 @@"theme_to_light": "Zum hellen Modus wechseln","theme_to_dark": "Zum dunklen Modus wechseln"},+ "assistant_chat": {+ "voice_enter": "Sprachmodus",+ "voice_enter_hint": "Sprechen statt tippen — {name} hört zu und antwortet laut",+ "voice_exit": "Zurück zum Tippen",+ "voice_exit_hint": "Das Gespräch beenden und zurück in den Chat",+ "panel_open": "Karte von {name} anzeigen",+ "panel_close": "Karte ausblenden",+ "status_ready": "Bereit",+ "status_working": "arbeitet",+ "status_offline": "Offline",+ "talk": "Sprechen",+ "new_chat": "Neuer Chat",+ "tab_overview": "Übersicht",+ "tab_chat": "Dieser Chat",+ "soul": "Seele",+ "soul_hint": "Feste Anweisungen",+ "soul_empty": "Noch nicht geschrieben",+ "soul_chars": "{count} Zeichen",+ "soul_open": "{file} öffnen — die festen Anweisungen, die {name} bei jeder Antwort liest",+ "memory": "Gedächtnis",+ "memory_hint": "Dein Wiki",+ "memory_pages": "{count} Seiten",+ "memory_unknown": "Nicht verfügbar",+ "memory_open": "Das Wiki öffnen — was {name} sich merkt",+ "brain": "Läuft auf",+ "brain_none": "Wähle im Eingabefeld ein Modell",+ "chat_started": "Begonnen",+ "chat_messages": "Deine Nachrichten",+ "chat_answers": "Antworten",+ "chat_tools": "Werkzeugaufrufe",+ "chat_empty": "In diesem Chat wurde noch nichts gesagt.",+ "talk_cta": "Lieber sprechen? Sprachmodus starten",+ "talk_cta_wake": "oder sag „{wake}“"+ },"agent_chat": {"pair_open": "Agenten-Chat öffnen","pair_close": "Chat schließen",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex 35aa35638c..2782053868 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -667,6 +667,40 @@"theme_to_light": "Switch to light mode","theme_to_dark": "Switch to dark mode"},+ "assistant_chat": {+ "voice_enter": "Voice mode",+ "voice_enter_hint": "Talk instead of typing — {name} listens and answers out loud",+ "voice_exit": "Back to typing",+ "voice_exit_hint": "End the spoken conversation and go back to the chat",+ "panel_open": "Show {name}'s card",+ "panel_close": "Hide the card",+ "status_ready": "Ready",+ "status_working": "is working",+ "status_offline": "Offline",+ "talk": "Talk",+ "new_chat": "New chat",+ "tab_overview": "Overview",+ "tab_chat": "This chat",+ "soul": "Soul",+ "soul_hint": "Standing instructions",+ "soul_empty": "Not written yet",+ "soul_chars": "{count} characters",+ "soul_open": "Open {file} — the standing instructions {name} reads every turn",+ "memory": "Memory",+ "memory_hint": "Your wiki",+ "memory_pages": "{count} pages",+ "memory_unknown": "Not available",+ "memory_open": "Open the wiki — what {name} remembers",+ "brain": "Runs on",+ "brain_none": "Pick a model in the composer",+ "chat_started": "Started",+ "chat_messages": "Your messages",+ "chat_answers": "Answers",+ "chat_tools": "Tool calls",+ "chat_empty": "Nothing said in this chat yet.",+ "talk_cta": "Rather talk? Start voice mode",+ "talk_cta_wake": "or say “{wake}”"+ },"agent_chat": {"pair_open": "Open agent conversation","pair_close": "Close chat",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex 61be01a387..016012c0d3 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -667,6 +667,40 @@"theme_to_light": "Cambiar al modo claro","theme_to_dark": "Cambiar al modo oscuro"},+ "assistant_chat": {+ "voice_enter": "Modo voz",+ "voice_enter_hint": "Habla en lugar de escribir: {name} escucha y responde en voz alta",+ "voice_exit": "Volver a escribir",+ "voice_exit_hint": "Terminar la conversación hablada y volver al chat",+ "panel_open": "Mostrar la tarjeta de {name}",+ "panel_close": "Ocultar la tarjeta",+ "status_ready": "Listo",+ "status_working": "está trabajando",+ "status_offline": "Sin conexión",+ "talk": "Hablar",+ "new_chat": "Nuevo chat",+ "tab_overview": "Resumen",+ "tab_chat": "Este chat",+ "soul": "Alma",+ "soul_hint": "Instrucciones fijas",+ "soul_empty": "Aún sin escribir",+ "soul_chars": "{count} caracteres",+ "soul_open": "Abrir {file}: las instrucciones fijas que {name} lee en cada turno",+ "memory": "Memoria",+ "memory_hint": "Tu wiki",+ "memory_pages": "{count} páginas",+ "memory_unknown": "No disponible",+ "memory_open": "Abrir la wiki: lo que {name} recuerda",+ "brain": "Funciona con",+ "brain_none": "Elige un modelo en el compositor",+ "chat_started": "Empezado",+ "chat_messages": "Tus mensajes",+ "chat_answers": "Respuestas",+ "chat_tools": "Llamadas a herramientas",+ "chat_empty": "Todavía no se ha dicho nada en este chat.",+ "talk_cta": "¿Prefieres hablar? Inicia el modo voz",+ "talk_cta_wake": "o di «{wake}»"+ },"agent_chat": {"pair_open": "Abrir conversación entre agentes","pair_close": "Cerrar chat",diff --git a/jarvis/ui/web/frontend/src/index.css b/jarvis/ui/web/frontend/src/index.cssindex f4184b8234..f6584de540 100644--- a/jarvis/ui/web/frontend/src/index.css+++ b/jarvis/ui/web/frontend/src/index.css@@ -561,6 +561,16 @@ label,--popover-foreground: 0 0% 9%;--user-bubble: 0 0% 96%; /* #F5F5F5 — the speaker: quiet lift, strong ink */--user-bubble-foreground: 0 0% 9%;+ /* Front-page chat: the outbound bubble wears the signal hue, and the+ assistant card's two vivid tiles (Soul = standing instructions,+ Memory = the wiki) carry their own gradient pair. */+ --chat-bubble-out: 212 92% 45%;+ --chat-bubble-out-foreground: 0 0% 100%;+ --soul-from: 347 83% 52%;+ --soul-to: 14 92% 56%;+ --memory-from: 224 86% 52%;+ --memory-to: 194 92% 48%;+ --vivid-card-foreground: 0 0% 100%;--surface-raised: 0 0% 93%; /* #EDEDED — pressed/selected rows, code blocks */--border: 0 0% 90%; /* #E5E5E5 — hairline */--border-strong: 0 0% 82%; /* #D1D1D1 — input borders, focused card, float rim */@@ -753,6 +763,13 @@ label,--popover-foreground: 0 0% 98%;--user-bubble: 0 0% 16%; /* #292929 — the speaker: a quiet, legible lift */--user-bubble-foreground: 0 0% 98%;+ --chat-bubble-out: 212 100% 56%;+ --chat-bubble-out-foreground: 0 0% 100%;+ --soul-from: 347 86% 56%;+ --soul-to: 14 94% 58%;+ --memory-from: 226 92% 60%;+ --memory-to: 194 96% 50%;+ --vivid-card-foreground: 0 0% 100%;/* --- Rims. A rim is LIGHTER than the fill it encloses ------------------On near-black a dark border around a dark fill reads as a wireframe@@ -980,6 +997,32 @@ body {color: hsl(var(--user-bubble-foreground));}+ /* The front page's chat bubbles (AgentTimeline `bubbles`). */+ .jarvis-chat-out {+ background: hsl(var(--chat-bubble-out));+ color: hsl(var(--chat-bubble-out-foreground));+ }+ .jarvis-chat-out a {+ color: inherit;+ }++ /* The assistant card's vivid tiles: a gradient pair plus a soft light+ bloom in the top corner, so the tile reads as an object, not a swatch. */+ .jarvis-tile-soul,+ .jarvis-tile-memory {+ color: hsl(var(--vivid-card-foreground));+ }+ .jarvis-tile-soul {+ background:+ radial-gradient(120% 90% at 100% 0%, hsl(var(--vivid-card-foreground) / 0.22), transparent 55%),+ linear-gradient(140deg, hsl(var(--soul-from)), hsl(var(--soul-to)));+ }+ .jarvis-tile-memory {+ background:+ radial-gradient(120% 90% at 100% 0%, hsl(var(--vivid-card-foreground) / 0.22), transparent 55%),+ linear-gradient(140deg, hsl(var(--memory-from)), hsl(var(--memory-to)));+ }+/* Selected nav row — the lift surface across the WHOLE row, plus strong inkon the label. Not a hairline, not an inset accent bar, and never drawn onthe icon box alone while the row it belongs to stays at ground. */diff --git a/jarvis/ui/web/frontend/src/lib/homeSurface.ts b/jarvis/ui/web/frontend/src/lib/homeSurface.tsindex 16244ce864..68fed19bd1 100644--- a/jarvis/ui/web/frontend/src/lib/homeSurface.ts+++ b/jarvis/ui/web/frontend/src/lib/homeSurface.ts@@ -1,21 +1,23 @@/**- * Which surface the front page ("chats" section) shows: the voice stage with- * the Jarvis bar, or the typed chat.+ * Which mode the front page ("chats" section) is in: the typed chat, or the+ * chat's voice mode (the live transcript with the Jarvis bar).*- * 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.+ * Since 2026-10-01 the front page is ONE chat (maintainer: "no more Voice and+ * a normal chat — only a normal chat, with a button that turns voice mode+ * on"). Chat is the default; the voice mode is entered from the chat's top+ * bar or the assistant card and left the same way.*- * 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+ * Persisted in localStorage so a reload in the middle of a call stays in+ * voice mode. The key moved to v2 with the redesign so every install opens+ * on the chat once, whatever the old `Voice | Chat` switch last said. A+ * broken or absent value falls back to chat: 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";+const STORAGE_KEY = "jarvis.home.surface.v2";+const DEFAULT_SURFACE: HomeSurface = "chat";export function isHomeSurface(value: unknown): value is HomeSurface {return value === "voice" || value === "chat";diff --git a/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsx b/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsxindex e8913be834..ec14312e9d 100644--- a/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsx+++ b/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsx@@ -1,27 +1,26 @@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 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.+ * The front page is ONE chat with a voice mode inside it (2026-10-01). What+ * is under test is the shell: it opens on the chat, the top bar's voice-mode+ * button swaps in the spoken stage and brings the typing back, and the mode+ * is remembered. Both stages and the assistant card are stubbed.*/-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("@/components/home/AssistantProfilePanel", () => ({+ AssistantProfilePanel: () => <div data-testid="assistant-panel-stub" />,+}));-const STORAGE_KEY = "jarvis.home.surface.v1";+const STORAGE_KEY = "jarvis.home.surface.v2";describe("ChatsSurface (the front page)", () => {beforeEach(() => {@@ -31,54 +30,54 @@ describe("ChatsSurface (the front page)", () => {afterEach(cleanup);- it("opens on the voice stage by default", () => {+ it("opens on the chat by default", async () => {render(<ChatsSurface />);- expect(screen.getByTestId("voice")).toBeTruthy();- expect(screen.queryByTestId("chat")).toBeNull();- expect(screen.getByTestId("home-view").getAttribute("data-surface")).toBe("voice");- });-- it("switches to the chat stage from the sidebar switch and remembers it", async () => {- render(- <>- <SurfaceSwitch />- <ChatsSurface />- </>,- );-- fireEvent.click(screen.getByTestId("home-surface-chat"));-expect(await screen.findByTestId("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");+ expect(screen.getByTestId("home-view").getAttribute("data-surface")).toBe("chat");});- it("opens on the chat stage when that is the stored choice", async () => {- window.localStorage.setItem(STORAGE_KEY, "chat");+ it("ignores the retired Voice | Chat switch's stored choice", async () => {+ window.localStorage.setItem("jarvis.home.surface.v1", "voice");useHomeStore.setState({ surface: readHomeSurface() });render(<ChatsSurface />);expect(await screen.findByTestId("chat")).toBeTruthy();});- 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"));+ it("enters voice mode from the top bar and remembers it", async () => {+ render(<ChatsSurface />);+ await screen.findByTestId("chat");+ fireEvent.click(screen.getByTestId("chat-voice-mode"));expect(screen.getByTestId("voice")).toBeTruthy();+ expect(screen.queryByTestId("chat")).toBeNull();expect(window.localStorage.getItem(STORAGE_KEY)).toBe("voice");+ expect(screen.getByTestId("chat-voice-mode").getAttribute("aria-pressed")).toBe("true");});- it("lands on voice when the stored value is corrupt", () => {- window.localStorage.setItem(STORAGE_KEY, "garbage");+ it("goes back to typing from voice mode", async () => {+ window.localStorage.setItem(STORAGE_KEY, "voice");useHomeStore.setState({ surface: readHomeSurface() });render(<ChatsSurface />);expect(screen.getByTestId("voice")).toBeTruthy();+ fireEvent.click(screen.getByTestId("chat-voice-mode"));+ expect(await screen.findByTestId("chat")).toBeTruthy();+ expect(window.localStorage.getItem(STORAGE_KEY)).toBe("chat");+ });++ it("lands on the chat when the stored value is corrupt", async () => {+ window.localStorage.setItem(STORAGE_KEY, "garbage");+ useHomeStore.setState({ surface: readHomeSurface() });+ render(<ChatsSurface />);+ expect(await screen.findByTestId("chat")).toBeTruthy();+ });++ it("hides and shows the assistant card from the top bar", async () => {+ render(<ChatsSurface />);+ await screen.findByTestId("chat");+ expect(screen.getByTestId("assistant-panel-stub")).toBeTruthy();+ fireEvent.click(screen.getByTestId("chat-panel-toggle"));+ expect(screen.queryByTestId("assistant-panel-stub")).toBeNull();+ fireEvent.click(screen.getByTestId("chat-top-assistant"));+ expect(screen.getByTestId("assistant-panel-stub")).toBeTruthy();});});diff --git a/jarvis/ui/web/frontend/src/views/HomeView.tsx b/jarvis/ui/web/frontend/src/views/HomeView.tsxindex e6d4a6feeb..452db84b3f 100644--- a/jarvis/ui/web/frontend/src/views/HomeView.tsx+++ b/jarvis/ui/web/frontend/src/views/HomeView.tsx@@ -1,38 +1,21 @@-import { lazy, Suspense } from "react";import { useHomeStore } from "@/store/home";-import { HomeHeader } from "@/components/home/HomeHeader";-import { VoiceStage } from "@/components/home/VoiceStage";-import { useT } from "@/i18n";--const ChatStage = lazy(() =>- import("@/components/home/ChatStage").then((module) => ({ default: module.ChatStage })),-);+import { AssistantChat } from "@/components/home/AssistantChat";/*** The front page — the "chats" section.*- * One header for who is talking, 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.+ * Since 2026-10-01 it is ONE chat with the assistant, with a voice mode+ * inside it (components/home/AssistantChat): the maintainer retired the+ * separate `Voice | Chat` faces — "only a normal chat, with a button that+ * turns voice mode on". Typed and spoken turns still reach the same+ * assistant through the same event bus; `data-surface` says which mode the+ * chat is in (store/home.ts).*/export function HomeView() {- const t = useT();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" ? (- <Suspense fallback={<div role="status" className="flex min-h-0 flex-1 items-center justify-center text-sm text-muted-foreground">{t("common.loading")}</div>}>- <ChatStage />- </Suspense>- ) : <VoiceStage />}+ <AssistantChat /></div>);}