From fca929df9f33e222b0d588d717c25dc06e8f8780 Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Thu, 26 Feb 2026 15:40:15 +0800 Subject: [PATCH] fix: voice controls reactivity, disable mic on unsupported browsers --- dashboard/frontend/src/lib/voice.js | 1 + dashboard/frontend/src/routes/Terminal.svelte | 59 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/dashboard/frontend/src/lib/voice.js b/dashboard/frontend/src/lib/voice.js index 2940f93..e0752e0 100644 --- a/dashboard/frontend/src/lib/voice.js +++ b/dashboard/frontend/src/lib/voice.js @@ -8,6 +8,7 @@ export class VoiceSession { this.ttsEnabled = false; this.speaking = false; this.listening = false; + this.sttAvailable = !!(window.SpeechRecognition || window.webkitSpeechRecognition); this.langIdx = 0; this.term = null; this.ws = null; diff --git a/dashboard/frontend/src/routes/Terminal.svelte b/dashboard/frontend/src/routes/Terminal.svelte index dbd5743..f791dda 100644 --- a/dashboard/frontend/src/routes/Terminal.svelte +++ b/dashboard/frontend/src/routes/Terminal.svelte @@ -142,37 +142,36 @@ {/if} - {#if activeTab && tabs.find(t => t.id === activeTab)?.connected} + {#if activeTab && tabs.find(t => t.id === activeTab)?.connected && activeVoice()} {@const v = activeVoice()} - {#if v} -
- - - -
- {/if} +
+ + + +
{/if}