fix(insights): rebuild the recovery page onto the canonical metric structure

The recovery page rendered a grid of compact device-score tiles plus a
redundant cross-link to the recovery-score anatomy at the top. It now
follows the same structure as every other metric page (blood pressure,
pulse, the HealthKit scaffold): each present device-native signal renders
a block carrying a short explainer, the max / median / mean stat strip,
the shared chart with the identical 7 / 30 / 90 / All toggle, and a
per-chart assessment. Multiple charts now carry multiple matching texts.

Register the seven device-native recovery / strain signals (ANS charge,
day / workout strain, cardio load, whole-day average / max heart rate,
energy expenditure) in the generic metric-status registry so each chart
gets a generated assessment, gate them on the recovery module, and give
each its own chart-overlay slot. Drop the duplicate top score-link block
(this surface is reached from the overview already).

Regenerate the OpenAPI contract for the widened metric-status enum.
This commit is contained in:
Marc-André Bombeck committed 2026-06-16 21:35:09 +02:00
1 parent 930c4a75dd
commit bc2ce702f1
14 files changed
+380 -89

No files matched your search

@@ -51,6 +51,15 @@ const METRIC_MODULE: Partial<Record<MetricStatusMetricId, ModuleKey>> = {
BREATHING_DISTURBANCES: "sleep",
BLOOD_GLUCOSE: "glucose",
CARDIO_RECOVERY: "recovery",
// v1.18.1 — device-native recovery / strain signals gate on the
// recovery module like CARDIO_RECOVERY.
ANS_CHARGE: "recovery",
DAY_STRAIN: "recovery",
WORKOUT_STRAIN: "recovery",
CARDIO_LOAD: "recovery",
AVERAGE_HEART_RATE: "recovery",
MAX_HEART_RATE: "recovery",
ENERGY_EXPENDITURE_KJ: "recovery",
};
// Closed enum derived from the registry so the route + registry cannot
+8 -3
View File
@@ -14,11 +14,16 @@ import { RecoverySection } from "@/components/insights/recovery/recovery-section
* that were stored end-to-end but had no page: day strain, workout strain, ANS
* charge, cardio load, and the day's whole-cycle average / max heart rate and
* kilojoule energy expenditure. The composite RECOVERY_SCORE keeps its anatomy
* detail at `/insights/scores/recovery`; this page cross-links to it and
* surrounds it with the raw signals it never surfaced.
* detail at `/insights/scores/recovery`.
*
* v1.18.1 (B1–B3) — the page now follows the canonical per-metric structure:
* each present signal renders a block carrying a short explainer, the
* max / median / mean stat strip, the same chart with the 7 / 30 / 90 / All
* toggle, and a per-chart assessment. The redundant top "Recovery score"
* cross-link is removed (reached from the overview already).
*
* Every block is data-gated inside `<RecoverySection>`, so an account without a
* strap / ring sees only the calm empty note. Server-authoritative: the tiles
* strap / ring sees only the calm empty note. Server-authoritative: the charts
* render stored values, never a recompute.
*/
export default function InsightsRecoveryPage() {