Skip to content

Desktop: the voice bar says what voice mode is doing, and what is wrong when it can't (#345) - #347

Merged
Khoality-dev merged 2 commits into
mainfrom
feat/345-voice-bar
Sep 28, 2026
Merged

Khoality-dev merged 2 commits into
mainfrom
feat/345-voice-bar

Conversation

@Khoality-dev

Copy link
Copy Markdown
Owner

Closes #345

The desktop half of the Claude Design mockup "Kurisu - Voice Mode v1", section 1 (the owner's design project "agentic app design"). Sections 2 (personas) and 3 (Android, #341) follow in their own PRs.

What changes

  • Header control (VoiceModeToggle): a grey headset icon when voice mode is off; a solid blue pill when it is on — "Voice mode on", or "On" when the chat column is under 480 px — with an amber dot while the bar shows a problem.
  • Voice bar (VoiceModeBar): one state at a time, decided in one place (voiceBarPhase in @kurisu/hooks): waiting (Say "Kurisu" to start), listening with the live mic level, transcribing, " is thinking", " is speaking", and the 30-second window. The second line is what was last said, kept for the whole interaction (it used to vanish after 3 s). A line along the top edge is faint while waiting, solid in an interaction, and drains over the window, from when it opened, with "Ends soon unless you say something". No countdown.
  • Talking holds the window open. The mic store now knows when someone is talking (userSpeaking, from the VAD's speech start to its end or misfire); talking and transcribing hold the 30-second timer, and it restarts full when they are over.
  • Problems are states, not toasts. A mic that cannot start is classified (classifyMicFailure): access blocked, no microphone found, or speech recognition didn't load, each with its fix (Try again / Voice settings / Retry → retryListening()). No wake word set is amber and opens Settings → Assistant. A failed transcription is still a toast.
  • End voice mode is a labelled red outline button with a headset-off icon, in the same place in every state (its own row when narrow). Ending shows a snackbar in the chat column: "Voice mode is off. The mic isn't listening."
  • New conversation marker (NewInteractionMarker): an interaction's conversation opens on "New conversation — You said "Kurisu" at 7:42 PM. The last one is in Conversations."

Tests

Written first and committed on their own (bce1528), red against the old code:

  • state/micProblem.test.ts (9): the three failure classes, no toast, retry clears, ending clears, userSpeaking from speech start to end/misfire and on stop.
  • hooks/voiceBarPhase.test.ts (8): the state order.
  • ui/components/chat/voiceMode.test.tsx (+5): the transcript stays for the interaction, wokeAt, the window opens only once the reply is done, talking and transcribing hold it.
  • ui/components/VoiceModeBar.test.tsx (22), VoiceModeToggle.test.tsx (4), NewInteractionMarker.test.tsx (3): copy, actions and End voice mode in every state. One of them caught a real fault on the way: MUI's Tooltip had renamed the End button "Turns the mic off"; the tooltip now describes it (describeChild).
  • Playwright voiceMode.spec.ts: the pill ("On" at the default 400 px), the bar as a "Voice mode" region, End → snackbar, restored after reload.

Locally: state 73, hooks 49, ui 155, platform 24; typecheck clean; voiceMode.spec.ts + settings.spec.ts 13/13 in Electron under Xvfb. Screenshots at 400/600 px, light and dark, checked against the mockup.

Found on the way

A built app never loads speech recognition — onnxruntime resolves ./vad/ against the bundle's assets/ folder — so the e2e run shows "Speech recognition didn't load" (which the bar now says, instead of claiming to wait). Filed as #346, next.

🤖 Generated with Claude Code

https://claude.ai/code/session_014L9pxjp1MTSJe5DZG9A9sv

akn-sfu and others added 2 commits September 28, 2026 01:11
Red first: what the voice bar says in each state and each problem, the
header pill, the new-conversation marker, the mic store's problem and
"someone is talking" state, and the 30-second window as the hook reports
it. None of it exists yet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014L9pxjp1MTSJe5DZG9A9sv
…is wrong (#345)

Section 1 of the Claude Design mockup "Kurisu - Voice Mode v1":

- The header's control is a grey icon off and a blue "Voice mode on" /
  "On" pill on, with a dot while voice mode has a problem.
- The voice bar shows one state at a time (voiceBarPhase): waiting,
  listening with the live mic level, transcribing, thinking, speaking,
  and the 30-second window, whose top line drains from when it opened.
  What was last said stays for the whole interaction.
- A mic that cannot start is a state, not a toast: no microphone,
  access blocked, speech recognition that did not load, each with its
  fix; no wake word set sends the user to Assistant settings.
- Talking and transcribing hold the window shut; it reopens full.
- End voice mode is a labelled outline button; ending it shows a
  snackbar. An interaction's new conversation opens on a marker that
  points to Conversations.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014L9pxjp1MTSJe5DZG9A9sv
@Khoality-dev
Khoality-dev marked this pull request as ready for review September 28, 2026 08:21
@Khoality-dev
Khoality-dev merged commit d3816b8 into main Sep 28, 2026
3 checks passed
@Khoality-dev
Khoality-dev deleted the feat/345-voice-bar branch September 28, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop: the voice bar says what voice mode is doing, and what is wrong when it can't

2 participants