feat(dashboard): show today's dose tally on the medication hero ring

The MED_COMPLIANCE hero ring carried the pooled 7-day adherence
percentage — a mystery number next to today-focused scores. It now
answers the question the hero poses: how many of today's doses are
done. The resolver reads takenToday/scheduledToday off the snapshot's
own medsToday block (one shared builder call, no second tally); score
stays the rounded 0..100 progress for wire compatibility and a new
additive doses field carries the taken/scheduled pair. No dose
scheduled today means no ring, and the band is progress semantics —
green once everything is taken, yellow while doses remain, never red
(a pending morning dose is not an alert state).

The web ring renders the tally (1/3) with a doses label over the ring
system's constant green arc — the same green family the compliance
surfaces in Insights paint — instead of a band gradient; the derived
rings keep their exact insights hues. ScoreRing gains documented
valueText/ariaLabel overrides for tally-shaped centres. OpenAPI
regenerated; labels land in all six locales.
This commit is contained in:
Marc-André Bombeck committed 2026-07-05 18:05:13 +02:00
1 parent 9b4f3ce56d
commit 47d638cf02
16 files changed
+236 -287

No files matched your search

+22 -3
View File
@@ -21432,9 +21432,11 @@ components:
scoreRings:
description: "User-selected hero score rings (max 3, `selectedScoreRings` on the dashboard layout), resolved
server-side: READINESS / RECOVERY_SCORE / SLEEP_SCORE via the derived engines (module-gated like
`/api/insights/derived`), MED_COMPLIANCE as the pooled 7-day medication adherence (0..100, banded ≥90 green
/ ≥70 yellow / else red). Only rings with data appear, in selection order — a missing entry means no data or
a disabled module, never zero. Clients render what arrives and never recompute."
`/api/insights/derived`); MED_COMPLIANCE is TODAY's dose progress off the snapshot's medsToday tally —
`score` is the rounded 0..100 progress, `doses` carries the taken/scheduled pair, the band is progress
semantics (green once every scheduled dose is taken, yellow while doses remain, never red), and the ring is
absent when no dose is scheduled today. Only rings with data appear, in selection order — a missing entry
means no data or a disabled module, never zero. Clients render what arrives and never recompute."
type: array
items:
type: object
@@ -21456,6 +21458,23 @@ components:
- green
- yellow
- red
doses:
description: MED_COMPLIANCE only — today's dose tally behind the progress score, for a 'taken/scheduled' ring display
(e.g. 1/3). Absent on the derived score rings.
type: object
properties:
taken:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
scheduled:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
required:
- taken
- scheduled
additionalProperties: false
required:
- id
- score