mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-11-05 17:12:55 -05:00
* Support choosing the sort type when creating or editing a user query Changes - User queries can now store a sort field (sort type), not only the sort direction. The create and edit forms expose a single combined dropdown (field + direction) that reuses the existing `index.menu.sort.*` options, matching the global reading-settings sort UI. - The "Bookmark current query" action now also remembers the current sort field, where it previously kept only the order direction. - Relabel the query sort control from "Sort by date" to "Sort by"; other languages are marked for re-translation (// TODO). - Add a CHANGELOG entry and credit the contributor in CREDITS. Implementation - `FreshRSS_UserQuery`: add an optional `sort` property mirroring `order` (constructor parsing, `toArray()`, `getSort()` falling back to the user default sort, and a `hasParameters()` check). - `configureController`: split the combined dropdown value into `sort` and `order`, validating the field against the implemented sort types (`id`, `c.name`, `date`, `f.name`, `length`, `link`, `title`, `rand`); separate `sort`/`order` request parameters are still accepted so the "bookmark current query" flow keeps working. - Views render the combined dropdown and persist `sort` as a hidden field. - `p/api/query.php`: back-fill `sort` from the saved query when the request does not provide one, mirroring the existing `order` handling. - Add unit tests covering the sort round-trip and `toArray()` inclusion. Compatibility - No database or schema change: user queries are stored in the per-user PHP config array, which keeps arbitrary keys verbatim, so no migration is required. - Upgrade: existing queries without `sort` fall back to the user default sort; behaviour is unchanged until a sort is explicitly chosen. - Downgrade: older versions ignore the extra `sort` key and keep working; re-saving under an old version simply drops the key with no data loss. - Shared query URLs without a `sort` parameter remain valid. * Refresh README translation statistics * i18n: fr --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>