List view: sort videos by publish date (newest first) #4

Closed
opened 2026-06-08 05:06:52 +00:00 by mathias · 1 comment
Owner

Problem

The list view isn't in video-date order. ListVideos (internal/adapters/store/reads.go:157) sorts:

ORDER BY (s.id IS NOT NULL) DESC, v.seen_at DESC

i.e. summarized-first, then by discovery time (seen_at) — so dates appear scrambled (e.g. 2026-06-06, 2026-05-31, 2026-06-01…). A user expects their newest videos at the top.

Desired

Sort the list by published_at descending — newest video first.

  • published_at is nullable (schema 001) → NULLS LAST.
  • Stable tiebreak seen_at DESC for equal/null dates (matches the choice in docs/specs/newest-first-ordering.md).

Open question

Keep "summarized-first" as a secondary sort, or pure date order? Recommend pure published_at DESC (matches the intent — read newest first); the existing "Summarized only" filter already covers focusing on ready summaries, so date order doesn't hide them.

Not a duplicate

docs/specs/newest-first-ordering.md covers batch PROCESSING order (runner.RunOnce summarises newest-first), not the UI display order. This issue is the list query only. They share the published_at DESC NULLS LAST, seen_at DESC shape — align the tiebreak.

Done when

  • List renders newest-published first; HTMX filter fragment + full page agree.
  • reads_test covers the ordering (incl. a null published_at landing last). TDD; task check green; docs-currency (note in ui-spec/architecture if ordering is documented there).
## Problem The list view isn't in video-date order. `ListVideos` (`internal/adapters/store/reads.go:157`) sorts: ``` ORDER BY (s.id IS NOT NULL) DESC, v.seen_at DESC ``` i.e. **summarized-first, then by discovery time (`seen_at`)** — so dates appear scrambled (e.g. 2026-06-06, 2026-05-31, 2026-06-01…). A user expects their newest videos at the top. ## Desired Sort the list by **`published_at` descending — newest video first.** - `published_at` is **nullable** (schema 001) → `NULLS LAST`. - Stable tiebreak `seen_at DESC` for equal/null dates (matches the choice in `docs/specs/newest-first-ordering.md`). ## Open question Keep "summarized-first" as a secondary sort, or pure date order? **Recommend pure `published_at DESC`** (matches the intent — read newest first); the existing **"Summarized only" filter** already covers focusing on ready summaries, so date order doesn't hide them. ## Not a duplicate `docs/specs/newest-first-ordering.md` covers **batch PROCESSING order** (`runner.RunOnce` summarises newest-first), not the **UI display order**. This issue is the list query only. They share the `published_at DESC NULLS LAST, seen_at DESC` shape — align the tiebreak. ## Done when - List renders newest-published first; HTMX filter fragment + full page agree. - `reads_test` covers the ordering (incl. a null `published_at` landing last). TDD; `task check` green; docs-currency (note in ui-spec/architecture if ordering is documented there).
Author
Owner

Shipped in v0.9.0 (deployed via infra ff0269f). List now ordered by published_at, NULLS LAST, with slimmer filters. Closing.

Shipped in v0.9.0 (deployed via infra ff0269f). List now ordered by published_at, NULLS LAST, with slimmer filters. Closing.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/tapir#4