From 000745592adc954390211849df7a9aa1dbbf745b Mon Sep 17 00:00:00 2001 From: cynarAI <155274210+cynarAI@users.noreply.github.com> Date: Tue, 20 Oct 2026 11:14:28 +0200 Subject: [PATCH] Keep voice choices locked until speaking finishes turning on (#220) Turning speaking on connected the local voice and cleared the busy state halfway through, so a voice picked in that window was replaced by the default once the switch finished. The panel now stays busy for the whole switch. Claude-Session: https://claude.ai/code/session_01Wy1md9QE1ayJbDCwJ4vAQs Co-authored-by: Claude --- apps/web/src/pages/VoiceSettingsOverlay.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/web/src/pages/VoiceSettingsOverlay.tsx b/apps/web/src/pages/VoiceSettingsOverlay.tsx index 020cd91..f46fc6e 100644 --- a/apps/web/src/pages/VoiceSettingsOverlay.tsx +++ b/apps/web/src/pages/VoiceSettingsOverlay.tsx @@ -46,7 +46,7 @@ export function VoiceSettingsOverlay({ const [voiceId, setVoiceId] = useState(""); const [autoSpeak, setAutoSpeak] = useState(false); const [loading, setLoading] = useState(true); - const [pending, setPending] = useState<"connect" | "voice" | "speak" | null>(null); + const [pending, setPending] = useState<"voice" | "speak" | null>(null); const [error, setError] = useState(null); const [notice, setNotice] = useState(null); const [soundEnabled, setSoundEnabled] = useState(() => readOoSoundEnabled()); @@ -74,7 +74,7 @@ export function VoiceSettingsOverlay({ }; }, []); - function markPending(next: "connect" | "voice" | "speak" | null) { + function markPending(next: "voice" | "speak" | null) { setPending(next); onBusyChange?.(next !== null); } @@ -129,8 +129,6 @@ export function VoiceSettingsOverlay({ async function ensureLocalVoice(): Promise { if (localConnected) return true; - markPending("connect"); - setError(null); try { await rpc.voice.connect({ provider: LOCAL_PROVIDER_ID, @@ -145,8 +143,6 @@ export function VoiceSettingsOverlay({ } setError(err instanceof Error ? err.message : t`Could not enable speaking`); return false; - } finally { - markPending(null); } }