From d937ae212cb1273fbf6aa283b76f0c73835f4d42 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sun, 18 May 2025 17:00:23 +0200 Subject: [PATCH] Sort search results by date, newest first --- lib/main.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index 075f9f4..6cfbfa5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -755,6 +755,9 @@ class MainPageState extends State 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;