Phase 9 of the rebrand cascade. Sweep covers everything the Phase 8
frontend pass deliberately skipped: docs/, root markdown, scripts,
Cargo.toml descriptions, code comments that survived earlier
word-boundary sed, plus a handful of identifiers caught on the final
verify pass.
transcription-app changes:
- README.md, HANDOVER.md, KNOWN-ISSUES.md, run.sh — magnotia/Magnotia
-> lumotia/Lumotia.
- docs/ — sweep across all subdirs except docs/handovers/ (preserved
as immutable audit trail). Includes architecture-map references
to magnotia_core::*, magnotia_storage::*, etc. now pointing at
lumotia_*; dev-setup.md tracing output examples (lumotia_startup
target); brief/ + superpowers/ + issues/ + whisper-ecosystem/ +
audit/.
- Cargo.toml descriptions on 9 crates (core, audio, cloud-providers,
hotkey, llm, mcp, plus referenced others).
- crates/core/src/{error,hardware,recommendation,paths}.rs +
crates/audio/src/wav.rs + crates/llm/src/model_manager.rs +
crates/cloud-providers/src/keystore.rs + crates/mcp/src/lib.rs —
doc comments and a model-manager user-agent string.
- Caught on final pass: BroadcastChannel("magnotia_task_sync") -> ...
("lumotia_task_sync"); magnotia_locale i18n localStorage key
renamed + migration shim added; CSS keyframe names
magnotiaPulse / magnotiaBar / magnotiaFade renamed in the design-
system kit; magnotia_viewer_item / magnotia_viewer_mode handoff
keys renamed in HistoryPage + viewer/+page.svelte; src/assets/
wordmark.svg text.
- src-tauri/src/lib.rs comment cleanup ("magnotia era" was sed'd
to "lumotia era" earlier — restored).
Preserved (intentional):
- crates/core/src/paths.rs — keeps "magnotia" / "Magnotia" / ".magnotia"
legacy detection strings in legacy_and_target_paths() so the
migration shim can still find user data from the magnotia era.
- src/lib/stores/{page,focusTimer}.svelte.ts + src/lib/i18n/index.ts
— migration call sites reference the legacy magnotia keys
deliberately.
- docs/handovers/ — historical audit trail.
cargo build --workspace passes. npm run check: 0 errors / 0 warnings
(3958 files). cargo test --workspace: 339 pass / 0 fail.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5.8 KiB
name, type, slice, last_verified
| name | type | slice | last_verified |
|---|---|---|---|
| Dictation page | architecture-map-page | 01-frontend | 2026/05/09 |
Dictation page
Where you are: Architecture map → Frontend → Pages overview → Dictation
Plain English summary. This is the recording surface. Press the hotkey or the mic button, watch live partial text stream into a textarea, then on stop run the AI cleanup, extract tasks, copy to clipboard or paste into the focused application. The page handles model loading, the live transcription session, the preview overlay, optional template insertion, and task extraction.
At a glance
- Path:
src/lib/pages/DictationPage.svelte - LOC: 1 100
- Imports (selected):
- Tauri:
Channel,invokefrom@tauri-apps/api/core.emitfrom@tauri-apps/api/event.getCurrentWindowfrom@tauri-apps/api/window. - Stores:
page,settings,templates,profiles,addToHistory,addTask,tasksfrompage.svelte.ts.markGenerating,markGenerationDonefromllmStatus.svelte.ts.profilesStorefromprofiles.svelte.ts.toasts.getPreferencesfrompreferences.svelte.ts. - Components:
Card,ModelDownloader,EmptyState,SpeakerButton. - Utils:
exportTranscript,extractTasks,pad,FEEDBACK_TIMEOUT_MS,bionicReadingaction,measurePreWrap,transcriptPretextFont,transcriptPretextLineHeight,playStartCue,playStopCue,playCompleteCue. - External:
lucide-svelteicons (Mic,Loader2,SquareCheck,AlertTriangle).
- Tauri:
- Used by:
src/routes/+page.svelte:20whenpage.current === "dictation". Also forced by global hotkey and first run path.
What's in here
Local state (selected)
transcript(string),segments(array of{start, end, text}).recordingis on the globalpagestore; this page mirrors it.timerInterval,startTime,timerText(mm:ss).- Model lifecycle flags:
modelReady,modelLoading,needsDownload. - AI flags:
aiProcessing,aiStatus,extractedCount. - Live session:
sessionId,drainingSessionId,lastResultAt,lastLiveActivityAt,liveWarning. - Tauri channels (typed):
resultChannel,statusChannelopened bynew Channel(...). - UI:
showExportMenu,saved,insertPos(cursor-based insertion),activeTemplate. runtimeCapabilities(fromget_runtime_capabilities, used to decide engine availability and CUDA presence).
Lifecycle
onMount. LoadsruntimeCapabilities(DictationPage.svelte:134). Sets up the global hotkey custom event listener (lumotia:toggle-recording, dispatched from the+layout.sveltehotkey path).onDestroy. Tears down listeners and timers.
Recording flow (high level)
- Toggle from the mic button or the
lumotia:toggle-recordingwindow event. - If model not ready, ensure model: check
check_engine,check_parakeet_engine,check_llm_model, then load viaload_model/load_parakeet_model/load_llm_modelas required (DictationPage.svelte:241-272). - Open two
Channel<message>instances (DictationPage.svelte:341-342) and callstart_live_transcription_sessionwith the channel handles. - As the backend pushes status and partial result messages, append text to
transcript, updatesegments, and broadcastpreview-appendto the preview overlay window (DictationPage.svelte:165, 381, 385). If the preview is enabled and not already open,open_preview_windowis invoked. - On stop, call
stop_live_transcription_session, then run AI cleanup (cleanup_transcript_text_cmd) gated onget_llm_status(DictationPage.svelte:464-472). - Optionally extract tasks via
extract_tasks_from_transcript_cmd(DictationPage.svelte:487-491) and add them via theaddTaskstore helper. - Push to history with
addToHistory(which callsadd_transcript). - Auto copy and/or auto paste based on
settings.autoCopy/settings.autoPaste. Paste path usespaste_text(DictationPage.svelte:544-554); fallback tocopy_to_clipboard. - Emit
preview-cleanup,preview-final,preview-hideto drive the overlay state machine (DictationPage.svelte:531, 539, 606).
Tauri command surface
get_runtime_capabilities, check_llm_model, load_llm_model, load_parakeet_model, load_model, start_live_transcription_session, stop_live_transcription_session, open_preview_window, get_llm_status, cleanup_transcript_text_cmd, extract_tasks_from_transcript_cmd, paste_text, copy_to_clipboard.
Plus emit("preview-append" | "preview-listening" | "preview-cleanup" | "preview-final" | "preview-hide").
Watch outs
- The page uses
// @ts-nocheck. Adding type safety here would catch a class of regressions, especially around theChannel<T>payload shape. - The cursor based insertion (
insertPos) is fragile. Editing the textarea while a live session is running can corrupt the segment offset map. Tests aroundextractTasksonly cover the post stop path. - Multiple paths can flip
recording(button, hotkey custom event, error early-out). Treat the page as a state machine with a single source of truth and you will save yourself. extractedCountis purely cosmetic. It is reset on recording start.- The "live activity" stalled detector is timer based (
lastLiveActivityAt). On a stalled session the user seesliveWarning. The recovery path is "stop and start again".
See also
- Stores.
page,settings,llmStatusreactivity. - Frontend ↔ Tauri bridge. All commands and events.
- Components.
Card,ModelDownloader,SpeakerButton,EmptyState. - ../03-audio-transcription/README.md. Live session plumbing on the Rust side.
- ../04-llm-formatting-mcp/README.md. Cleanup and task extraction commands.