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>
This commit is contained in:
randogoth 2026-06-19 17:39:38 +03:00
parent e2c3ae5472
commit 6470a878fd

View file

@ -335,9 +335,9 @@ Happy note taking! ✨
// Read file content ONLY if `Include File Content` is enabled
final content = _includeFileContent ? note.readAsStringSync().toLowerCase() : '';
// Match partial tags instead of requiring full matches
// Match partial tags instead of requiring full matches (case-insensitive)
final matchesTags = searchTags.every((tag) =>
noteTags.any((noteTag) => noteTag.startsWith(tag)));
noteTags.any((noteTag) => noteTag.toLowerCase().startsWith(tag)));
if (!_includeFileContent) {
return relativePath.contains(normalizedSearch) && matchesTags;