insights: lead every metric subpage with the stat strip above the chart

Render the Min/Max/Median/Mittelwert stat strip directly above the chart
on the canonical spine (intro -> stats -> chart -> target -> assessment),
the numbers-first detail-screen convention. Wire the series headings on
each subpage: blood pressure shows the full four-stat grid for both
systolic and diastolic as labelled blocks, single-series pages pass the
metric name and icon. Leave a marker for chart-brush-reactive stats as a
follow-up.
This commit is contained in:
Marc-André Bombeck committed 2026-06-05 12:20:54 +02:00
1 parent d434a6e24b
commit ea2ce8697e
5 files changed
+49 -20

No files matched your search

@@ -5,10 +5,13 @@ import { join } from "node:path";
/**
* v1.12.4 — canonical metric-detail spine guard.
*
* The unified subpage spine is: intro → chart → target card → assessment →
* stat strip. The assessment is the LAST content block the page hands to
* `<SubPageShell>` as `children`; the shell appends the Min/Max/Median/Mean
* stat strip below it. The generic `HealthKitMetricPage` scaffold enforces
* v1.12.6 — the unified subpage spine is: intro → stat strip → chart →
* target card → assessment. The stat strip moved ABOVE the chart (the
* shell renders the `statStrip` prop before `children`); the assessment
* stays the LAST content block the page hands to `<SubPageShell>` as
* `children`. This source-order guard is unaffected by the render-position
* move because `statStrip` is a prop on the opening tag and the assessment
* is still the final child element. The generic `HealthKitMetricPage` scaffold enforces
* this for the ~29 HealthKit pages structurally; the bespoke pages each
* hand-write their body, so a future edit can silently slot a card after the
* assessment (as `mood` and `medications` did before).
+3 -1
View File
@@ -1,7 +1,7 @@
"use client";
import Link from "next/link";
import { HeartPulse } from "lucide-react";
import { ArrowDownRight, ArrowUpRight, HeartPulse } from "lucide-react";
import { useAuth } from "@/hooks/use-auth";
import { useInsightsAnalytics } from "@/hooks/use-insights-analytics";
@@ -112,12 +112,14 @@ export default function InsightsBlutdruckPage() {
unit="mmHg"
fractionDigits={0}
seriesLabel={t("charts.systolic")}
icon={ArrowUpRight}
/>
<MetricStatStrip
summary={diaSummary}
unit="mmHg"
fractionDigits={0}
seriesLabel={t("charts.diastolic")}
icon={ArrowDownRight}
/>
</div>
}
+8 -1
View File
@@ -113,7 +113,14 @@ export default function InsightsPulsPage() {
title={t("insights.pulseSectionTitle")}
description={t("insights.subPage.pulsDescription")}
explainerMetric="pulse"
statStrip={<MetricStatStrip summary={pulseSummary} unit="bpm" />}
statStrip={
<MetricStatStrip
summary={pulseSummary}
unit="bpm"
seriesLabel={t("insights.pulseSectionTitle")}
icon={Heart}
/>
}
diversityNudge={
<MeasurementDiversityNudge
measurementType="PULSE"
+8 -1
View File
@@ -75,7 +75,14 @@ export default function InsightsGewichtPage() {
title={t("insights.weightSectionTitle")}
description={t("insights.subPage.gewichtDescription")}
explainerMetric="weight"
statStrip={<MetricStatStrip summary={weightSummary} unit="kg" />}
statStrip={
<MetricStatStrip
summary={weightSummary}
unit="kg"
seriesLabel={t("insights.weightSectionTitle")}
icon={Scale}
/>
}
diversityNudge={
<MeasurementDiversityNudge
measurementType="WEIGHT"