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/Models/Context.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/Models/Context.php') diff --git a/app/Models/Context.php b/app/Models/Context.php index d6942fbcd..c0e25dffd 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -42,7 +42,7 @@ final class FreshRSS_Context { public static int $state = 0; /** @var 'ASC'|'DESC' */ public static string $order = 'DESC'; - /** @var 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand' */ + /** @var 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand'|'lastUserModified' */ public static string $sort = 'id'; public static int $number = 0; public static int $offset = 0; @@ -252,7 +252,7 @@ final class FreshRSS_Context { $order = Minz_Request::paramString('order', true) ?: FreshRSS_Context::userConf()->sort_order; self::$order = in_array($order, ['ASC', 'DESC'], true) ? $order : 'DESC'; $sort = Minz_Request::paramString('sort', true) ?: FreshRSS_Context::userConf()->sort; - self::$sort = in_array($sort, ['id', 'c.name', 'date', 'f.name', 'link', 'title', 'rand'], true) ? $sort : 'id'; + self::$sort = in_array($sort, ['id', 'c.name', 'date', 'f.name', 'link', 'title', 'rand', 'lastUserModified'], true) ? $sort : 'id'; self::$number = Minz_Request::paramInt('nb') ?: FreshRSS_Context::userConf()->posts_per_page; if (self::$number > FreshRSS_Context::userConf()->max_posts_per_rss) { self::$number = max( -- cgit v1.2.3