2 Commits

Author SHA1 Message Date
d937ae212c Sort search results by date, newest first 2025-05-18 17:00:23 +02:00
b5dad28491 Clear input field after saving note 2025-05-18 13:50:59 +02:00

View File

@@ -585,6 +585,7 @@ class MainPageState extends State<MainPage> with WindowListener {
// Handle current entry
if (currentEntry.isNotEmpty) {
await createNote(currentEntry);
_currentEntryController.clear(); // Clear the input field after saving
}
// Handle scratch pad
@@ -754,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;