mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
The rollup writer keeps one row per bucket and source. Collapsing the stored WEEK / MONTH / YEAR rows picked one source for the whole bucket, so a month of manual blood-pressure readings plus one synced reading reported the synced day alone, and a step month that switched devices lost every day the losing device carried. The live weekly and monthly chart fold made the same pick. Every coarse bucket is now folded from the canonical DAY buckets: the source ladder picks one source per day, then the week, month or year counts every one of its days. Spread, slope and r² are composed from the summed day accumulators. The live fold picks per local day before folding into weeks and months. Ties between sources without a ladder rank break alphabetically on the SQL paths too, matching the rollup reader.