Skip to content

Reading Timeline — your reading life as a ribbon (new Stats tab)#127

Open
bndct-devops wants to merge 1 commit into
mainfrom
feat/reading-timeline
Open

Reading Timeline — your reading life as a ribbon (new Stats tab)#127
bndct-devops wants to merge 1 commit into
mainfrom
feat/reading-timeline

Conversation

@bndct-devops

Copy link
Copy Markdown
Owner

What

A new Timeline tab on Reading Stats: your lifetime reading history drawn as a Gantt-style ribbon.

  • One lane per series, named in a frozen left rail (volume count + total time); standalone books get their own lane.
  • Every book is a bar from its first to last active reading day, volume number at the bar's start, and each day's minutes shaded inside the bar (single accent hue, intensity scaled against the p90 reading day so one marathon doesn't flatten everything else).
  • Lifetime & reconciled: merges live sessions and imported KOReader page-stats with the same page-stats-win-per-book rule as the rest of stats (book_day_seconds beside the existing book_month_seconds), bucketed by the canonical 4h-rollover reading day.
  • Lanes sort by most recent activity and the view opens at today — the first paint is what you're reading now; pan left for history.
  • Hover for cover/author/span/totals, click through to the book. Finishing a volume and starting the next the same day chains onto one row; only genuinely parallel reads stack.

Presentation

  • The Timeline tab renders full-bleed (edge to edge, viewport-tall, panel hugs its content) whenever a board holds only the timeline in view mode; Edit mode falls back to the grid so the tile stays movable/resizable. It's also a normal gallery tile (under Habits) for any other board.
  • Zoom presets (year-glance → month detail) floored at fit-width — the ribbon can never leave dead space right of today; zoom level persists.
  • Timeline data is session-cached so switching tabs renders instantly; the page-padding animation now only runs in Edit mode (no more squeeze on tab switch); axis labels never render into the clipped right edge.

Backend

  • GET /api/stats/timeline (per-book active days, span, totals, status/finished metadata). Sub-minute lifetime totals are dropped as page-flip noise; sessions of deleted books are skipped.

Tests

  • tests/test_stats_timeline.py: source reconciliation (page-stats win, web sessions additive), day bucketing, ordering + finished metadata, noise filter. Full suite: 926 passed. tsc -b + frontend build clean.
  • Verified live against the dev instance (101 books, Oct 2025 → Jul 2026, imported KOReader history) in light and dark, both zoom extremes, tab-switch behaviour, hover cards, click-through.

Docs

  • New "Timeline board" section on the website stats page + API bullet. The stats-reading-timeline ThemedShot (light/dark/amber) follows in a commit once the showcase backend is bounced to serve the new endpoint.

… life

New Timeline tab on Reading Stats: one lane per series (frozen left rail),
volumes as numbered bars spanning first to last active day, daily reading
intensity shaded inside each bar. Lifetime data, reconciled across live
sessions and imported KOReader page-stats via the same page-stats-win rule
as the rest of stats, bucketed by the canonical 4h-rollover reading day.

- GET /api/stats/timeline + reconciled_reading.book_day_seconds
- TimelineRibbon widget registered in the stats dashboard (gallery tile
  under Habits + default 'timeline' tab, auto-appended to saved boards)
- Full-bleed rendering when a board holds only the timeline (view mode);
  Edit mode falls back to the grid so the tile stays manageable
- Lanes sorted by most recent activity; view opens at today
- Zoom presets floored at fit-width, persisted; session-cached data so tab
  switches render instantly; same-day volume chaining on one row
- Sub-minute lifetime totals filtered as page-flip noise
- 4 endpoint tests; docs section on the website stats page

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant