From 2ab34eb15a21ec2cdc2122391a7f1e1fa5bd1c83 Mon Sep 17 00:00:00 2001 From: jake Date: Tue, 17 Mar 2026 02:29:49 +0000 Subject: [PATCH] =?UTF-8?q?refactor(kon):=20settings=20page=20=E2=80=94=20?= =?UTF-8?q?collapsible=20sections,=20first=20section=20open=20by=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Consolidated 7 separate Card components into a single Card with 8 accordion sections - Added openSection $state variable; 'transcription' open by default, others collapsed - Each section header is a clickable button with +/− indicator; clicking open section closes it - Section headings use font-display italic 18px (vs 26px page title) as accordion headers - All existing functionality preserved: toggles, dropdowns, model download/load, profiles, templates, hotkey recorder, output folder picker - Profiles & Templates remain as nested accordion-within-accordion (existing pattern kept) Co-Authored-By: Claude Opus 4.6 (1M context) --- src/lib/pages/SettingsPage.svelte | 878 ++++++++++++++++-------------- 1 file changed, 473 insertions(+), 405 deletions(-) diff --git a/src/lib/pages/SettingsPage.svelte b/src/lib/pages/SettingsPage.svelte index 84bc130..7c8b341 100644 --- a/src/lib/pages/SettingsPage.svelte +++ b/src/lib/pages/SettingsPage.svelte @@ -34,6 +34,9 @@ let showNewProfile = $state(false); let showNewTemplate = $state(false); + // Accordion state — first section open by default + let openSection = $state('transcription'); + onMount(async () => { try { const loaded = await invoke("check_engine"); @@ -202,432 +205,497 @@

Settings

-
- +
-
-

Transcription

