Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(voice): der stumme Mikrofonknopf nennt die echte Ursache

purple5c578d2734bc
diff --git a/src/components/chat/VoiceButton.tsx b/src/components/chat/VoiceButton.tsx
index 70891eec..c536141a 100644
--- a/src/components/chat/VoiceButton.tsx
+++ b/src/components/chat/VoiceButton.tsx
@@ -3,6 +3,33 @@ import { motion } from "framer-motion"
import { Mic, MicOff, Loader2 } from "lucide-react"
import { useVoice } from "../../hooks/useVoice"
import { useVoiceStore } from "../../stores/voiceStore"
+import { useSettingsStore } from "../../stores/settingsStore"
+
+/**
+ * Why the microphone is greyed out, in the user's terms.
+ *
+ * The old wording was "Speech-to-text off. Enable it in Settings, Voice &
+ * Remote", which named a switch as the cause. The Gegenprobe on the Windows
+ * build (2026-08-30) took the faster_whisper package out of every Python it
+ * could find and got exactly that sentence, while the real cause was the
+ * missing package. There is no speech-to-text switch to flip either: the mic
+ * is gated on `sttAvailable`, a fresh probe of what is installed, and the
+ * persisted `sttEnabled` flag is read by nobody and offered nowhere in
+ * Settings. So the text now names the state the app actually found and points
+ * at the control that fixes it.
+ *
+ * Two states can grey the button out, and they need different sentences:
+ * - Local mode: faster-whisper is not installed. Voice & Remote has the
+ * Download & Install button right there.
+ * - Cloud mode without a usable cloud account: dictation is hosted, and the
+ * Voice tab deliberately shows no install button in cloud mode, so the way
+ * out is the account, not an install.
+ */
+export function micUnavailableHint(cloudMode: boolean): string {
+ return cloudMode
+ ? "Cloud dictation needs a signed-in account with credits. Sign in under Settings → Account."
+ : "Speech-to-text is not installed. Install faster-whisper in Settings → Voice & Remote."
+}
interface Props {
onTranscript: (text: string) => void
@@ -14,6 +41,9 @@ interface Props {
export function VoiceButton({ onTranscript, onInterim, onRecordingChange, disabled }: Props) {
const { isRecording, isTranscribing, sttSupported, sttError, clearSttError, startRecording, stopRecording, recheckStt, maxRecordingMs } = useVoice()
+ // Only for the greyed-out hint: cloud mode and local mode fail for different
+ // reasons and have different ways out.
+ const appMode = useSettingsStore((s) => s.settings.appMode)
// Auto-stop timer for cloud dictation — the transcribe route rejects takes
// past ~6.5 min (12 MiB) with a 413 that loses the WHOLE recording, so the
// take is stopped and transcribed just under the cap instead.
@@ -86,17 +116,19 @@ export function VoiceButton({ onTranscript, onInterim, onRecordingChange, disabl
}
if (!sttSupported) {
+ const hint = micUnavailableHint(appMode === "cloud")
return (
<div className="relative group/mic shrink-0">
<button
disabled
className="p-1.5 rounded-lg text-gray-300 dark:text-gray-600 cursor-not-allowed shrink-0"
aria-label="Microphone unavailable"
+ title={hint}
>
<MicOff size={14} />
</button>
- <div className="absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-gray-800 dark:bg-gray-700 text-white text-[0.6rem] rounded whitespace-nowrap opacity-0 group-hover/mic:opacity-100 transition-opacity pointer-events-none">
- Speech-to-text off. Enable it in Settings → Voice &amp; Remote
+ <div className="absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 w-max max-w-[240px] bg-gray-800 dark:bg-gray-700 text-white text-[0.6rem] leading-snug rounded text-center opacity-0 group-hover/mic:opacity-100 transition-opacity pointer-events-none">
+ {hint}
</div>
</div>
)
diff --git a/src/components/chat/__tests__/mic-hint-names-the-real-cause.test.ts b/src/components/chat/__tests__/mic-hint-names-the-real-cause.test.ts
new file mode 100644
index 00000000..9758cedb
--- /dev/null
+++ b/src/components/chat/__tests__/mic-hint-names-the-real-cause.test.ts
@@ -0,0 +1,87 @@
+/**
+ * The greyed-out microphone says why it is grey (Gegenprobe 2026-08-30).
+ *
+ * The Abschluss-Gegenprobe took faster_whisper out of every Python on the
+ * Windows box. The button locked correctly, but the hint read "Speech-to-text
+ * off. Enable it in Settings, Voice & Remote", so it blamed a switch. There is
+ * no such switch: the mic is gated on `sttAvailable`, a probe of what is
+ * installed, and the persisted `sttEnabled` flag is read by nobody and offered
+ * nowhere. The user landed in the right place reading a wrong reason.
+ *
+ * Pinned here because the wording IS the fix.
+ */
+
+import { describe, it, expect } from 'vitest'
+import { readFileSync } from 'fs'
+import { resolve } from 'path'
+import { micUnavailableHint } from '../VoiceButton'
+
+describe('the mic hint names the real cause', () => {
+ it('local mode: the package is missing and the install lives in Voice & Remote', () => {
+ const hint = micUnavailableHint(false)
+ expect(hint).toBe(
+ 'Speech-to-text is not installed. Install faster-whisper in Settings → Voice & Remote.'
+ )
+ })
+
+ it('cloud mode: dictation is hosted, so the way out is the account', () => {
+ // Settings deliberately shows no install button in cloud mode, so sending
+ // the user to Voice & Remote for an install would be a dead end.
+ const hint = micUnavailableHint(true)
+ expect(hint).toBe(
+ 'Cloud dictation needs a signed-in account with credits. Sign in under Settings → Account.'
+ )
+ })
+
+ it('negative control: neither wording blames a speech-to-text switch', () => {
+ // The exact sentence the Gegenprobe read off the build, plus the shape of
+ // it. Both hints must name a state (not installed / not signed in), never
+ // an "off" toggle the user could go looking for.
+ for (const hint of [micUnavailableHint(false), micUnavailableHint(true)]) {
+ expect(hint).not.toMatch(/Speech-to-text off/i)
+ expect(hint).not.toMatch(/\benable it\b/i)
+ expect(hint).not.toMatch(/turn (it )?on\b/i)
+ }
+ })
+
+ it('both wordings are plain English sentences, no bare error code', () => {
+ for (const hint of [micUnavailableHint(false), micUnavailableHint(true)]) {
+ expect(hint).toMatch(/^[A-Z]/)
+ expect(hint.trim().endsWith('.')).toBe(true)
+ expect(hint).not.toMatch(/ModuleNotFoundError|Traceback|errno|HTTP \d{3}/)
+ // House rule: no em dashes anywhere.
+ expect(hint).not.toContain('—')
+ }
+ })
+})
+
+describe('the button actually renders that hint', () => {
+ // Comments stripped: the doc comment on micUnavailableHint quotes the old
+ // wrong sentence on purpose, and that quote must not count as the component
+ // still rendering it.
+ const source = readFileSync(resolve(__dirname, '..', 'VoiceButton.tsx'), 'utf8')
+ .replace(/\/\*[\s\S]*?\*\//g, '')
+ .replace(/\/\/.*$/gm, '')
+
+ it('the unavailable branch uses micUnavailableHint and no hardcoded copy', () => {
+ // Negative control for the wiring: a correct helper nobody calls would
+ // leave the old sentence on screen, which is exactly the bug.
+ expect(source).toMatch(/const hint = micUnavailableHint\(appMode === "cloud"\)/)
+ expect(source).not.toMatch(/Speech-to-text off\. Enable it/)
+ })
+
+ it('cloud and local are told apart by the app mode, not by the dead flag', () => {
+ expect(source).toMatch(/useSettingsStore\(\(s\) => s\.settings\.appMode\)/)
+ expect(source).not.toMatch(/sttEnabled/)
+ })
+})
+
+describe('sttEnabled stays a dead flag until David decides', () => {
+ const store = readFileSync(resolve(__dirname, '..', '..', '..', 'stores', 'voiceStore.ts'), 'utf8')
+
+ it('nothing gates on it, so it is marked unused where it is declared', () => {
+ // If someone wires it up later, this test is the place that says the
+ // tooltip copy has to be revisited with it.
+ expect(store).toMatch(/UNUSED, kept only so a persisted store/)
+ })
+})
diff --git a/src/stores/voiceStore.ts b/src/stores/voiceStore.ts
index c3b2bcbc..b91eb0b9 100644
--- a/src/stores/voiceStore.ts
+++ b/src/stores/voiceStore.ts
@@ -25,6 +25,14 @@ interface VoiceState {
sttError: string | null;
// Persisted settings
+ /** UNUSED, kept only so a persisted store from an older build still parses.
+ * Nothing reads it and Settings offers no switch for it: the microphone is
+ * gated on `sttAvailable` (a fresh probe of what is installed) plus cloud
+ * voice. Do not write user-facing copy against this flag. The mic tooltip
+ * used to say "Speech-to-text off. Enable it in Settings" and named exactly
+ * this dead flag as the cause, while the real cause was a missing
+ * faster-whisper (Gegenprobe 2026-08-30). Whether it gets removed or grown
+ * into a real switch is open (design question to David). */
sttEnabled: boolean;
ttsEnabled: boolean;
/** Read each finished response aloud automatically (#77, ElBiggus). Opt-in,