mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
The day-grouped list read the newest `limit` raw rows (the web asked for 5000), folded them into days and returned every day at once: one page of thousands of rows, and every day older than the 5000th raw row missing without a word. The sleep list did the same at a year. Both now pick the page in Postgres. The day mode selects the page's local days with the distinct-day total from `COUNT(*) OVER ()` in the same query, then folds only those days into per-source groups in SQL and lets the source ladder choose among the groups, so no raw row reaches the process. The sleep mode cuts sessions with the same gap rule as the reconstruction, pages wake days the same way and reads only the page's stage rows; the 365-day cut and `meta.windowFrom` are gone. A sleep page holds at most 1000 nights, echoed in `meta.limit`. The web list pages both modes at 25 like the per-sample list. The `partial` day marker is dropped from the contract; no day is cut any more. Refs #1245