From 1f00946bfee29e865080c7fd2265751de5de4631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 5 Jun 2026 13:48:53 +0200 Subject: [PATCH] refactor(insights): tighten the subpage spine and clarify the VO2 max chart Pull the subpage spine to a denser space-y-3/4 rhythm to match the tighter stat strip, and refresh the stale brush comment now that the windowed stats are wired. Give the cardio-fitness page its Gauge stat-strip glyph so VO2 max leads with the same standard treatment as the other HealthKit metrics; the dedicated subpage already renders the full chart. Clarify the VO2 row's sparse-series note. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/app/insights/cardio-fitness/page.tsx | 1 + src/components/insights/sub-page-shell.tsx | 14 ++++++-------- src/components/insights/vo2-max-chart-row.tsx | 8 +++++++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/app/insights/cardio-fitness/page.tsx b/src/app/insights/cardio-fitness/page.tsx index d4fbe4897..010b7e66c 100644 --- a/src/app/insights/cardio-fitness/page.tsx +++ b/src/app/insights/cardio-fitness/page.tsx @@ -24,6 +24,7 @@ export default function InsightsCardioFitnessPage() { color="#bd93f9" unit="mL/(kg·min)" yAxisUnit="mL/(kg·min)" + statIcon={Gauge} emptyStateIcon={} emptyStateCtaType={null} coachPrefill="I haven't logged any cardio-fitness (VO₂ max) data yet — what does this metric tell me about my health, and how do I improve it?" diff --git a/src/components/insights/sub-page-shell.tsx b/src/components/insights/sub-page-shell.tsx index 1b1d42925..c4dc0a8d1 100644 --- a/src/components/insights/sub-page-shell.tsx +++ b/src/components/insights/sub-page-shell.tsx @@ -168,7 +168,7 @@ export function SubPageShell({ // state + renders the sheet, so the gear and the card don't have to // share a parent beyond this shell. -
+
{/* v1.8.7.1 — back-nav leads the page, above the heading. */} {backLink}
@@ -262,13 +262,11 @@ export function SubPageShell({ brand-new-metric paths. Numbers-first is the Apple-Health / Withings / Oura detail-screen convention. - The stats describe the full range. Recomputing them for a window - the user brushes / selects in the chart below would mean lifting the - chart's domain into this shell so both the chart and the strip read - it — but the shared `` (also driving the dashboard) has - no Recharts `` or domain-change callback and keeps its range - state internal, so that wiring is left for a later release to avoid - destabilising the chart. */} + v1.12.7 — the stats are chart-reactive: when the user brushes a + window in the chart below, the page lifts the chart's per-type + windowed Min / Max / Median / Mean and threads it back into the + strip, which swaps the header to a "selected range" pill. No + selection falls back to the cheap full-range summary. */} {statStrip} {/* v1.12.6 — the canonical spine body: intro (header) → stat strip (above) → chart → target card → assessment. The page renders diff --git a/src/components/insights/vo2-max-chart-row.tsx b/src/components/insights/vo2-max-chart-row.tsx index 5b87da9c9..2272cac32 100644 --- a/src/components/insights/vo2-max-chart-row.tsx +++ b/src/components/insights/vo2-max-chart-row.tsx @@ -193,7 +193,13 @@ export function Vo2MaxChartRow({ {/* Trend chart. The chartKey isolates per-chart overlay prefs from the dashboard VO2 tile and from the pulse chart sitting above - it on the same page. */} + it on the same page. + + The chart mounts as soon as there is at least one reading. VO₂ max + arrives from Apple Health at most every few days, so the series is + inherently sparse; the line carries a visible dot per point + (`dot r=3`), so a one- or two-sample series still reads as a real + chart. A zero-reading account keeps the short onboarding note. */} {hasData ? (