From 7d1609bd93379d0b094927ab3edce8e0c1000570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Sun, 4 Jun 2023 14:20:56 +0200 Subject: [PATCH] Order history by `changed_at, published_at` When a bunch of entries are marked as read at once, they should have the same `changed_at`; fall back to sorting them chronologically by publication date. --- ui/history_entries.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/history_entries.go b/ui/history_entries.go index efeb1d57..5576ecd9 100644 --- a/ui/history_entries.go +++ b/ui/history_entries.go @@ -25,8 +25,7 @@ func (h *handler) showHistoryPage(w http.ResponseWriter, r *http.Request) { offset := request.QueryIntParam(r, "offset", 0) builder := h.store.NewEntryQueryBuilder(user.ID) builder.WithStatus(model.EntryStatusRead) - builder.WithOrder("changed_at") - builder.WithDirection("desc") + builder.WithOrder("changed_at DESC, published_at DESC") builder.WithOffset(offset) builder.WithLimit(user.EntriesPerPage)