docs: architecture map (initial 5-slice generation, 105 pages)

Five-slice navigable map of the entire codebase under
docs/architecture-map/. Each slice is a self-contained
breadcrumbed sub-tree:

  01-frontend (16)              Svelte/SvelteKit UI
  02-tauri-runtime (26)         src-tauri commands + lifecycle
  03-audio-transcription (16)   audio + transcription crates
  04-llm-formatting-mcp (19)    llm, ai-formatting, mcp, cloud
  05-core-storage-hotkey-build  core, storage, hotkey, workspace,
                          (26) CI, dev glue

Plus master README.md and data-flow-end-to-end.md tracing
audio bytes from microphone to FTS5 search to MCP read.

Generated by 5 parallel subagents on 2026/05/09 against
HEAD 3c47000. Each page has YAML frontmatter, file:line code
refs, sibling cross-links, plain-English summaries.

Aggregated debt surfaced (full lists in master README):
RB-08 macOS power assertion, schema head drift v14 vs v15,
VAD blocked on ort version conflict, streaming primitives
not wired into live.rs, no prompt versioning, MCP has no
auth, cloud-providers in-memory keystore, SettingsPage
2 484 LOC, commands/live.rs 1 737 LOC, dual theme system,
brand rename to Lumenote pending across the codebase.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
jars
2026-05-09 14:04:13 +01:00
parent 3c47000ea9
commit a1f3f3f134
105 changed files with 11266 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
---
name: Files page
type: architecture-map-page
slice: 01-frontend
last_verified: 2026/05/09
---
# Files page
> **Where you are:** [Architecture map](../../README.md) → [Frontend](../README.md) → [Pages overview](../pages-overview.md) → Files
**Plain English summary.** Drag and drop or browse local audio/video files for transcription. Same engine as live dictation, just file mode. On finish, results land in the page (preview text, segments) and into `addToHistory`.
## At a glance
- **Path:** `src/lib/pages/FilesPage.svelte`
- **LOC:** 263
- **Imports (selected):**
- Tauri: `invoke` (core), `listen` (event).
- Stores: `settings`, `addToHistory` from `page.svelte.ts`. `profilesStore`. `toasts` (transitive via store helpers).
- Components: `Card`, `EmptyState`.
- Utils: `exportTranscript`.
- External: `Upload` icon from `lucide-svelte`. `@tauri-apps/plugin-dialog` (lazy import).
## What's in here
### Drag and drop
- `onMount` registers three Tauri events:
- `tauri://drag-drop` (`FilesPage.svelte:28`). Filters the dropped paths to supported extensions and starts transcription.
- `tauri://drag-enter` (`FilesPage.svelte:34`). Sets `isDragOver = true`.
- `tauri://drag-leave` (`FilesPage.svelte:35`). Sets `isDragOver = false`.
- `onDestroy` calls each unlisten.
### Browse
- `handleBrowse()` lazy imports `@tauri-apps/plugin-dialog` and opens with the audio/video filter (`mp3, wav, m4a, mp4, flac, ogg, webm, mov, mkv`).
### Transcription
- Calls `invoke("transcribe_file", { ... })` (`FilesPage.svelte:76`). Receives transcript text + segments.
- Optional `copy_to_clipboard` on completion.
- Pushes result into history via the store helper.
### State
- `fileTranscript`, `segments`, `isDragOver`, `progress`, `progressText`, `fileName`, `error`, `transcribing`.
## Tauri command surface
`transcribe_file`, `copy_to_clipboard`. Plus dialog plugin.
## Watch outs
- The drag and drop events require the Tauri config to declare drag drop on the relevant window. If the events do not fire, check `tauri.conf.json` and slice 02.
- Long files block the UI of this page until `transcribe_file` resolves. There is no abort.
- The supported extensions list is duplicated between the file dialog filter and (presumably) the Rust side. Drift risk.
- Multi file drag drop iterates serially. No queue UI.
## See also
- [Pages: dictation](dictation.md). The live counterpart.
- [Frontend ↔ Tauri bridge](../frontend-tauri-bridge.md).