mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
The illness list load triggered the cross-episode correlation fan-out on every mount, so the page waited on up to 24 per-episode reads before it painted. Move that work behind an explicit opt-in: the insights endpoint takes an includeRecoveryGap query param (default off), the list reads the count breakdown on a single fast query, and the recovery gap is computed only when the viewer opens the Analyse expansion. Tighten the typical-gap gate against coincidental data. A gap now counts only from an episode that cleared a per-episode measurement floor (MIN_GAP_MEASUREMENT_DAYS), at least MIN_EPISODES_FOR_TYPICAL_GAP such episodes must qualify, and the median magnitude must reach MIN_TYPICAL_GAP_MAGNITUDE_DAYS — a 0/+-1-day gap is the coincidental baseline and is withheld as noise.
687 KiB
687 KiB