mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-15 15:02:04 +00:00
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:
1 parent
9b4f3ce56d
commit
47d638cf02
16 files changed
+236
-287
No files matched your search
@@ -866,11 +866,20 @@ export const dashboardSnapshotResponse = z
|
||||
]),
|
||||
score: z.number().int(),
|
||||
band: z.enum(["green", "yellow", "red"]),
|
||||
doses: z
|
||||
.object({
|
||||
taken: z.number().int(),
|
||||
scheduled: z.number().int(),
|
||||
})
|
||||
.optional()
|
||||
.describe(
|
||||
"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.",
|
||||
),
|
||||
}),
|
||||
)
|
||||
.optional()
|
||||
.describe(
|
||||
"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.",
|
||||
"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 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.",
|
||||
),
|
||||
briefing: z.record(z.string(), z.unknown()).nullable(),
|
||||
briefingState: z.enum(["ready", "preparing", "disabled", "no-provider"]),
|
||||
|
||||
Reference in new issue
Block a user