mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
SLEEP_DURATION is stored one row per stage per night, so a plain list query leaked every stage segment as its own value. Route a sleep list through the canonical per-night aggregation: one row per wake day carrying the night's TIME ASLEEP (the main session's asleep total per the nap convention), with a chevron drilling into that night's stage segments. The drill-down renders stage labels + per-stage minutes, and the night row captions same-day naps and mid-sleep awakenings. API: a `?type=SLEEP_DURATION` list now returns synthetic per-night rows (value = time asleep in minutes); `?dayKey=` returns the night's stage segments. Additive — no existing client requested per-stage sleep rows as a feature. Storage is untouched. New i18n keys: measurements.sleepNapCaption + sleepAwakeningsCaption in all six locales.