From 673067a52d44cbfc14327d226f4f1c4ce66f737a Mon Sep 17 00:00:00 2001 From: Federico Scodelaro Date: Fri, 10 Oct 2025 19:43:38 -0300 Subject: Last user modified (#7886) * feat: Add user modified functionality Closes https://github.com/FreshRSS/FreshRSS/issues/7862 Changes proposed in this pull request: This is an implementation of the proposed feature. It allows entries to have a new field that will be updated whenever an item is marked as read/unread or bookmark/removed from bookmarks. And a new sort criteria to sort by it. How to test the feature manually: 1. Mark items from a feed as read/unread 2. Mark items from a feed as bookmark / remove bookmark 3. Sort by the new criteria * feat: Add sort functionality * feat: Add sort nav button * fix: Use correct migrations * fix: Add internationalization * fix: Linter errors * chore: PR comments * Update app/i18n/fr/index.php Co-authored-by: Alexandre Alapetite * Update app/i18n/pl/index.php Co-authored-by: Inverle * Update app/i18n/nl/index.php Co-authored-by: Frans de Jonge * make fix-all * Fixes * More fixes sort * Fix wrong index * Fix unneeded column * Fix auto-create indexes * Some copilot suggestions * One more fix Co-authored-by: Alexandre Alapetite --------- Co-authored-by: Alexandre Alapetite Co-authored-by: Inverle Co-authored-by: Frans de Jonge --- app/Controllers/indexController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/Controllers') diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 7c66d308a..405c7c5a8 100644 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -285,7 +285,7 @@ class FreshRSS_index_Controller extends FreshRSS_ActionController { $continuation_values = []; if (FreshRSS_Context::$continuation_id !== '0') { - if (in_array(FreshRSS_Context::$sort, ['c.name', 'date', 'f.name', 'link', 'title'], true)) { + if (in_array(FreshRSS_Context::$sort, ['c.name', 'date', 'f.name', 'link', 'title', 'lastUserModified'], true)) { $pagingEntry = $entryDAO->searchById(FreshRSS_Context::$continuation_id); if ($pagingEntry !== null && in_array(FreshRSS_Context::$sort, ['c.name', 'f.name'], true)) { @@ -302,6 +302,7 @@ class FreshRSS_index_Controller extends FreshRSS_ActionController { 'f.name' => $pagingEntry->feed()?->name() ?? '', 'link' => $pagingEntry->link(true), 'title' => $pagingEntry->title(), + 'lastUserModified' => $pagingEntry->lastUserModified(), }; if ($pagingEntry !== null && FreshRSS_Context::$sort === 'c.name') { // Secondary sort criterion -- cgit v1.2.3