Commit graph

24 commits

Author SHA1 Message Date
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
randogoth
6470a878fd fix tag search case sensitivity
_filterNotes lowercases the query so searchTags contains e.g. '#work',
but _extractTags preserves original case from file content ('#Work').
The startsWith comparison was case-sensitive, causing all tag searches
to fail whenever the file used any uppercase in tag names.

Fix: toLowerCase() on the noteTag side before comparing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 17:39:38 +03:00
randogoth
e2c3ae5472 fix subdirectory search and tag highlighting edge cases
- filter notes by relative path instead of bare filename so searching
  "/subdir" or "subdir" matches notes inside that subdirectory
- strip leading "/" from search text before matching so both forms work
- tighten tag regex in _extractTags and _formatTags: require a letter
  after the symbol and a non-word boundary before it ((?<!\S)) to avoid
  matching phone numbers (+44…) and email-local-part suffixes
- fix subdir/notename creation: use contains('/') instead of
  startsWith('/') so names without a leading slash are split correctly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 17:32:48 +03:00
randogoth
bf214afe72 add view mode as default, open new notes in edit mode with cursor ready
- Introduce NoteMode enum { view, edit, preview } replacing the old bool
- Default mode when opening a note is view (syntax-highlighted, read-only)
- Menu now shows all three modes with a checkmark on the active one
- Save and autosave menu items disabled outside edit mode
- New notes open in edit mode with cursor positioned after the header
  and keyboard focused, ready to type

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 17:21:00 +03:00
randogoth
fc6c69db24 devbox setup, dep upgrades, lint fixes, Android build fixes
- Add devbox.json pinning Flutter 3.35.7, Android SDK (Nix flake),
  openjdk17, just, openssl
- Add android/nix-android-sdk/ Nix flake + flake.lock + Android Studio
  config script
- Add justfile with build/get/upgrade/icons/analyze/rebuild recipes
- flutter pub upgrade --major-versions: file_picker ^11, google_fonts ^8,
  permission_handler ^12, share_plus ^12, flutter_lints ^6 (+71 transitive)
- Fix file_picker v11 API: FilePicker.platform → FilePicker.getDirectoryPath()
- Fix all 37 analyzer issues: deprecated APIs (window, WillPopScope, Share,
  SvgPicture color), async BuildContext guards, key constructors, private
  createState() return types, unused locals, print → debugPrint, etc.
- Hook _handleCommand into onSubmitted for : prefix commands
- Android: Gradle 8.3→8.11.1, AGP 8.2.2→8.9.1, KGP 1.8.22→2.2.20,
  compileSdk/targetSdk 34→36, namespace auto-derivation for library modules,
  kotlin.compiler.execution.strategy=in-process

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 17:08:29 +03:00
randogoth
5ba7f49372 snappier search, lazy loading 2025-02-23 10:10:56 +02:00
randogoth
53849f16d1 added font 2025-02-22 21:14:35 +02:00
randogoth
750a228921 added about and help texts, font size slider 2025-02-22 20:59:42 +02:00
randogoth
4fcd6db6fd app icons 2025-02-22 19:11:10 +02:00
randogoth
be43333da6 line wrapping 2025-02-22 17:18:47 +02:00
randogoth
7bd690a807 optional file content / subdirs 2025-02-22 16:57:29 +02:00
randogoth
004d2d9e82 better tag search 2025-02-22 15:58:17 +02:00
randogoth
f77a66d5d8 subfolder support 2025-02-22 15:45:04 +02:00
randogoth
a7f2e1ca89 improved external editor, commands 2025-02-22 14:38:38 +02:00
randogoth
34580109bb use external editor, manage permissions 2025-02-22 14:29:01 +02:00
randogoth
05026b3fe2 more cleanup 2025-02-21 23:07:02 +02:00
randogoth
f728cc6e66 more cleanup 2025-02-21 22:58:10 +02:00
randogoth
432048dc6a cleanup 2025-02-21 22:51:56 +02:00
randogoth
7e82ddcbb7 custom directory 2025-02-21 22:02:06 +02:00
randogoth
185a1c62e9 markdown and latex preview 2025-02-21 18:16:17 +02:00
randogoth
c574f456a0 custom theme, fontsize 2025-02-21 17:46:41 +02:00
randogoth
78f47362cc menu, bugfixes 2025-02-21 17:02:51 +02:00
randogoth
57732c7242 fixes 2025-02-21 00:29:41 +02:00
randogoth
84c134adc4 init 2025-02-20 22:40:41 +02:00