mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
Add an additive annotations[] prop to <HealthChart> that paints a vertical Recharts <ReferenceLine> per AI-narrated event on the underlying timeline. The line + tooltip + comparison overlay remain untouched — annotations sit between the cartesian grid and the data lines so they read as orientation, never as data. The /insights page wires advisor.payload.insights.storyboardAnnotations into the 90-day BP chart, mapping the four canonical categories to Dracula colours (medication=pink, event=cyan, milestone=green, warning=orange). Pure helper resolveAnnotationPositions() handles the date->pointIndex mapping with a 7-day snap window (so annotations don't stack on monthly buckets) and a 24-char truncation for the small-viewport label. The unit suite pins exact-day pinning, near-day snapping, out-of-window dropping, and label truncation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>