Sort search results by date, newest first

This commit is contained in:
2025-05-18 17:00:23 +02:00
parent b5dad28491
commit d937ae212c

View File

@@ -755,6 +755,9 @@ class MainPageState extends State<MainPage> with WindowListener {
.where((note) => note.content.isNotEmpty)
.toList();
// Sort by date, newest first
filteredResults.sort((a, b) => b.date.compareTo(a.date));
// Important: update the dialog state after search completes
dialogSetState(() {
_searchResults = filteredResults;