Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat(chat): make voice mode read like the chat it lives in

rubenluetke10-beep8113b6391761
diff --git a/jarvis/ui/web/frontend/src/components/home/AssistantChat.tsx b/jarvis/ui/web/frontend/src/components/home/AssistantChat.tsx
index 13950a2f3a..3e76d16e00 100644
--- a/jarvis/ui/web/frontend/src/components/home/AssistantChat.tsx
+++ b/jarvis/ui/web/frontend/src/components/home/AssistantChat.tsx
@@ -1,10 +1,8 @@
import { lazy, Suspense } from "react";
-import { Keyboard } from "lucide-react";
import { VoiceStage } from "@/components/home/VoiceStage";
import { useVoiceModeSwitch } from "@/components/home/assistantStatus";
-import { fill, useT } from "@/i18n";
-import { useEventStore } from "@/store/events";
+import { useT } from "@/i18n";
import { useHomeStore } from "@/store/home";
const ChatStage = lazy(() =>
@@ -18,17 +16,17 @@ const ChatStage = lazy(() =>
* is a short greeting over the composer in the middle of the page, the way
* the Claude app opens; the composer itself carries every control,
* including the round voice-mode button. 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 one quiet button in the corner brings
- * the typing back.
+ * chat, not another page: it swaps the typed composer for the voice
+ * composer under the spoken transcript (components/home/VoiceStage), whose
+ * keyboard button brings the typing back.
*/
export function AssistantChat() {
const t = useT();
const surface = useHomeStore((s) => s.surface);
+ const voice = useVoiceModeSwitch();
return (
<div className="relative flex min-h-0 flex-1 flex-col" data-testid="assistant-chat">
- {surface === "voice" && <BackToTyping />}
{surface === "chat" ? (
<Suspense
fallback={
@@ -40,27 +38,8 @@ export function AssistantChat() {
<ChatStage />
</Suspense>
) : (
- <VoiceStage />
+ <VoiceStage onExit={voice.exit} />
)}
</div>
);
}
-
-/** Voice mode's way out — ends a running call and shows the composer again. */
-function BackToTyping() {
- const t = useT();
- const assistantName = useEventStore((s) => s.assistantName);
- const voice = useVoiceModeSwitch();
- return (
- <button
- type="button"
- onClick={voice.exit}
- data-testid="voice-mode-exit"
- title={fill(t("assistant_chat.voice_exit_hint"), { name: assistantName })}
- className="absolute right-4 top-3 z-10 flex h-9 items-center gap-2 rounded-full border border-border bg-card px-3.5 text-sm font-medium text-foreground transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
- >
- <Keyboard aria-hidden className="h-4 w-4 text-muted-foreground" />
- {t("assistant_chat.voice_exit")}
- </button>
- );
-}
diff --git a/jarvis/ui/web/frontend/src/components/home/JarvisBar.test.tsx b/jarvis/ui/web/frontend/src/components/home/JarvisBar.test.tsx
deleted file mode 100644
index 34bce35e82..0000000000
--- a/jarvis/ui/web/frontend/src/components/home/JarvisBar.test.tsx
+++ /dev/null
@@ -1,186 +0,0 @@
-import { act, cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-
-import { JarvisBar } from "@/components/home/JarvisBar";
-import type { WaveformPhase } from "@/components/overlay/VoiceWaveform";
-import { DICTATION_SETTINGS_EVENT } from "@/hooks/usePromptMode";
-import { useEventStore } from "@/store/events";
-
-/**
- * The Prompt Mode pill on the Jarvis bar (maintainer, 2026-08-27): a small
- * indicator that is lit while every dictation comes out as a finished prompt,
- * and flips the switch on one click — without starting a conversation, which
- * is what a click on the card itself does.
- */
-
-const toggleCall = vi.fn();
-
-vi.mock("@/i18n", () => ({ useT: () => (key: string) => key }));
-vi.mock("@/components/home/StageWaveform", () => ({
- StageWaveform: () => <div data-testid="stage-waveform" />,
-}));
-vi.mock("@/components/agentic/useVoiceCall", () => ({
- useVoiceCall: () => ({ active: false, busy: false, connecting: false, toggleCall }),
-}));
-vi.mock("@/hooks/useVoiceReadiness", () => ({
- useVoiceReadiness: () => ({
- connected: true,
- warming: false,
- ready: true,
- voiceWarming: false,
- bootWarming: false,
- }),
-}));
-vi.mock("@/hooks/useVoiceEngineDisplay", () => ({
- useVoiceEngineDisplay: () => ({ providerLabel: "Groq", model: "fast-model" }),
-}));
-
-type FetchCall = { url: string; init?: RequestInit };
-
-function jsonResponse(body: unknown, status = 200): Response {
- return {
- ok: status >= 200 && status < 300,
- status,
- json: async () => body,
- } as unknown as Response;
-}
-
-/** A backend whose `[dictation]` block starts with Prompt Mode `initial`. */
-function stubBackend(initial: boolean | "missing" | "down") {
- const calls: FetchCall[] = [];
- let promptMode = initial === true;
- vi.stubGlobal(
- "fetch",
- vi.fn(async (input: RequestInfo | URL, init?: RequestInit) => {
- const url = String(input);
- calls.push({ url, init });
- if (initial === "down") return jsonResponse({ detail: "no backend" }, 503);
- if (init?.method === "PUT") {
- const body = JSON.parse(String(init.body)) as { prompt_mode?: boolean };
- if (typeof body.prompt_mode === "boolean") promptMode = body.prompt_mode;
- return jsonResponse({ settings: { prompt_mode: promptMode, polish: true } });
- }
- if (initial === "missing") return jsonResponse({ settings: { polish: true } });
- return jsonResponse({ settings: { prompt_mode: promptMode, polish: true } });
- }),
- );
- return calls;
-}
-
-function renderBar() {
- return render(<JarvisBar phase={"idle" as unknown as WaveformPhase} hint="hint" />);
-}
-
-beforeEach(() => {
- toggleCall.mockReset();
- useEventStore.setState({ toasts: [] } as never);
-});
-
-afterEach(() => {
- cleanup();
- vi.unstubAllGlobals();
-});
-
-describe("JarvisBar Prompt Mode pill", () => {
- it("shows the pill unlit while Prompt Mode is off", async () => {
- stubBackend(false);
- renderBar();
- const pill = await screen.findByTestId("jarvis-bar-prompt-mode");
- expect(pill.getAttribute("aria-pressed")).toBe("false");
- expect(pill.getAttribute("data-on")).toBeNull();
- expect(pill.getAttribute("title")).toBe("home.prompt_mode_off");
- });
-
- it("shows the pill lit while Prompt Mode is on", async () => {
- stubBackend(true);
- renderBar();
- const pill = await screen.findByTestId("jarvis-bar-prompt-mode");
- expect(pill.getAttribute("aria-pressed")).toBe("true");
- expect(pill.getAttribute("data-on")).toBe("true");
- expect(pill.getAttribute("title")).toBe("home.prompt_mode_on");
- });
-
- it("one click flips the switch through the settings route and never starts a call", async () => {
- const calls = stubBackend(false);
- renderBar();
- const pill = await screen.findByTestId("jarvis-bar-prompt-mode");
-
- await act(async () => {
- fireEvent.click(pill);
- });
-
- await waitFor(() => expect(pill.getAttribute("aria-pressed")).toBe("true"));
- const put = calls.find((c) => c.init?.method === "PUT");
- expect(put?.url).toBe("/api/dictation/settings");
- expect(JSON.parse(String(put?.init?.body))).toEqual({ prompt_mode: true, persist: true });
- expect(toggleCall).not.toHaveBeenCalled();
-
- await act(async () => {
- fireEvent.click(pill);
- });
- await waitFor(() => expect(pill.getAttribute("aria-pressed")).toBe("false"));
- expect(toggleCall).not.toHaveBeenCalled();
- });
-
- it("renders no pill when the backend does not answer or does not know the key", async () => {
- stubBackend("down");
- renderBar();
- await screen.findByTestId("jarvis-bar-engine");
- await act(async () => {});
- expect(screen.queryByTestId("jarvis-bar-prompt-mode")).toBeNull();
- cleanup();
-
- stubBackend("missing");
- renderBar();
- await screen.findByTestId("jarvis-bar-engine");
- await act(async () => {});
- expect(screen.queryByTestId("jarvis-bar-prompt-mode")).toBeNull();
- });
-
- it("follows a flip made on the settings screen", async () => {
- stubBackend(false);
- renderBar();
- const pill = await screen.findByTestId("jarvis-bar-prompt-mode");
- expect(pill.getAttribute("aria-pressed")).toBe("false");
-
- act(() => {
- window.dispatchEvent(
- new CustomEvent(DICTATION_SETTINGS_EVENT, {
- detail: { settings: { prompt_mode: true } },
- }),
- );
- });
- await waitFor(() => expect(pill.getAttribute("aria-pressed")).toBe("true"));
- });
-
- it("reports a failed save as a toast and keeps the old state", async () => {
- const calls = stubBackend(false);
- const fetchMock = globalThis.fetch as unknown as ReturnType<typeof vi.fn>;
- fetchMock.mockImplementation(async (input: RequestInfo | URL, init?: RequestInit) => {
- calls.push({ url: String(input), init });
- if (init?.method === "PUT") {
- return jsonResponse({ detail: "Dictation settings could not be saved." }, 500);
- }
- return jsonResponse({ settings: { prompt_mode: false } });
- });
- renderBar();
- const pill = await screen.findByTestId("jarvis-bar-prompt-mode");
-
- await act(async () => {
- fireEvent.click(pill);
- });
-
- await waitFor(() => expect(useEventStore.getState().toasts.length).toBe(1));
- expect(useEventStore.getState().toasts[0]?.message).toBe(
- "Dictation settings could not be saved.",
- );
- expect(pill.getAttribute("aria-pressed")).toBe("false");
- });
-
- it("wears the strong composer rim in both modes", async () => {
- stubBackend(false);
- renderBar();
- const bar = await screen.findByTestId("jarvis-bar");
- expect(bar.className).toContain("border-border-strong");
- });
-});
diff --git a/jarvis/ui/web/frontend/src/components/home/JarvisBar.tsx b/jarvis/ui/web/frontend/src/components/home/JarvisBar.tsx
deleted file mode 100644
index 759fe17dd9..0000000000
--- a/jarvis/ui/web/frontend/src/components/home/JarvisBar.tsx
+++ /dev/null
@@ -1,230 +0,0 @@
-import { useCallback, type KeyboardEvent, type MouseEvent } from "react";
-import { Loader2, PhoneOff, Sparkles } from "lucide-react";
-
-import { useEventStore, type VoiceState } from "@/store/events";
-import type { WaveformPhase } from "@/components/overlay/VoiceWaveform";
-import { StageWaveform } from "@/components/home/StageWaveform";
-import { voiceInputLevelRef } from "@/lib/voiceInputLevel";
-import { voiceOutputLevelRef } from "@/lib/voiceOutputLevel";
-import { useVoiceCall } from "@/components/agentic/useVoiceCall";
-import { useVoiceReadiness } from "@/hooks/useVoiceReadiness";
-import { useVoiceEngineDisplay } from "@/hooks/useVoiceEngineDisplay";
-import { usePromptMode } from "@/hooks/usePromptMode";
-import { useT } from "@/i18n";
-import { cn } from "@/lib/utils";
-
-/**
- * The Jarvis bar — the front page's one voice control, drawn as a card in
- * the chat composer's language (components/ChatInput.tsx: rounded-2xl,
- * bg-card, a hairline border, the same soft shadow) so the two surfaces
- * read as siblings.
- *
- * Top row: the waveform, filling the card's width (components/home/
- * StageWaveform — breathing at rest, the microphone while listening).
- * Bottom row: the state (dot + word) and, in the same breath, what to do
- * or what is happening ("Say “Hey George” or tap to start", "Listening…")
- * on the left; on the right the Prompt Mode pill — lit while every dictation
- * comes out as a finished prompt for a coding agent, one click flips it
- * (maintainer, 2026-08-27) — then the engine pill — provider and model,
- * click to change it — and, only while a conversation is running, an End
- * button. The whole card is the start/stop control (maintainer, 2026-08-23:
- * no microphone button — you tap the bar or say the wake word); the pills
- * stop the click from reaching the card so changing the model or flipping
- * Prompt Mode never starts a call by accident.
- *
- * A `div` with the button role rather than a `<button>`: a button may not
- * contain the two inner buttons, and nesting them is how a screen reader
- * would announce one control three times.
- */
-export function JarvisBar({ phase, hint }: { phase: WaveformPhase; hint: string }) {
- const t = useT();
- const voiceState = useEventStore((s) => s.voiceState);
- const setActiveSection = useEventStore((s) => s.setActiveSection);
- const pushToast = useEventStore((s) => s.pushToast);
- const { connected } = useVoiceReadiness();
- const engine = useVoiceEngineDisplay();
- const promptMode = usePromptMode();
- const { active: callActive, busy: callBusy, connecting, toggleCall } = useVoiceCall();
-
- const disabled = callBusy || connecting || !connected;
- const label = callActive ? t("home.bar_stop") : t("home.bar_start");
- const stateWord = t(`voice_state.${stateKey(voiceState, connecting, connected)}`);
-
- const onCardClick = useCallback(() => {
- if (disabled) return;
- void toggleCall();
- }, [disabled, toggleCall]);
-
- const onCardKey = useCallback(
- (ev: KeyboardEvent<HTMLDivElement>) => {
- if (ev.target !== ev.currentTarget) return; // a pill has its own keys
- if (ev.key === "Enter" || ev.key === " ") {
- ev.preventDefault();
- onCardClick();
- }
- },
- [onCardClick],
- );
-
- const onEngineClick = useCallback(
- (ev: MouseEvent<HTMLButtonElement>) => {
- ev.stopPropagation();
- setActiveSection("apikeys");
- },
- [setActiveSection],
- );
-
- const onEndClick = useCallback(
- (ev: MouseEvent<HTMLButtonElement>) => {
- ev.stopPropagation();
- if (callBusy) return;
- void toggleCall();
- },
- [callBusy, toggleCall],
- );
-
- const onPromptModeClick = useCallback(
- (ev: MouseEvent<HTMLButtonElement>) => {
- ev.stopPropagation();
- promptMode.toggle().catch((err: unknown) => {
- // The backend's own sentence names the blocker (a config file that
- // could not be written); ours would send the user to the wrong place.
- const detail = err instanceof Error && err.message ? err.message : "";
- pushToast("error", detail || t("home.prompt_mode_failed"));
- });
- },
- [promptMode, pushToast, t],
- );
-
- const promptModeTitle =
- promptMode.enabled === true ? t("home.prompt_mode_on") : t("home.prompt_mode_off");
-
- return (
- <div
- role="button"
- tabIndex={disabled ? -1 : 0}
- aria-disabled={disabled || undefined}
- aria-label={label}
- title={label}
- onClick={onCardClick}
- onKeyDown={onCardKey}
- data-testid="jarvis-bar"
- data-tour="voice-bar"
- data-phase={phase}
- data-active={callActive || undefined}
- className={cn(
- "group flex w-full cursor-pointer select-none flex-col gap-2 rounded-2xl border border-border-strong bg-card px-4 pb-2.5 pt-4 text-left",
- "transition-[border-color,box-shadow]",
- "hover:border-primary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
- "aria-disabled:cursor-default aria-disabled:opacity-80 aria-disabled:hover:border-border",
- callActive && "border-primary/50",
- )}
- >
- <div className="h-14 w-full">
- <StageWaveform
- levelRef={voiceInputLevelRef}
- outputLevelRef={voiceOutputLevelRef}
- phase={phase}
- />
- </div>
- <div className="flex items-center gap-2">
- <span
- className={cn(
- "flex min-w-0 items-center gap-2 px-1 font-mono text-micro uppercase tracking-[0.16em]",
- callActive ? "text-primary" : "text-muted-foreground",
- )}
- data-testid="jarvis-bar-state"
- >
- <span
- aria-hidden
- className={cn(
- "h-2 w-2 shrink-0 rounded-full",
- voiceState === "error"
- ? "bg-destructive"
- : callActive
- ? "bg-foreground/70 animate-jarvis-pulse"
- : "bg-muted-foreground/40",
- )}
- />
- <span className="shrink-0">{stateWord}</span>
- </span>
- <span
- className="min-w-0 flex-1 truncate text-xs text-muted-foreground"
- data-testid="voice-hint"
- >
- {hint}
- </span>
- {promptMode.enabled !== null && (
- <button
- type="button"
- onClick={onPromptModeClick}
- disabled={promptMode.busy}
- aria-pressed={promptMode.enabled}
- aria-label={promptModeTitle}
- title={promptModeTitle}
- data-testid="jarvis-bar-prompt-mode"
- data-on={promptMode.enabled || undefined}
- className={cn(
- "inline-flex h-8 shrink-0 items-center gap-1.5 rounded-lg border px-2 text-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60",
- promptMode.enabled
- ? "border-primary/40 bg-primary/10 text-primary hover:bg-primary/15"
- : "border-transparent text-muted-foreground hover:bg-secondary hover:text-foreground",
- )}
- >
- {promptMode.busy ? (
- <Loader2 className="h-3.5 w-3.5 animate-spin" aria-hidden />
- ) : (
- <Sparkles className="h-3.5 w-3.5" aria-hidden />
- )}
- <span className="hidden font-medium sm:inline">{t("home.prompt_mode_pill")}</span>
- {promptMode.enabled && (
- <span
- aria-hidden
- className="h-1.5 w-1.5 shrink-0 rounded-full bg-foreground/70 animate-jarvis-pulse"
- />
- )}
- </button>
- )}
- <button
- type="button"
- onClick={onEngineClick}
- title={t("home.model_hint")}
- data-testid="jarvis-bar-engine"
- 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 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
- >
- <span className="truncate font-medium text-foreground">{engine.providerLabel}</span>
- {engine.model && (
- <span className="hidden truncate font-mono text-micro text-muted-foreground sm:inline">
- {engine.model}
- </span>
- )}
- </button>
- {callActive && (
- <button
- type="button"
- onClick={onEndClick}
- disabled={callBusy}
- aria-label={t("home.bar_end")}
- title={t("home.bar_end")}
- data-testid="jarvis-bar-end"
- className="inline-flex h-8 items-center gap-1.5 rounded-lg border border-destructive/30 bg-destructive/10 px-2.5 text-xs font-medium text-destructive transition-colors hover:bg-destructive/20 disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
- >
- <PhoneOff className="h-3.5 w-3.5" aria-hidden />
- {t("home.bar_end")}
- </button>
- )}
- </div>
- </div>
- );
-}
-
-/**
- * Which `voice_state.*` word the bar shows. Offline wins over whatever the
- * store last heard; the call being negotiated wins over the stale state
- * before it.
- */
-export function stateKey(state: VoiceState, connecting: boolean, connected: boolean): string {
- if (!connected) return "offline";
- if (connecting) return "connecting";
- return state;
-}
diff --git a/jarvis/ui/web/frontend/src/components/home/StageWaveform.tsx b/jarvis/ui/web/frontend/src/components/home/StageWaveform.tsx
deleted file mode 100644
index fc68604202..0000000000
--- a/jarvis/ui/web/frontend/src/components/home/StageWaveform.tsx
+++ /dev/null
@@ -1,538 +0,0 @@
-import { useEffect, useRef, type MutableRefObject } from "react";
-
-import type { WaveformPhase } from "@/components/overlay/VoiceWaveform";
-import {
- ATTACK_TAU_S,
- COLUMN_MS,
- RELEASE_TAU_S,
- clamp01,
- ringValue,
-} from "@/components/overlay/voiceBars";
-import { cn } from "@/lib/utils";
-
-/**
- * The front page's waveform — the heart of the Jarvis bar.
- *
- * The overlay's `VoiceWaveform` is an SVG drawn for a small pill: a fixed
- * row of bars inside a fixed view box, and "at rest nothing animates". On
- * the front page the same drawing read as a thin dotted line lost in a big
- * card (maintainer, 2026-08-23: "sieht komisch aus"). This one is built for
- * the stage instead:
- *
- * - it FILLS its container — capsule count follows the width, capsule
- * height the height, on any window size and DPI;
- * - at rest it breathes: a slow, low travelling wave, so the bar reads as
- * alive-and-waiting rather than switched off (that is what the person
- * sees most of the time);
- * - while listening it is a TAPE: the newest microphone sample enters at
- * the right edge and the whole row travels left, on the overlay's own
- * attack/release and its own slower column cadence;
- * - while the assistant SPEAKS it is the same tape, fed by the level of
- * the audio actually leaving for the speaker — but only where this
- * device can measure that (see `outputLevelRef`);
- * - thinking, connecting, and speaking we cannot hear are a sweep; error
- * is a still red row.
- *
- * ## Why it scrolls (maintainer, 2026-08-28)
- *
- * This row used to mirror the level outwards from the centre, and that is
- * the one shape it must not have: mirroring draws every syllable TWICE, so
- * a sentence becomes a symmetric blob and nothing in it can be told apart.
- * Scrolling keeps one peak per syllable, travelling, which is what lets
- * somebody look at the bar and see the words they just said. `ringValue`
- * (components/overlay/voiceBars) is the shared reader for exactly this, so
- * the front page and the overlay pill now scroll the same way.
- *
- * ## The shape (maintainer, 2026-08-28)
- *
- * A silent column is a small round DOT; a column with signal blooms into a
- * wide capsule. Two readings, one path — `capsule()` puts the radius at half
- * the short side, so the dot and the capsule are the same rounded rectangle
- * at two sizes and nothing ever cross-fades between two drawings.
- *
- * Width and height do NOT move together, and that asymmetry is the whole
- * effect. `bloom()` widens the dot on a steep knee, so the faintest signal
- * already opens the column to its full stroke, while the height keeps
- * climbing linearly far past that point. The row therefore reads as dots
- * that OPEN and then stretch, rather than bars that get taller — which is
- * what makes it look like breath rather than a chart.
- *
- * The lit core is a single vertical gradient over the WHOLE canvas, built
- * once per resize rather than per capsule per frame. Every capsule is
- * centred on the same midline, so one gradient gives all of them the same
- * light: a short one sits entirely inside the bright middle, a tall one
- * reaches the soft ends. That is the depth cue — the row looks lit from its
- * own centre line instead of flatly filled.
- *
- * ## The value ramp (maintainer, 2026-08-28)
- *
- * No hue. A pastel ramp was tried here and rejected: the interface is black,
- * white and grey, and a coloured row read as a different product bolted onto
- * it. What the row needed was not colour but a GRADIENT, so it takes one
- * along the value scale instead — `--muted-foreground` at the old end of the
- * tape, `--primary` at the new one.
- *
- * That earns its place twice. It stops the row being one flat tone, and it
- * says something true: the newest sound is the brightest, and every syllable
- * dims as it travels left and ages out. Unmeasured phases stay flat
- * `--muted-foreground` — they never reach the bright end, because nothing
- * measured them.
- *
- * Both ends are existing theme tokens, so this introduces no colour
- * vocabulary of its own and follows light/dark for free: on paper the ramp
- * runs mid-grey to ink, the exact mirror of grey to white on charcoal.
- *
- * Canvas rather than DOM capsules: forty to sixty shapes repainted every
- * frame are cheap on a 2D context and would be layout work as elements.
- * Every colour is read from the theme tokens on the element itself, so the
- * drawing follows light/dark without a single literal. Reduced motion keeps the information (a level meter) and drops
- * the decoration (no breathing, no sweep, no scroll).
- */
-export function StageWaveform({
- levelRef,
- outputLevelRef,
- phase,
- className,
-}: {
- /** Normalised 0..1 microphone level, written by the audio callback. */
- levelRef: MutableRefObject<number>;
- /**
- * Normalised 0..1 level of the ASSISTANT's voice, or `null` where this
- * device cannot observe it (lib/voiceOutputLevel). Absent and `null` both
- * mean the same thing to the drawing: fall back to the sweep.
- */
- outputLevelRef?: { current: number | null };
- phase: WaveformPhase;
- className?: string;
-}) {
- const canvasRef = useRef<HTMLCanvasElement | null>(null);
- const phaseRef = useRef<WaveformPhase>(phase);
- phaseRef.current = phase;
- const outRef = useRef<{ current: number | null } | undefined>(outputLevelRef);
- outRef.current = outputLevelRef;
-
- useEffect(() => {
- const canvas = canvasRef.current;
- if (!canvas) return;
- const ctx = canvas.getContext("2d");
- if (!ctx) return;
-
- const reduced =
- typeof window.matchMedia === "function" &&
- window.matchMedia("(prefers-reduced-motion: reduce)").matches;
-
- // Geometry follows the box; re-measured on every resize.
- let width = 0;
- let height = 0;
- let span = 0;
- let dpr = 1;
- let count = 0;
-
- // Theme colours as raw `H S% L%` triples, so an alpha can be composed
- // into every gradient stop. Re-read once a second — a theme flip is
- // rare, a frame is not.
- let tokens = readTokens(canvas);
- let tokensAt = 0;
- let fills = buildFills(ctx, width, height, tokens);
-
- let history: number[] = [];
- let head = 0;
- let level = 0;
- let carryMs = 0;
- let peak = 0;
- let sweep = 0;
- let breath = 0;
- let last = performance.now();
- let raf = 0;
-
- const measure = () => {
- const rect = canvas.getBoundingClientRect();
- dpr = Math.max(1, window.devicePixelRatio || 1);
- width = Math.max(1, Math.floor(rect.width));
- height = Math.max(1, Math.floor(rect.height));
- canvas.width = Math.floor(width * dpr);
- canvas.height = Math.floor(height * dpr);
- ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
- // The tallest capsule stops short of the box: the row needs air above
- // and below or a loud syllable reads as a clipped block.
- span = Math.max(2, height * TALLEST - BAR_MIN);
- fills = buildFills(ctx, width, height, tokens);
- const next = Math.max(6, Math.floor((width + BAR_GAP) / ROW_PITCH));
- if (next !== count) {
- count = next;
- history = new Array<number>(count).fill(0);
- head = 0;
- }
- };
-
- /**
- * One frame. `shaped` is the 0..1 activity of each column — the single
- * input the geometry is derived from, so every phase describes WHAT it
- * has to say and the drawing stays one place.
- */
- const paint = (shaped: number[], alphas: number[], tint: string | CanvasGradient) => {
- ctx.clearRect(0, 0, width, height);
- // Pass 1 draws the capsules as a MASK: white, carrying only the
- // vertical light profile and each column's own opacity. Pass 2 (below)
- // pours the colour in through it. Two gradients for the whole frame
- // instead of one per capsule, and the hue ramp and the lit core stay
- // independent of each other.
- ctx.globalCompositeOperation = "source-over";
- ctx.fillStyle = fills.mask;
- // Columns sit on a fixed pitch and every capsule is drawn around its
- // column's CENTRE, so a blooming capsule grows outwards in both
- // directions instead of pushing the row sideways.
- const rowW = (count - 1) * ROW_PITCH + BAR_W;
- const cx0 = (width - rowW) / 2 + BAR_W / 2;
- const mid = height / 2;
- for (let i = 0; i < count; i += 1) {
- const t = count > 1 ? i / (count - 1) : 0.5;
- const v = clamp01(shaped[i] ?? 0);
- const h = Math.min(height, BAR_MIN + span * v);
- const w = DOT_W + (BAR_W - DOT_W) * bloom(v);
- // The rim taper is ALPHA ONLY, and narrow. It used to shrink the
- // capsules at both ends too, which on a scrolling row flattened
- // every syllable exactly as it entered — the row would swallow the
- // first thing you said. Fading it in instead keeps the measurement
- // intact and still lets the tape dissolve into the card.
- ctx.globalAlpha = (alphas[i] ?? 1) * edge(t);
- capsule(ctx, cx0 + i * ROW_PITCH - w / 2, mid - h / 2, w, h);
- }
- // Pass 2: colour, kept only where the mask is. `source-in` multiplies
- // the incoming alpha by what is already there, so every capsule keeps
- // the shape and the light it was just given and takes the ramp's hue
- // at its own position in the row.
- ctx.globalAlpha = 1;
- ctx.globalCompositeOperation = "source-in";
- ctx.fillStyle = tint;
- ctx.fillRect(0, 0, width, height);
- ctx.globalCompositeOperation = "source-over";
- };
-
- /** How present a column is: a quiet floor that the activity lifts. */
- const presence = (v: number) => DOT_ALPHA + (1 - DOT_ALPHA) * v;
-
- /**
- * Advance and draw the measured tape from one 0..1 level.
- *
- * Called for the microphone while listening and for the assistant's own
- * voice while it speaks, so the row stays ONE instrument reading whoever
- * currently holds the conversation — both are real measurements, which
- * is the only thing that entitles this drawing to look like a waveform.
- *
- * A column is a WINDOW, not an instant: it banks the loudest level seen
- * since the last one. Sampling the level at the column boundary instead
- * would drop a short consonant that happened to fall between two ticks.
- */
- const tape = (target: number, dt: number) => {
- const tau = target > level ? ATTACK_TAU_S : RELEASE_TAU_S;
- level += (target - level) * (1 - Math.exp(-dt / tau));
- peak = Math.max(peak, level);
- carryMs += dt * 1000;
- while (carryMs >= STAGE_COLUMN_MS) {
- carryMs -= STAGE_COLUMN_MS;
- history[head] = peak;
- head = (head + 1) % count;
- peak = level;
- }
- const shaped: number[] = new Array<number>(count);
- const alphas: number[] = new Array<number>(count);
- for (let i = 0; i < count; i += 1) {
- // `ringValue` reads the history oldest-first, so column 0 is the far
- // left and the last column is this instant: a syllable appears at
- // the right edge and walks out of the left. Reduced motion holds the
- // plain level instead — a meter, no travel.
- const raw = reduced ? level : clamp01(ringValue(history, head, i));
- // `LOUDNESS` is a DISPLAY curve, applied here and never to the
- // stored history: the meter behind it (lib/levelMeter) deliberately
- // spends most of its range on ordinary speech, so feeding it
- // straight into the height made every word slam the ceiling
- // (maintainer, 2026-08-28: it deflects far too much). Bending it
- // keeps the ORDER — louder is still taller — and gives a shout
- // somewhere left to go.
- const v = raw <= 0 ? 0 : raw ** LOUDNESS;
- shaped[i] = v;
- alphas[i] = presence(v);
- }
- paint(shaped, alphas, fills.wave);
- };
-
- const frame = (now: number) => {
- raf = requestAnimationFrame(frame);
- const dt = Math.min((now - last) / 1000, 0.1);
- last = now;
- if (now - tokensAt > 1000) {
- const next = readTokens(canvas);
- if (next.primary !== tokens.primary || next.muted !== tokens.muted) {
- tokens = next;
- fills = buildFills(ctx, width, height, tokens);
- }
- tokensAt = now;
- }
- const p = phaseRef.current;
- const shaped: number[] = new Array<number>(count);
- const alphas: number[] = new Array<number>(count);
-
- if (p === "error") {
- shaped.fill(0);
- alphas.fill(0.9);
- paint(shaped, alphas, fills.error);
- return;
- }
-
- if (p === "idle") {
- // Breathing: a slow wave travelling across the row. Deliberately
- // below the bloom knee for most of its arc, so the resting bar stays
- // a row of DOTS that shimmers rather than a waveform of something
- // nobody said.
- breath += dt * (reduced ? 0 : 0.85);
- for (let i = 0; i < count; i += 1) {
- const t = i / Math.max(1, count - 1);
- const wave = reduced ? 0 : 0.5 + 0.5 * Math.sin(breath * 2 + t * 6.283 * 1.2);
- const v = IDLE_SWELL * wave * rim(t);
- shaped[i] = v;
- alphas[i] = presence(0.34 * wave * rim(t));
- }
- paint(shaped, alphas, fills.muted);
- return;
- }
-
- if (p === "connecting") {
- breath += dt * 2.4;
- const pulse = reduced ? 0.5 : 0.5 + 0.5 * Math.sin(breath);
- for (let i = 0; i < count; i += 1) {
- const t = i / Math.max(1, count - 1);
- const v = 0.16 * pulse * rim(t);
- shaped[i] = v;
- alphas[i] = presence(0.5 * pulse * rim(t));
- }
- paint(shaped, alphas, fills.muted);
- return;
- }
-
- if (p === "speaking") {
- // The assistant's own voice, when this device can actually hear it:
- // the browser realtime surface plays the reply itself, so the
- // playback worklet measures the very samples going to the speaker.
- // When the backend speaks through the OS device the page sees
- // nothing, `out` is null, and the sweep below takes over rather than
- // inventing a waveform.
- const out = outRef.current?.current;
- if (typeof out === "number") {
- tape(clamp01(out), dt);
- return;
- }
- }
-
- if (p === "working" || p === "speaking") {
- // A sweep: a bright band travelling the row right to left, the
- // same direction the measured tape runs, faster when speaking.
- const period = p === "speaking" ? 1.1 : 1.8;
- sweep = reduced ? 0.5 : (sweep + dt / period) % 1;
- for (let i = 0; i < count; i += 1) {
- const t = i / Math.max(1, count - 1);
- const d = Math.abs(((t + sweep + 1.5) % 1) - 0.5); // 0 at the band
- const gain = reduced ? 0.4 : Math.max(0, 1 - d / 0.22);
- const base = p === "speaking" ? 0.12 : 0.08;
- const v = (base + 0.62 * gain) * rim(t);
- shaped[i] = v;
- alphas[i] = presence(Math.min(1, 0.25 + gain) * rim(t));
- }
- paint(shaped, alphas, fills.muted);
- return;
- }
-
- // listening, and speaking wherever the assistant's voice is observable:
- // a measured tape running right to left.
- tape(clamp01(levelRef.current), dt);
- };
-
- measure();
- const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(measure) : null;
- ro?.observe(canvas);
- raf = requestAnimationFrame(frame);
- return () => {
- cancelAnimationFrame(raf);
- ro?.disconnect();
- };
- }, [levelRef]);
-
- return (
- <canvas
- ref={canvasRef}
- aria-hidden
- data-testid="stage-waveform"
- data-phase={phase}
- className={cn("block h-full w-full", className)}
- />
- );
-}
-
-/** Column pitch, and the two widths a column lives between: a resting DOT
- * and the full capsule stroke it blooms into. */
-const DOT_W = 4;
-const BAR_W = 13;
-const BAR_GAP = 2;
-const ROW_PITCH = BAR_W + BAR_GAP;
-
-/** Height of a silent column — a hair taller than the dot is wide, so the
- * rest state is a round dot rather than a dash. */
-const BAR_MIN = 5;
-
-/** Fraction of the box the loudest capsule may take. Leaves real headroom
- * on purpose: a bar that a normal sentence already fills has nothing left
- * to say when somebody raises their voice. */
-const TALLEST = 0.62;
-
-/** Display exponent on the measured level (see `tape`). Above 1, so an
- * ordinary word sits around half the box and the top belongs to a shout. */
-const LOUDNESS = 1.6;
-
-/** How much time one column of the tape covers.
- *
- * Twice the overlay pill's cadence, and derived from it so the relationship
- * stays visible: the small pill is a glance, this row is meant to be READ,
- * and at 33 ms the whole width held barely a second and a half — a single
- * word smeared across a third of the bar and left again before you had
- * looked at it (maintainer, 2026-08-28: run it a little slower). At 66 ms
- * a word is a compact group of capsules and the row holds a whole sentence.
- * Nothing is thrown away to get there: each column banks the PEAK of its
- * window. */
-const STAGE_COLUMN_MS = COLUMN_MS * 2;
-
-/** How present a resting dot is at the centre of the row. Visible as a row,
- * quiet enough that the measured part of the drawing is the part that
- * reads. */
-const DOT_ALPHA = 0.3;
-
-/** How much of each rim tapers back into plain dots, as a row fraction.
- * The silhouette we are after: activity in the middle, dots at the edges. */
-const RIM = 0.12;
-
-/** Activity at which a column has fully opened to the capsule stroke. Low
- * on purpose — the width is a "there is signal here" cue, the height is the
- * measurement. */
-const BLOOM_KNEE = 0.14;
-
-/** Idle swell, kept under the bloom knee so resting stays dotty. */
-const IDLE_SWELL = 0.05;
-
-/** How narrow the alpha fade at each end of the tape is, as a row fraction.
- * Small on purpose: the right edge is where a syllable ARRIVES, so it has
- * to be readable within a couple of columns. */
-const EDGE = 0.06;
-
-/** Smooth 0..1 rim envelope — 0 at both edges, 1 from `RIM` inwards. Shapes
- * the DECORATIVE phases, which draw a silhouette rather than a measurement. */
-function rim(t: number): number {
- const d = Math.min(t, 1 - t) / RIM;
- return d >= 1 ? 1 : d * d * (3 - 2 * d);
-}
-
-/** The alpha fade every phase gets at both ends, so the row dissolves into
- * the card instead of stopping at a hard column. */
-function edge(t: number): number {
- const d = Math.min(t, 1 - t) / EDGE;
- return d >= 1 ? 1 : d * d * (3 - 2 * d);
-}
-
-/** Dot → capsule width, on a steep knee (see the component's note). */
-function bloom(v: number): number {
- const d = v / BLOOM_KNEE;
- return d >= 1 ? 1 : d * d * (3 - 2 * d);
-}
-
-/** A capsule: a rectangle whose radius is half its SHORT side, so the same
- * call draws a tall stroke, a circle and a squat dot. */
-function capsule(ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number) {
- const r = Math.min(w / 2, h / 2);
- ctx.beginPath();
- ctx.moveTo(x + r, y);
- ctx.lineTo(x + w - r, y);
- ctx.arc(x + w - r, y + r, r, -Math.PI / 2, 0);
- ctx.lineTo(x + w, y + h - r);
- ctx.arc(x + w - r, y + h - r, r, 0, Math.PI / 2);
- ctx.lineTo(x + r, y + h);
- ctx.arc(x + r, y + h - r, r, Math.PI / 2, Math.PI);
- ctx.lineTo(x, y + r);
- ctx.arc(x + r, y + r, r, Math.PI, (3 * Math.PI) / 2);
- ctx.closePath();
- ctx.fill();
-}
-
-type Tokens = { primary: string; muted: string; error: string };
-type Fills = {
- /** Vertical light profile, colourless — the shape mask (see `paint`). */
- mask: string | CanvasGradient;
- /** The row's hue ramp, left to right. */
- wave: string | CanvasGradient;
- muted: string;
- error: string;
-};
-
-/**
- * One vertical gradient per channel, spanning the whole canvas.
- *
- * All capsules share the midline, so a single gradient lights the row from
- * its own centre: full accent where the line runs, half-strength at the top
- * and bottom edges. A short capsule therefore sits entirely in the bright
- * band and a tall one fades towards its caps — the same depth cue the
- * reference gets from a violet-to-blue ramp, spelled in value because the
- * brand no longer carries a hue.
- */
-function buildFills(
- ctx: CanvasRenderingContext2D,
- width: number,
- height: number,
- tokens: Tokens,
-): Fills {
- let mask: string | CanvasGradient = "#fff";
- if (height > 1) {
- const g = ctx.createLinearGradient(0, 0, 0, height);
- g.addColorStop(0, `hsl(0 0% 100% / ${CAP_ALPHA})`);
- g.addColorStop(0.34, `hsl(0 0% 100% / ${SHOULDER_ALPHA})`);
- g.addColorStop(0.5, "hsl(0 0% 100%)");
- g.addColorStop(0.66, `hsl(0 0% 100% / ${SHOULDER_ALPHA})`);
- g.addColorStop(1, `hsl(0 0% 100% / ${CAP_ALPHA})`);
- mask = g;
- }
- let wave: string | CanvasGradient = `hsl(${tokens.primary})`;
- if (width > 1) {
- // Across the MIDDLE of the row, not its full width. A canvas gradient
- // clamps to its end colours outside the span, so the quiet rims stay
- // solid and the part a conversation actually occupies gets the whole
- // ramp. Anchored edge to edge, the centre only ever sampled the middle
- // of the gradient and the row read as one flat tone.
- const g = ctx.createLinearGradient(width * RAMP_INSET, 0, width * (1 - RAMP_INSET), 0);
- g.addColorStop(0, `hsl(${tokens.muted})`);
- g.addColorStop(1, `hsl(${tokens.primary})`);
- wave = g;
- }
- return { mask, wave, muted: `hsl(${tokens.muted})`, error: `hsl(${tokens.error})` };
-}
-
-/** Where the hue ramp starts and ends, as a fraction of the row. */
-const RAMP_INSET = 0.22;
-
-/** Strength of the lit core at the caps and at the shoulders. */
-const CAP_ALPHA = 0.45;
-const SHOULDER_ALPHA = 0.82;
-
-/**
- * The theme's channels as raw `H S% L%` triples (index.css); `hsl(H S% L% /
- * a)` is what the CSS side builds from them too, and keeping the triple
- * rather than a finished colour is what lets every gradient stop carry its
- * own alpha.
- */
-function readTokens(el: HTMLElement): Tokens {
- const style = getComputedStyle(el);
- const token = (name: string, fallback: string) => {
- const raw = style.getPropertyValue(name).trim();
- return raw || fallback;
- };
- return {
- primary: token("--primary", "0 0% 100%"),
- muted: token("--muted-foreground", "47 5% 59%"),
- error: token("--destructive", "0 84% 60%"),
- };
-}
diff --git a/jarvis/ui/web/frontend/src/components/home/VoiceComposer.test.tsx b/jarvis/ui/web/frontend/src/components/home/VoiceComposer.test.tsx
new file mode 100644
index 0000000000..552884c260
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/home/VoiceComposer.test.tsx
@@ -0,0 +1,54 @@
+import { cleanup, fireEvent, render, screen } from "@testing-library/react";
+import { afterEach, describe, expect, it, vi } from "vitest";
+
+import { VoiceComposer } from "@/components/home/VoiceComposer";
+
+const call = { active: false, busy: false, connecting: false, toggleCall: vi.fn() };
+
+vi.mock("@/components/agentic/useVoiceCall", () => ({ useVoiceCall: () => call }));
+vi.mock("@/hooks/useVoiceReadiness", () => ({ useVoiceReadiness: () => ({ connected: true }) }));
+vi.mock("@/hooks/useVoiceEngineDisplay", () => ({
+ useVoiceEngineDisplay: () => ({ providerLabel: "OpenAI Realtime", model: "gpt-realtime" }),
+}));
+vi.mock("@/hooks/usePromptMode", () => ({
+ usePromptMode: () => ({ enabled: null, busy: false, toggle: async () => {} }),
+}));
+
+afterEach(() => {
+ cleanup();
+ call.active = false;
+ call.toggleCall.mockReset();
+});
+
+describe("VoiceComposer", () => {
+ it("offers Start while no call runs and says what to do", () => {
+ render(<VoiceComposer hint="Press Start to talk" />);
+ expect(screen.getByTestId("voice-hint").textContent).toBe("Press Start to talk");
+ fireEvent.click(screen.getByTestId("voice-call-start"));
+ expect(call.toggleCall).toHaveBeenCalledTimes(1);
+ expect(screen.queryByTestId("voice-call-stop")).toBeNull();
+ });
+
+ it("turns the control into Stop while a call is open", () => {
+ call.active = true;
+ render(<VoiceComposer hint="Speaking…" />);
+ fireEvent.click(screen.getByTestId("voice-call-stop"));
+ expect(call.toggleCall).toHaveBeenCalledTimes(1);
+ expect(screen.queryByTestId("voice-call-start")).toBeNull();
+ });
+
+ it("shows the way back to typing only when the host has one", () => {
+ render(<VoiceComposer hint="" />);
+ expect(screen.queryByTestId("voice-mode-exit")).toBeNull();
+ cleanup();
+ const onExit = vi.fn();
+ render(<VoiceComposer hint="" onExit={onExit} />);
+ fireEvent.click(screen.getByTestId("voice-mode-exit"));
+ expect(onExit).toHaveBeenCalledTimes(1);
+ });
+
+ it("names the voice engine under the card", () => {
+ render(<VoiceComposer hint="" />);
+ expect(screen.getByTestId("voice-engine").textContent).toContain("OpenAI Realtime");
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/components/home/VoiceComposer.tsx b/jarvis/ui/web/frontend/src/components/home/VoiceComposer.tsx
new file mode 100644
index 0000000000..d24b1a555b
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/home/VoiceComposer.tsx
@@ -0,0 +1,167 @@
+import { useCallback } from "react";
+import { Keyboard, Loader2, Mic, Sparkles } from "lucide-react";
+
+import { useEventStore } from "@/store/events";
+import { useVoiceCall } from "@/components/agentic/useVoiceCall";
+import { useVoiceReadiness } from "@/hooks/useVoiceReadiness";
+import { useVoiceEngineDisplay } from "@/hooks/useVoiceEngineDisplay";
+import { usePromptMode } from "@/hooks/usePromptMode";
+import { fill, useT } from "@/i18n";
+import { cn } from "@/lib/utils";
+
+/**
+ * Voice mode's composer — the chat composer's card, spoken instead of typed
+ * (2026-10-01, after the Claude app's voice mode).
+ *
+ * Same shape as the front page's typed composer (components/agentchat/
+ * AgentComposer, minimal): one rounded row. Where the text would be, the
+ * line says what is happening ("Listening…", "Speaking…") or what to do; on
+ * the right sit Prompt Mode and the one round control — Start while no call
+ * runs, a lit "Stop" with three breathing dots while one does. The way back
+ * to the keyboard takes the "+" slot on the left, and only where the page
+ * that hosts the stage has a typed half to go back to. Under the card, the
+ * voice engine in small print, the way the chat names its model; a click
+ * opens the provider settings.
+ *
+ * Start and Stop go through the one start/stop path every voice surface
+ * shares (useVoiceCall), so there is still exactly one way a call begins.
+ */
+export function VoiceComposer({ hint, onExit }: { hint: string; onExit?: () => void }) {
+ const t = useT();
+ const assistantName = useEventStore((s) => s.assistantName);
+ const setActiveSection = useEventStore((s) => s.setActiveSection);
+ const pushToast = useEventStore((s) => s.pushToast);
+ const { connected } = useVoiceReadiness();
+ const engine = useVoiceEngineDisplay();
+ const promptMode = usePromptMode();
+ const { active, busy, connecting, toggleCall } = useVoiceCall();
+
+ const onCall = useCallback(() => {
+ if (busy || connecting) return;
+ void toggleCall();
+ }, [busy, connecting, toggleCall]);
+
+ const onPromptMode = useCallback(() => {
+ promptMode.toggle().catch((err: unknown) => {
+ // The backend's own sentence names the blocker (a config file that
+ // could not be written); ours would send the user to the wrong place.
+ const detail = err instanceof Error && err.message ? err.message : "";
+ pushToast("error", detail || t("home.prompt_mode_failed"));
+ });
+ }, [promptMode, pushToast, t]);
+
+ const promptModeTitle =
+ promptMode.enabled === true ? t("home.prompt_mode_on") : t("home.prompt_mode_off");
+ const live = active || connecting;
+
+ return (
+ <div className="flex flex-col gap-1.5" data-testid="voice-composer" data-active={active || undefined}>
+ <div
+ data-tour="voice-bar"
+ className="flex items-center gap-1 rounded-[22px] border border-border bg-card px-2.5 py-2.5 shadow-rim">
+ {onExit && (
+ <button
+ type="button"
+ onClick={onExit}
+ data-testid="voice-mode-exit"
+ aria-label={t("assistant_chat.voice_exit")}
+ title={fill(t("assistant_chat.voice_exit_hint"), { name: assistantName })}
+ className="inline-flex h-8 w-8 shrink-0 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"
+ >
+ <Keyboard className="h-4 w-4" aria-hidden />
+ </button>
+ )}
+ <span
+ className="min-w-0 flex-1 truncate px-1.5 text-reading text-muted-foreground"
+ data-testid="voice-hint"
+ aria-live="polite"
+ >
+ {hint}
+ </span>
+ {promptMode.enabled !== null && (
+ <button
+ type="button"
+ onClick={onPromptMode}
+ disabled={promptMode.busy}
+ aria-pressed={promptMode.enabled}
+ aria-label={promptModeTitle}
+ title={promptModeTitle}
+ data-testid="voice-prompt-mode"
+ data-on={promptMode.enabled || undefined}
+ className={cn(
+ "inline-flex h-8 shrink-0 items-center gap-1.5 rounded-full text-xs font-medium transition-colors disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ promptMode.enabled
+ ? "bg-accent-soft px-3 text-accent"
+ : "w-8 justify-center text-muted-foreground hover:bg-secondary hover:text-foreground",
+ )}
+ >
+ {promptMode.busy ? (
+ <Loader2 className="h-4 w-4 animate-spin" aria-hidden />
+ ) : (
+ <Sparkles className="h-4 w-4" aria-hidden />
+ )}
+ {promptMode.enabled && t("home.prompt_mode_pill")}
+ </button>
+ )}
+ {live ? (
+ <button
+ type="button"
+ onClick={onCall}
+ disabled={busy || connecting}
+ aria-label={t("home.bar_stop")}
+ title={t("home.bar_stop")}
+ data-testid="voice-call-stop"
+ className="ml-0.5 inline-flex h-8 shrink-0 items-center gap-2 rounded-full bg-accent-soft px-3 text-sm font-medium text-accent transition-colors hover:bg-accent/20 disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ <BreathingDots />
+ {t("assistant_chat.voice_stop")}
+ </button>
+ ) : (
+ <button
+ type="button"
+ onClick={onCall}
+ disabled={busy || !connected}
+ aria-label={t("home.bar_start")}
+ title={t("home.bar_start")}
+ data-testid="voice-call-start"
+ className="ml-0.5 inline-flex h-8 shrink-0 items-center gap-1.5 rounded-full bg-foreground px-3 text-sm font-medium text-background transition-colors hover:bg-foreground/85 disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ {busy ? (
+ <Loader2 className="h-4 w-4 animate-spin" aria-hidden />
+ ) : (
+ <Mic className="h-4 w-4" aria-hidden />
+ )}
+ {t("assistant_chat.voice_start")}
+ </button>
+ )}
+ </div>
+ <div className="flex justify-end px-3">
+ <button
+ type="button"
+ onClick={() => setActiveSection("apikeys")}
+ title={t("home.model_hint")}
+ data-testid="voice-engine"
+ className="inline-flex max-w-[320px] items-center gap-1.5 rounded-md px-1 text-xs text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ <span className="truncate font-medium text-foreground/80">{engine.providerLabel}</span>
+ {engine.model && <span className="truncate">{engine.model}</span>}
+ </button>
+ </div>
+ </div>
+ );
+}
+
+/** Three dots breathing one after another — a call is open. */
+function BreathingDots() {
+ return (
+ <span className="inline-flex items-center gap-[3px]" aria-hidden>
+ {[0, 200, 400].map((delay) => (
+ <span
+ key={delay}
+ className="h-1.5 w-1.5 rounded-full bg-current animate-pulse motion-reduce:animate-none"
+ style={{ animationDelay: `${delay}ms` }}
+ />
+ ))}
+ </span>
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/components/home/VoiceGlow.tsx b/jarvis/ui/web/frontend/src/components/home/VoiceGlow.tsx
new file mode 100644
index 0000000000..298f836bf9
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/home/VoiceGlow.tsx
@@ -0,0 +1,62 @@
+import { useEffect, useRef } from "react";
+
+import { voiceInputLevelRef } from "@/lib/voiceInputLevel";
+import { voiceOutputLevelRef } from "@/lib/voiceOutputLevel";
+
+/**
+ * The soft light behind voice mode's composer — the Claude app's voice glow,
+ * in this theme's one signal hue.
+ *
+ * A wide ellipse of accent light rising from the bottom edge, behind the
+ * composer. At rest it is a faint wash; while a call runs it swells with
+ * whichever voice is louder, yours (the microphone level) or the
+ * assistant's (the playback level), so the page visibly breathes with the
+ * conversation. The level refs are read on animation frames — no React
+ * state, no re-render per frame — and only while a call is open. Reduced
+ * motion keeps the light and drops the movement.
+ *
+ * Purely decorative: no pointer events, hidden from screen readers.
+ */
+export function VoiceGlow({ active }: { active: boolean }) {
+ const ref = useRef<HTMLDivElement | null>(null);
+
+ useEffect(() => {
+ const el = ref.current;
+ if (!el) return;
+ const reduced =
+ typeof window.matchMedia === "function" &&
+ window.matchMedia("(prefers-reduced-motion: reduce)").matches;
+ if (!active || reduced || typeof requestAnimationFrame === "undefined") {
+ el.style.opacity = active ? "0.75" : "0.35";
+ el.style.transform = "translateX(-50%) scale(1)";
+ return;
+ }
+ let level = 0;
+ let frame = 0;
+ const tick = () => {
+ const target = Math.max(voiceOutputLevelRef.current ?? 0, voiceInputLevelRef.current);
+ // Rise fast, fall slowly — a voice, not a meter.
+ level += (target - level) * (target > level ? 0.35 : 0.08);
+ el.style.opacity = String(0.55 + level * 0.45);
+ el.style.transform = `translateX(-50%) scale(${1 + level * 0.18})`;
+ frame = requestAnimationFrame(tick);
+ };
+ frame = requestAnimationFrame(tick);
+ return () => cancelAnimationFrame(frame);
+ }, [active]);
+
+ return (
+ <div
+ ref={ref}
+ aria-hidden
+ data-testid="voice-glow"
+ className="pointer-events-none absolute bottom-0 left-1/2 h-[34vh] w-[min(760px,90%)] origin-bottom transition-opacity duration-500"
+ style={{
+ transform: "translateX(-50%)",
+ opacity: 0.35,
+ background:
+ "radial-gradient(ellipse 50% 70% at 50% 100%, rgb(var(--accent-rgb) / 0.32), rgb(var(--accent-rgb) / 0.10) 45%, transparent 75%)",
+ }}
+ />
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/components/home/VoiceStage.test.tsx b/jarvis/ui/web/frontend/src/components/home/VoiceStage.test.tsx
index 30532cf82d..7d04c5b340 100644
--- a/jarvis/ui/web/frontend/src/components/home/VoiceStage.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/home/VoiceStage.test.tsx
@@ -2,9 +2,8 @@ import { act, cleanup, fireEvent, render as rtlRender, screen } from "@testing-l
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { afterEach, describe, expect, it, vi } from "vitest";
-import { VoiceStage, hintFor, waveformPhase } from "@/components/home/VoiceStage";
+import { VoiceStage, hintFor } from "@/components/home/VoiceStage";
import { NEAR_END_PX, isNearEnd } from "@/hooks/useStickToBottom";
-import { stateKey } from "@/components/home/JarvisBar";
import { greetingKey } from "@/components/home/Greeting";
import { useHomeStore } from "@/store/home";
import { useEventStore } from "@/store/events";
@@ -12,14 +11,11 @@ import type { TranscriptLine } from "@/lib/homeTranscript";
const t = (key: string) => key;
-// The bar owns a canvas waveform and two hooks of its own; the stage's
+// The composer owns hooks of its own (engine, Prompt Mode); the stage's
// scrolling is what these tests are about, so it stands in as a marker.
-vi.mock("@/components/home/JarvisBar", async () => {
- const actual = await vi.importActual<typeof import("@/components/home/JarvisBar")>(
- "@/components/home/JarvisBar",
- );
- return { ...actual, JarvisBar: () => <div data-testid="jarvis-bar" /> };
-});
+vi.mock("@/components/home/VoiceComposer", () => ({
+ VoiceComposer: ({ hint }: { hint: string }) => <div data-testid="voice-composer">{hint}</div>,
+}));
vi.mock("@/components/agentic/useVoiceCall", () => ({
useVoiceCall: () => ({ active: false, busy: false, connecting: false, toggleCall: () => {} }),
}));
@@ -151,7 +147,7 @@ describe("VoiceStage transcript", () => {
render();
expect(screen.getByTestId("voice-stage").dataset.empty).toBe("true");
expect(document.querySelector("[data-radix-scroll-area-viewport]")).toBeNull();
- expect(screen.getByTestId("jarvis-bar")).toBeTruthy();
+ expect(screen.getByTestId("voice-composer")).toBeTruthy();
});
it("shows the words still being said under the finished ones", () => {
@@ -176,15 +172,6 @@ describe("VoiceStage helpers", () => {
expect(isNearEnd(0, 100, 400)).toBe(true);
});
- 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");
@@ -208,12 +195,3 @@ describe("VoiceStage helpers", () => {
expect(greetingKey(21)).toBe("home.greeting_evening");
});
});
-
-describe("JarvisBar state word", () => {
- it("says offline before anything else, connecting over a stale state", () => {
- expect(stateKey("speaking", false, false)).toBe("offline");
- expect(stateKey("idle", true, true)).toBe("connecting");
- expect(stateKey("listening", false, true)).toBe("listening");
- expect(stateKey("speaking", false, true)).toBe("speaking");
- });
-});
diff --git a/jarvis/ui/web/frontend/src/components/home/VoiceStage.tsx b/jarvis/ui/web/frontend/src/components/home/VoiceStage.tsx
index 9b793f7de1..3757de3cc2 100644
--- a/jarvis/ui/web/frontend/src/components/home/VoiceStage.tsx
+++ b/jarvis/ui/web/frontend/src/components/home/VoiceStage.tsx
@@ -2,7 +2,6 @@ import { useLayoutEffect, useMemo } from "react";
import { useEventStore, type VoiceState } from "@/store/events";
import { useHomeStore } from "@/store/home";
-import type { WaveformPhase } from "@/components/overlay/VoiceWaveform";
import { useVoiceCall } from "@/components/agentic/useVoiceCall";
import { useVoiceReadiness } from "@/hooks/useVoiceReadiness";
import { useStickToBottom } from "@/hooks/useStickToBottom";
@@ -12,22 +11,30 @@ import { cn } from "@/lib/utils";
import { ScrollArea } from "@/components/ui/scroll-area";
import { ScrollToEndButton } from "@/components/ui/scroll-to-end-button";
import { Greeting } from "@/components/home/Greeting";
-import { JarvisBar } from "@/components/home/JarvisBar";
+import { GigiMark } from "@/components/GigiMark";
+import { VoiceComposer } from "@/components/home/VoiceComposer";
+import { VoiceGlow } from "@/components/home/VoiceGlow";
import { TurnSteps, traceWorthShowing } from "@/components/home/TurnSteps";
import { traceModel } from "@/lib/thinkingSteps";
/**
- * The voice stage — what the front page opens on.
+ * The voice stage — the front page's chat, spoken (2026-10-01, after the
+ * Claude app's voice mode).
*
- * Empty, it is one centred column: the greeting, 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.
+ * It looks like the chat it lives in, not like a separate page: the same
+ * column, your words in soft bubbles on the right (italic, because they were
+ * heard rather than typed), the answers as plain text on the left, and at
+ * the bottom a composer-shaped card (components/home/VoiceComposer) that
+ * says what is happening and carries Start / Stop. Behind it a soft light
+ * rises from the bottom edge and breathes with the voices
+ * (components/home/VoiceGlow); while the assistant thinks or speaks, its
+ * mark pulses under the last line. `onExit`, where the host page has a typed
+ * half, puts the way back to the keyboard into the composer.
*
- * Once anything has been said the page becomes a document, the way the chat
- * stage next door already is: the whole conversation scrolls in its own
- * viewport and the bar docks to the bottom. WHOLE, not a window onto the
+ * Empty, it is one centred column: the greeting and the voice composer.
+ * Once anything has been said the page becomes a document: the whole
+ * conversation scrolls in its own viewport and the composer docks to the
+ * bottom. WHOLE, not a window onto the
* last few turns — until 2026-08-24 the lane rendered only the last 8 lines,
* so anything that scrolled off was gone from the DOM and could not be
* scrolled back to. The lane reads the home store's transcript
@@ -44,7 +51,7 @@ import { traceModel } from "@/lib/thinkingSteps";
* button over the bar takes you back. Nothing yanks the page out from under
* someone mid-sentence.
*/
-export function VoiceStage() {
+export function VoiceStage({ onExit }: { onExit?: () => void } = {}) {
const t = useT();
const assistantName = useEventStore((s) => s.assistantName);
const voiceState = useEventStore((s) => s.voiceState);
@@ -53,7 +60,7 @@ export function VoiceStage() {
const transcription = useEventStore((s) => s.transcription);
const transcriptionFinal = useEventStore((s) => s.transcriptionFinal);
const { connected, warming } = useVoiceReadiness();
- const { connecting } = useVoiceCall();
+ const { active, connecting } = useVoiceCall();
const { config: wakeConfig } = useWakeWord();
const wakePhrase = wakeConfig?.phrase.trim() || "";
@@ -80,19 +87,19 @@ export function VoiceStage() {
const { rootRef, contentRef, atEnd, jumpToEnd, follow } = useStickToBottom();
useLayoutEffect(follow, [follow, lines, liveLine, liveAnswer]);
- const phase = waveformPhase(voiceState, connected);
const hint = hintFor({ connected, warming, connecting, voiceState, wakePhrase, t });
if (!hasLines) {
return (
<div
- className="flex min-h-0 flex-1 flex-col items-center overflow-hidden"
+ className="relative flex min-h-0 flex-1 flex-col items-center overflow-hidden"
data-testid="voice-stage"
data-empty="true"
>
- <div className="flex w-full max-w-[760px] flex-1 flex-col justify-center gap-8 px-6 pb-14">
+ <VoiceGlow active={active} />
+ <div className="relative flex w-full max-w-[680px] flex-1 flex-col justify-center gap-7 px-6 pb-[14vh]">
<Greeting subtitle={t("home.voice_subtitle")} />
- <JarvisBar phase={phase} hint={hint} />
+ <VoiceComposer hint={hint} onExit={onExit} />
</div>
</div>
);
@@ -100,18 +107,17 @@ export function VoiceStage() {
return (
<div
- className="flex min-h-0 flex-1 flex-col items-center overflow-hidden"
+ className="relative flex min-h-0 flex-1 flex-col items-center overflow-hidden"
data-testid="voice-stage"
data-empty="false"
>
- <ScrollArea ref={rootRef} className="min-h-0 w-full flex-1" data-testid="voice-transcript">
+ <VoiceGlow active={active} />
+ <ScrollArea ref={rootRef} className="relative min-h-0 w-full flex-1" data-testid="voice-transcript">
<div
ref={contentRef}
- className="mx-auto flex w-full max-w-[760px] flex-col gap-3 px-6 pb-4 pt-6"
+ className="mx-auto flex w-full max-w-[720px] flex-col gap-6 px-6 pb-6 pt-8"
aria-live="polite"
>
- <Greeting subtitle={t("home.voice_subtitle")} muted />
- <div className="h-2 shrink-0" aria-hidden />
{lines.map((m) =>
m.who === "steps" ? (
<div key={m.id} className="max-w-[85%] pl-1" data-testid="transcript-steps">
@@ -135,12 +141,17 @@ export function VoiceStage() {
)}
{liveLine && <TranscriptLine who={t("home.transcript_you")} text={liveLine} user live />}
{liveAnswer && <TranscriptLine who={assistantName} text={liveAnswer} user={false} live />}
+ {active && (voiceState === "thinking" || voiceState === "speaking") && (
+ <div className="pl-0.5" data-testid="voice-turn-indicator" aria-hidden>
+ <GigiMark size={22} className="rounded-md animate-pulse motion-reduce:animate-none" />
+ </div>
+ )}
</div>
</ScrollArea>
- <div className="relative w-full max-w-[760px] px-6 pb-6 pt-2">
+ <div className="relative w-full max-w-[720px] px-6 pb-4 pt-2">
{!atEnd && <ScrollToEndButton onClick={jumpToEnd} testId="voice-scroll-end" />}
- <JarvisBar phase={phase} hint={hint} />
+ <VoiceComposer hint={hint} onExit={onExit} />
</div>
</div>
);
@@ -149,7 +160,8 @@ export function VoiceStage() {
/**
* One line of the lane, drawn the way the chat draws a turn so voice mode
* reads like the chat it lives in: your words in a soft bubble on the
- * right, the assistant's as plain text on the left. A LIVE line (words still being said, an
+ * right — italic, because they were heard — the assistant's as plain text
+ * on the left. 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.
@@ -174,9 +186,9 @@ function TranscriptLine({
<span className="sr-only">{who}: </span>
<span
className={cn(
- "max-w-[80%] whitespace-pre-wrap text-lg leading-snug",
- user ? "jarvis-user-bubble rounded-[20px] px-4 py-2.5" : "py-1 text-foreground",
- live && "italic opacity-70",
+ "max-w-[80%] whitespace-pre-wrap text-reading",
+ user ? "jarvis-user-bubble rounded-[20px] px-4 py-2.5 italic" : "text-foreground",
+ live && (user ? "opacity-70" : "text-muted-foreground"),
)}
>
{text}
@@ -191,25 +203,7 @@ function TranscriptLine({
);
}
-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. */
+/** The voice composer's line: what to do, or what is happening. */
export function hintFor({
connected,
warming,
diff --git a/jarvis/ui/web/frontend/src/components/society/chat/AgentChatPanel.switch.test.tsx b/jarvis/ui/web/frontend/src/components/society/chat/AgentChatPanel.switch.test.tsx
index de5bc5df47..6efa443ba3 100644
--- a/jarvis/ui/web/frontend/src/components/society/chat/AgentChatPanel.switch.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/chat/AgentChatPanel.switch.test.tsx
@@ -21,7 +21,7 @@ import * as cardData from "../cardData";
vi.mock("@/i18n", () => ({ useT: () => (key: string) => key, fill: (text: string) => text }));
vi.mock("./AgentModelPicker", () => ({ AgentModelPicker: () => null }));
-vi.mock("@/components/home/JarvisBar", () => ({ JarvisBar: () => <div data-testid="jarvis-bar" /> }));
+vi.mock("@/components/home/VoiceComposer", () => ({ VoiceComposer: () => <div data-testid="voice-composer" /> }));
vi.mock("@/components/home/Greeting", () => ({ Greeting: () => <div>Greeting</div> }));
vi.mock("@/components/agentic/useVoiceCall", () => ({ useVoiceCall: () => ({ connecting: false }) }));
vi.mock("@/hooks/useVoiceReadiness", () => ({ useVoiceReadiness: () => ({ connected: true, warming: false }) }));
@@ -220,7 +220,7 @@ it("reads archived calls on the actual voice stage and returns there fresh after
expect(await screen.findByText("Archived question")).toBeTruthy();
expect(screen.getByText("Archived answer")).toBeTruthy();
expect(screen.getByTestId("society-chat").getAttribute("data-mode")).toBe("voice");
- expect(screen.getByTestId("jarvis-bar")).toBeTruthy();
+ expect(screen.getByTestId("voice-composer")).toBeTruthy();
expect(screen.queryByTestId("voice-thread-stage")).toBeNull();
fireEvent.click(screen.getByTestId("society-jarvis-mode-chat"));
fireEvent.click(screen.getByTestId("society-jarvis-mode-voice"));
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index 2691b7392f..f4887ee17a 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -641,21 +641,21 @@
"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.",
+ "voice_subtitle": "Sag dein Wake‑Wort oder drück auf Start — die Unterhaltung erscheint hier.",
"transcript_you": "Du",
"transcript_to_end": "Zum Neuesten springen",
- "hint_idle": "Sag „{wake}“ oder tippe auf die Leiste",
- "hint_idle_nowake": "Tippe auf die Leiste, um zu starten",
+ "hint_idle": "Sag „{wake}“ oder drück auf Start",
+ "hint_idle_nowake": "Drück auf Start, um zu sprechen",
"hint_listening": "Ich höre zu…",
"hint_thinking": "Denke nach…",
"hint_speaking": "Spreche…",
- "hint_paused": "Pausiert — tippe auf die Leiste, um weiterzumachen",
+ "hint_paused": "Pausiert",
"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",
+ "hint_error": "Voice hat ein Problem — drück auf Start, um es erneut zu versuchen",
+ "bar_start": "Unterhaltung starten",
+ "bar_stop": "Unterhaltung beenden",
"bar_end": "Beenden",
"chat_empty_title": "Wie kann ich helfen?",
"composer_hint": "Enter sendet · Shift+Enter für eine neue Zeile",
@@ -671,7 +671,9 @@
"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"
+ "voice_exit_hint": "Das Gespräch beenden und zurück in den Chat",
+ "voice_start": "Start",
+ "voice_stop": "Stopp"
},
"agent_chat": {
"pair_open": "Agenten-Chat öffnen",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index d1d06f6626..d1fcacd26a 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -641,21 +641,21 @@
"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.",
+ "voice_subtitle": "Say your wake word or press Start — the conversation shows up here.",
"transcript_you": "You",
"transcript_to_end": "Jump to the newest",
- "hint_idle": "Say “{wake}” or tap the bar to start",
- "hint_idle_nowake": "Tap the bar to start",
+ "hint_idle": "Say “{wake}” or press Start",
+ "hint_idle_nowake": "Press Start to talk",
"hint_listening": "Listening…",
"hint_thinking": "Thinking…",
"hint_speaking": "Speaking…",
- "hint_paused": "Paused — tap the bar to continue",
+ "hint_paused": "Paused",
"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",
+ "hint_error": "Voice ran into a problem — press Start to try again",
+ "bar_start": "Start the conversation",
+ "bar_stop": "End the conversation",
"bar_end": "End",
"chat_empty_title": "How can I help?",
"composer_hint": "Enter to send · Shift+Enter for a new line",
@@ -671,7 +671,9 @@
"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"
+ "voice_exit_hint": "End the spoken conversation and go back to the chat",
+ "voice_start": "Start",
+ "voice_stop": "Stop"
},
"agent_chat": {
"pair_open": "Open agent conversation",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index 031a0cc767..1f75def2fe 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -641,21 +641,21 @@
"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í.",
+ "voice_subtitle": "Di tu palabra de activación o pulsa Empezar — la conversación aparece aquí.",
"transcript_you": "Tú",
"transcript_to_end": "Ir a lo más reciente",
- "hint_idle": "Di «{wake}» o toca la barra para empezar",
- "hint_idle_nowake": "Toca la barra para empezar",
+ "hint_idle": "Di «{wake}» o pulsa Empezar",
+ "hint_idle_nowake": "Pulsa Empezar para hablar",
"hint_listening": "Escuchando…",
"hint_thinking": "Pensando…",
"hint_speaking": "Hablando…",
- "hint_paused": "En pausa — toca la barra para continuar",
+ "hint_paused": "En pausa",
"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",
+ "hint_error": "La voz tuvo un problema — pulsa Empezar para intentarlo de nuevo",
+ "bar_start": "Iniciar la conversación",
+ "bar_stop": "Terminar la conversación",
"bar_end": "Terminar",
"chat_empty_title": "¿En qué puedo ayudar?",
"composer_hint": "Enter envía · Shift+Enter para una nueva línea",
@@ -671,7 +671,9 @@
"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"
+ "voice_exit_hint": "Terminar la conversación hablada y volver al chat",
+ "voice_start": "Empezar",
+ "voice_stop": "Detener"
},
"agent_chat": {
"pair_open": "Abrir conversación entre agentes",
diff --git a/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsx b/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsx
index 6913d1180f..b9b293c99e 100644
--- a/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/ChatsSurface.test.tsx
@@ -7,11 +7,17 @@ import { readHomeSurface } from "@/lib/homeSurface";
/**
* 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, voice mode swaps in the
- * spoken stage with a way back to typing, and the mode is remembered. Both
+ * spoken stage and hands it the way back to typing, and the mode is remembered. Both
* stages are stubbed; the composer's voice button is ChatStage's own test.
*/
vi.mock("@/components/home/VoiceStage", () => ({
- VoiceStage: () => <div data-testid="voice">voice</div>,
+ VoiceStage: ({ onExit }: { onExit?: () => void }) => (
+ <div data-testid="voice">
+ <button type="button" data-testid="voice-mode-exit" onClick={onExit}>
+ back
+ </button>
+ </div>
+ ),
}));
vi.mock("@/components/home/ChatStage", () => ({
ChatStage: () => <div data-testid="chat">chat</div>,