Reading activity grid in Settings: months, weeks, days, hours with drill-down

Active reader time is now kept per user in small UTC buckets (6 minutes for
120 days, then hours, dropped after three years), seeded once from the visits
the clock still remembers. Settings -> Reading activity shows them as a grid
whose cells glow with their total and carry a start-to-end strip; month/week
cells open their days, days open their hours. Finished chapters come from
progress and work without the clock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MaashkinoozheandClaude Opus 5.5 committed 2026-11-03 12:41:44 +01:00
1 parent c760141636
commit fe8956087e
15 files changed
+657 -4

No files matched your search

+1
View File
@@ -210,6 +210,7 @@ All requests and responses are JSON. POSTs require `Content-Type: application/js
| `GET /api/progress/latest?m=` | user | The manga's newest saved position (`latest`: `t, w, c, label, v, p, n, done, continue`) or `null` |
| `POST /api/reading/pulse` `{m, c, v, session, seq, …deltas}` | user | When opted in, idempotently merge a clamped active-time pulse, verified page coverage and input totals under a single-reader lease |
| `GET /api/reading/export` | user | Export the user's private derived reading-time summary without raw input or page-exposure diagnostics |
| `GET /api/reading/activity` | user | The user's reading activity for the Settings grid: active reader time in UTC buckets `[start, size, ms, [[mangaIndex, ms]...]]` (6 minutes for the last 120 days, hours up to three years), chapter completions `[doneAt, mangaIndex, label]`, manga titles and whether the clock is on. The browser groups them into local months, weeks, days and hours (`public/activity-core.js`) |
| `POST /api/reading/delete` `{m}` or `{all:true,password}` | user | Delete one manga's reading history, or all history after password confirmation, without changing normal reading progress |
| `POST /api/unread` `{m, c}` | user | Forget progress for a chapter |
| `POST /api/vote` `{m, c, v, value: 1\|-1\|0}` | user | Vote a version; returns the re-ranked versions |
+10
View File
@@ -144,6 +144,16 @@ history from which those values can be reconstructed.
## 5. Later: Reading Journal
Update 2026-11-03: the activity calendar exists as **Settings → Reading activity**
(`reading-activity.js`, `db.activity`). It stores active reader time per user in UTC
buckets: 6 minutes for the last 120 days, then folded into hours, dropped after three
years. Each bucket keeps only its total and the time per manga. All active reader time
counts there, including visits below the 60% threshold, because it answers "when did I
read", not "how long did a chapter take". The first use seeds the buckets from the last
eight visits per chapter the clock still remembers; older history cannot be recovered.
Finished chapters come from the existing progress `doneAt` and need no clock.
Deleting reading-time history (all, or one manga) deletes the matching activity.
If readers enjoy Reading Story, add bounded daily aggregates rather than raw activity
events:
+3 -1
View File
@@ -27,7 +27,7 @@ heading when switching within Settings.
## Routes and ownership
Personal routes: `settings.html#user/reading`, `#user/reading-time`,
Personal routes: `settings.html#user/reading`, `#user/reading-time`, `#user/activity`,
`#user/notifications`, `#user/account`.
Admin routes: `settings.html#admin/scraper`, `#admin/library`, `#admin/users`.
@@ -63,6 +63,8 @@ Service health also holds the **Backups** card: built-in backup status (last run
size, duration, error), **Back up now**, and the daily schedule and retention form,
whose draft survives the page's polling. See [backup.md](backup.md).
Reading activity is a grid of months, weeks, days or hours (`public/activity.js`). Each cell glows with its total and holds a strip from the period's start (left) to its end (right): days in a month, quarter days in a week, hours in a day, 6 minutes in an hour. Clicking a month or week opens its days (the week is marked), a day opens its hours; hover, keyboard focus or a first tap shows details. It measures reading time (needs the Active Reading Clock) or finished chapters (from progress, always available).
Reading-time collection controls, export and deletion live under Reading time &
privacy; reader layout controls stay under Reading. Rescan controls and user
administration are separate. Server & library describes existing maintenance,