From 73851bdda98950999c26ccb449cb16b0f1b1e145 Mon Sep 17 00:00:00 2001 From: jake Date: Sat, 21 Mar 2026 11:04:05 +0000 Subject: [PATCH] =?UTF-8?q?agent:=20dictation=20=E2=80=94=20restyle=20with?= =?UTF-8?q?=20brand=20identity,=20Lucide=20icons,=20empty=20states?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- src/lib/pages/DictationPage.svelte | 93 ++++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 23 deletions(-) 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);
@@ -510,7 +526,7 @@ + + {page.recording ? 'Stop' : modelLoading ? 'Loading' : 'Record'} +
{#if page.recording} {#each [0.4, 0.8, 0.5, 1, 0.6, 0.9, 0.4, 0.7, 0.5, 0.8, 0.3, 0.6] as h, i} - + {#if reduceMotion} + + {:else} + + {/if} {/each} {:else} @@ -586,9 +611,10 @@ onclick={() => page.taskSidebarOpen = !page.taskSidebarOpen} aria-label="Toggle task sidebar" > - - - + + {#if taskCount > 0} {taskCount} @@ -679,19 +705,40 @@ {/if} -
+
- + {#if transcriptionFailed && !transcript.trim() && !page.recording} +
+ +
+ {:else if !transcript.trim() && !page.recording && !transcribing} +
+ +
+ + {:else} + + {/if}