+ +
+ + {#if openSection === 'transcription'} +
- -
-

Engine

- -

- {settings.engine === "whisper" ? "OpenAI Whisper — 99+ languages, reliable" : - "Nvidia Parakeet — faster on CPU, English-focused, auto-punctuated"} -

-
- - -
-

Format Mode

- -

- {settings.formatMode === "Raw" ? "Exact Whisper output, no formatting" : - settings.formatMode === "Clean" ? "Grouped into paragraphs, punctuation tidied" : - "Structured with lists, headings, and sections"} -

-
- - - {#if settings.engine === "whisper"} -
-

Whisper Model

- -

{modelDescriptions[settings.modelSize]}

- -
- {#if isModelDownloaded(settings.modelSize)} - - - Downloaded - - - {:else if downloadingModel === settings.modelSize.toLowerCase()} - {downloadProgress}% downloading... - {:else} - - {/if} + +
+

Engine

+ +

+ {settings.engine === "whisper" ? "OpenAI Whisper — 99+ languages, reliable" : + "Nvidia Parakeet — faster on CPU, English-focused, auto-punctuated"} +

-
- {:else} -
-

Parakeet Model

-

Parakeet CTC 0.6B (int8) — ~613MB, near-instant transcription

-
- {#if parakeetOk} - - - Model loaded - - {:else if parakeetDownloaded} - - - Downloaded - - - {:else if parakeetDownloading} - {parakeetProgress}% downloading... - {:else} - - {/if} + +
+

Format Mode

+ +

+ {settings.formatMode === "Raw" ? "Exact Whisper output, no formatting" : + settings.formatMode === "Clean" ? "Grouped into paragraphs, punctuation tidied" : + "Structured with lists, headings, and sections"} +

-
- {/if} - -
-

Compute Device

- -

GPU acceleration requires building with CUDA feature

-
+ + {#if settings.engine === "whisper"} +
+

Whisper Model

+ +

{modelDescriptions[settings.modelSize]}

- -
-

Language

-
- - {#if settings.language === "en"} - + {:else if downloadingModel === settings.modelSize.toLowerCase()} + {downloadProgress}% downloading... + {:else} + + {/if} +
+
+ {:else} +
+

Parakeet Model

+

Parakeet CTC 0.6B (int8) — ~613MB, near-instant transcription

+ +
+ {#if parakeetOk} + + + Model loaded + + {:else if parakeetDownloaded} + + + Downloaded + + + {:else if parakeetDownloading} + {parakeetProgress}% downloading... + {:else} + + {/if} +
+
+ {/if} + + +
+

Compute Device

+ +

GPU acceleration requires building with CUDA feature

+
- - -
-

Processing

-
- - -
-
-
- - - -
-

AI Assistant

-

Local LLM for smart task extraction, transcript cleanup, and formatting. Runs 100% offline.

-
-

Coming soon

-

AI-powered cleanup and smart extraction are being rebuilt with a faster engine. Task extraction currently uses rule-based matching, which runs automatically after each recording.

-
-
-
- - - -
- - -

Custom vocabulary to improve transcription accuracy

- - {#if showProfiles} -
- {#each profiles as profile, i} -
-
- {profile.name} - - {profileWordCount(profile.words)} words - + +
+

Language

+
+ + {#if settings.language === "en"} - -
- {#if editingProfile === i} -
- -
- {/if} -
- {/each} - - {#if showNewProfile} -
- e.key === "Enter" && createProfile()} - data-no-transition - /> - - -
- {:else} - - {/if} -
- {/if} - -
- - - -

Structured formats for dictation sessions

- - {#if showTemplates} -
- {#each templates as template, i} -
-
- {template.name} - - {template.sections.length} sections - - - -
- {#if editingTemplate === i} -
- -
- {/if} -
- {/each} - - {#if showNewTemplate} -
- e.key === "Enter" && createTemplate()} - data-no-transition - /> - - -
- {:else} - - {/if} -
- {/if} -
- - - - -
-

Output

-
- - - - {#if settings.saveAudio} -
-

Output Folder

-
-
-

- {settings.outputFolder || "Default (app data)"} -

-
- - {#if settings.outputFolder} - + class="flex items-center gap-1.5 px-2.5 py-1.5 rounded-full text-[11px] border animate-fade-in + {settings.britishEnglish + ? 'bg-accent/10 border-accent/30 text-accent font-medium' + : 'bg-bg-input border-border text-text-tertiary hover:text-text-secondary'}" + onclick={() => { settings.britishEnglish = !settings.britishEnglish; }} + title={settings.britishEnglish ? "British English spelling active" : "Click to enable British English spelling"} + > + {#if settings.britishEnglish} + + + + {/if} + British English + {/if}
- {/if} -
+
+ {/if}
- - - -
-

Global Hotkey

-

Toggle recording from anywhere. Click to change.

- + +
+ + {#if openSection === 'processing'} +
+
+ + +
+
+ {/if}
- - - -
-

Appearance

- -
-

Theme

- -
- -
-

- Font Size {settings.fontSize}px -

- -
+ +
+ + {#if openSection === 'ai'} +
+

Local LLM for smart task extraction, transcript cleanup, and formatting. Runs 100% offline.

+
+

Coming soon

+

AI-powered cleanup and smart extraction are being rebuilt with a faster engine. Task extraction currently uses rule-based matching, which runs automatically after each recording.

+
+
+ {/if}
- - - -
-

About

- - -
- - {engineStatus} -
- -
- {#each [ - "100% offline — all processing on your machine", - "No Python required — compiled Whisper engine", - "No cloud — audio never leaves your computer", - "No accounts — no sign-up, no tracking", - "No telemetry — zero data collection", - ] as item} -
- - + +
+ + {#if openSection === 'profiles'} +
+ +
- {/each} -
+

Profiles

+ + {profiles.length} + + +

Custom vocabulary to improve transcription accuracy

-

Kon v1.0 · Powered by whisper.cpp · Built by CORBEL Ltd

+ {#if showProfiles} +
+ {#each profiles as profile, i} +
+
+ {profile.name} + + {profileWordCount(profile.words)} words + + + +
+ {#if editingProfile === i} +
+ +
+ {/if} +
+ {/each} + + {#if showNewProfile} +
+ e.key === "Enter" && createProfile()} + data-no-transition + /> + + +
+ {:else} + + {/if} +
+ {/if} + +
+ + + +

Structured formats for dictation sessions

+ + {#if showTemplates} +
+ {#each templates as template, i} +
+
+ {template.name} + + {template.sections.length} sections + + + +
+ {#if editingTemplate === i} +
+ +
+ {/if} +
+ {/each} + + {#if showNewTemplate} +
+ e.key === "Enter" && createTemplate()} + data-no-transition + /> + + +
+ {:else} + + {/if} +
+ {/if} +
+ {/if} +
+ + +
+ + {#if openSection === 'output'} +
+
+ + + + {#if settings.saveAudio} +
+

Output Folder

+
+
+

+ {settings.outputFolder || "Default (app data)"} +

+
+ + {#if settings.outputFolder} + + {/if} +
+
+ {/if} +
+
+ {/if} +
+ + +
+ + {#if openSection === 'hotkey'} +
+

Toggle recording from anywhere. Click to change.

+ +
+ {/if} +
+ + +
+ + {#if openSection === 'appearance'} +
+
+

Theme

+ +
+ +
+

+ Font Size {settings.fontSize}px +

+ +
+
+ {/if} +
+ + +
+ + {#if openSection === 'about'} +
+ +
+ + {engineStatus} +
+ +
+ {#each [ + "100% offline — all processing on your machine", + "No Python required — compiled Whisper engine", + "No cloud — audio never leaves your computer", + "No accounts — no sign-up, no tracking", + "No telemetry — zero data collection", + ] as item} +
+ + + +

{item}

+
+ {/each} +
+ +

Kon v1.0 · Powered by whisper.cpp · Built by CORBEL Ltd

+
+ {/if}