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:
parent
e2c3ae5472
commit
6470a878fd
1 changed files with 2 additions and 2 deletions
|
|
@ -335,9 +335,9 @@ Happy note taking! ✨
|
||||||
// ✅ Read file content ONLY if `Include File Content` is enabled
|
// ✅ Read file content ONLY if `Include File Content` is enabled
|
||||||
final content = _includeFileContent ? note.readAsStringSync().toLowerCase() : '';
|
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) =>
|
final matchesTags = searchTags.every((tag) =>
|
||||||
noteTags.any((noteTag) => noteTag.startsWith(tag)));
|
noteTags.any((noteTag) => noteTag.toLowerCase().startsWith(tag)));
|
||||||
|
|
||||||
if (!_includeFileContent) {
|
if (!_includeFileContent) {
|
||||||
return relativePath.contains(normalizedSearch) && matchesTags;
|
return relativePath.contains(normalizedSearch) && matchesTags;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue