From 56b687c9f4fe56485800e36a13faa056117376bf Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 7 Apr 2026 20:06:57 -0400 Subject: [PATCH] fix(voice): show mic button on HTTP; graceful error for non-secure contexts --- frontend/src/components/ChatInputBar.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/ChatInputBar.vue b/frontend/src/components/ChatInputBar.vue index 35862ad..da56ec4 100644 --- a/frontend/src/components/ChatInputBar.vue +++ b/frontend/src/components/ChatInputBar.vue @@ -5,6 +5,7 @@ import { useVoiceRecorder } from '@/composables/useVoiceRecorder' import { useSilenceDetector } from '@/composables/useSilenceDetector' import { useChatStore } from '@/stores/chat' import { useSettingsStore } from '@/stores/settings' +import { useToastStore } from '@/stores/toast' import type { Note } from '@/types/note' const props = withDefaults(defineProps<{ @@ -124,8 +125,15 @@ async function toggleVoice() { async function startRecording() { if (!voiceEnabled.value || recorder.recording.value) return + if (!recorder.isSupported) { + useToastStore().show('Microphone requires HTTPS or localhost', 'error') + return + } await recorder.startRecording() - if (recorder.error.value) return + if (recorder.error.value) { + useToastStore().show(recorder.error.value, 'error') + return + } if (recorder.stream.value) { silenceDetector.start(recorder.stream.value, () => stopRecording()) } @@ -224,7 +232,7 @@ defineExpose({ focus, prefill })