diff --git a/src/lib/pages/DictationPage.svelte b/src/lib/pages/DictationPage.svelte index f189157..eef97a9 100644 --- a/src/lib/pages/DictationPage.svelte +++ b/src/lib/pages/DictationPage.svelte @@ -9,6 +9,11 @@ import { extractTasks } from "$lib/utils/taskExtractor.js"; import { pad } from "$lib/utils/time.js"; import { MAX_PCM_SAMPLES, MIN_CHUNK_SAMPLES, CHUNK_INTERVAL_MS, FEEDBACK_TIMEOUT_MS } from "$lib/utils/constants.js"; + import { Mic, Loader2, SquareCheck, AlertTriangle } from 'lucide-svelte'; + import EmptyState from '$lib/components/EmptyState.svelte'; + import { getPreferences } from '$lib/stores/preferences.svelte.js'; + import { bionicReading } from '$lib/actions/bionicReading.js'; + const prefs = getPreferences(); let transcript = $state(""); let segments = $state([]); @@ -196,6 +201,7 @@ async function startRecording() { error = ""; saved = false; + transcriptionFailed = false; if (!modelReady) { if (needsDownload) return; await loadModel(); @@ -339,6 +345,7 @@ } catch (err) { console.error("transcribe_pcm failed:", err); error = typeof err === "string" ? err : err.message || "Transcription failed"; + transcriptionFailed = true; if (!page.recording) { page.status = "Error"; page.statusColor = "#e87171"; @@ -496,6 +503,15 @@ const trimmed = transcript.trim(); return trimmed ? trimmed.split(/\s+/).length : 0; }); + + let reduceMotion = $derived( + prefs.accessibility.reduceMotion === 'on' + || (prefs.accessibility.reduceMotion === 'system' + && typeof window !== 'undefined' + && window.matchMedia('(prefers-reduced-motion: reduce)').matches) + ); + + let transcriptionFailed = $state(false);