Jake 1cce5670af storage: Day 4 — FTS5 search + update_transcript + dictionary + paginated list + Tauri command surface
Finally exposes the canonical SQLite store to the frontend. Previously
the transcript/task tables existed but no Tauri command read or wrote
them — the UI lived entirely in localStorage. Closes that gap and adds
the missing commands flagged by both Codex and architecture-review.md
§13.

MIGRATIONS:
- v2 adds:
  - transcripts_fts virtual table (FTS5, porter+unicode61 tokeniser,
    diacritics-folded) backed by transcripts via content_rowid
  - INSERT/UPDATE/DELETE triggers keep FTS in sync automatically
  - dictionary table for custom vocabulary (term, note, created_at)
- Append-only as required; never modifies v1

STORAGE FUNCTIONS (crates/storage/src/database.rs):
- list_transcripts_paged(limit, offset) — pagination
- count_transcripts() — for "showing X of N" in UI
- update_transcript(id, text?, title?) — closes the historic
  architecture-review.md §13 rename-never-persists TODO
- search_transcripts(query, limit) — FTS5 wrapper
- list_dictionary / add_dictionary_entry / delete_dictionary_entry
- DictionaryEntry struct exported

TAURI COMMANDS (src-tauri/src/commands/transcripts.rs new file):
- add_transcript, list_transcripts, count_transcripts_command,
  get_transcript, update_transcript, delete_transcript,
  search_transcripts
- list_dictionary_command, add_dictionary_entry_command,
  delete_dictionary_entry_command
- TranscriptDto + DictionaryDto for camelCase frontend serialisation

REGISTRATION (src-tauri/src/lib.rs):
- All 10 new commands wired into the invoke_handler

cargo check -p kon-storage passes clean. The Tauri crate cargo check
still requires `sudo dnf install cmake clang-devel` for whisper-rs-sys
(pre-existing infra dep, unrelated to this work).

NEXT (still in this sprint):
- Wire DictationPage / FilesPage to call add_transcript on every save
  (dual-write: keep localStorage for now, add SQLite alongside)
- Wire HistoryPage rename to call update_transcript (fixes the TODO)
- Add a History search input that calls search_transcripts
- Add Settings → Dictionary panel
- Inject dictionary terms into the LLM cleanup prompt
2026-04-17 13:10:26 +01:00
Description
No description provided
AGPL-3.0 12 MiB
Languages
Rust 56.1%
Svelte 26.8%
TypeScript 7.8%
Shell 3.2%
HTML 2.4%
Other 3.7%