muzzle-velocity/lib
randogoth f91484d6d4 cache note metadata at load time to eliminate per-search file I/O
_filterNotes was calling note.readAsStringSync() and _extractTags() for
every note on every keystroke, plus recomputing path.relative() each
time. For large collections with many subdirectories this is O(n * disk).

Fix: build three maps during _loadNotes (which already reads every file
once) and use them in _filterNotes instead of touching the filesystem:
  - _noteRelativePaths: pre-lowercased relative path per note
  - _noteContentLower:  pre-lowercased content for full-text search
  - noteTags:           already existed, now actually used in filter

_filterNotes now does only in-memory map lookups and string.contains
checks — no file reads, no regex, no path computation per keystroke.

Also fix _createNewNote: the Navigator.push was not awaited so
_loadNotes() was never called on return, leaving stale caches after
editing a freshly created note. Now awaits the push and reloads on
return, mirroring the existing-note tap behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 17:45:48 +03:00
..
themes devbox setup, dep upgrades, lint fixes, Android build fixes 2026-06-19 17:08:29 +03:00
codefield.dart devbox setup, dep upgrades, lint fixes, Android build fixes 2026-06-19 17:08:29 +03:00
main.dart devbox setup, dep upgrades, lint fixes, Android build fixes 2026-06-19 17:08:29 +03:00
note_editor.dart add view mode as default, open new notes in edit mode with cursor ready 2026-06-19 17:21:00 +03:00
note_list.dart cache note metadata at load time to eliminate per-search file I/O 2026-06-19 17:45:48 +03:00
read_only.dart devbox setup, dep upgrades, lint fixes, Android build fixes 2026-06-19 17:08:29 +03:00
texts.dart added about and help texts, font size slider 2025-02-22 20:59:42 +02:00