mirror of
https://github.com/kuhyx/todo-app.git
synced 2026-11-11 13:07:48 +01:00
The capture screen fed the on-disk BACKLOG.md backup off an always-live watchNotes() subscription, so every keystroke re-queried the whole table, re-parsed every row, and rebuilt the full Markdown export on the UI isolate — O(notes) per character. It also fired a whole-screen setState just to update the "Saved locally" timestamp. - Add NoteRepository.changes: an O(1) broadcast tick after each write (upsert/delete/merge; importNotes transitively). LocalBackup now pulls notes via an injected fetcher only when its 2s debounce fires, so the query + parse + Markdown export runs at most once per idle window instead of on every keystroke. Capture listens to changes, not watchNotes; a launch-time schedule() keeps BACKLOG.md fresh. - Scope the save indicator to a ValueNotifier/ValueListenableBuilder so a keystroke updates one line of text, not the AppBar/dropdowns/editor. - Key list tiles by note id for identity-based reorder diffing. Measured on a 4K/144Hz desktop the UI-thread build stays <=3.3ms; coverage held at 100% on all changed files. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| capture_screen.dart | ||
| markdown_view.dart | ||
| note_detail_screen.dart | ||
| note_editor.dart | ||
| notes_list_screen.dart | ||
| settings_screen.dart | ||