feat(dashboard): VO2 max trend tile (opt-in, secondary-metric pattern)

Adds the VO2 max strip tile to /, matching the existing
secondary-metric convention (sleep / steps / glucose / oxygen
saturation are all default-invisible + opt-in via Settings →
Dashboard).

Wire-up:
  - src/lib/dashboard-layout.ts: vo2Max appended to
    DASHBOARD_WIDGET_IDS and DEFAULT_DASHBOARD_LAYOUT.widgets with
    visible=false / tileVisible=false. The /api/dashboard/widgets
    Zod enum is derived from the same array so the toggle is wired
    automatically.
  - src/app/page.tsx: vo2Summary from data?.summaries?.VO2_MAX
    (auto-populated by /api/analytics; the route iterates the full
    measurementTypeEnum.options list, no backend change needed),
    hasVo2 data-floor gate, showVo2Tile combined gate, and the
    TrendCard push next to showStepsTile. directionSentiment is
    up-good (higher VO2 max is better) and the unit string runs
    through the t() helper so the iOS app session can localise it.
  - src/components/settings/dashboard-layout-section.tsx: vo2Max
    label key added to WIDGET_LABEL_KEYS so the Settings → Dashboard
    toggle row renders the localized label.
  - messages/{en,de,fr,es,it,pl}.json: dashboard.vo2Max + vo2MaxUnit
    keys. "VO₂ max" is universal across all six locales (scientific
    abbreviation, no translation needed); the unit string is
    consistent SI notation.

No chart-row card — that's an explicit v1.5 deferral per the W8d
outline §6.4. The tile lights up the moment the user accumulates any
VO2 sample (Withings ingest or the upcoming iOS Health passthrough).
This commit is contained in:
Marc-André Bombeck committed 2026-05-14 16:04:46 +02:00
1 parent 8f57f5e0d7
commit b324e6c41d
9 files changed
+61

No files matched your search

@@ -48,6 +48,8 @@ const WIDGET_LABEL_KEYS: Record<DashboardWidgetId, string> = {
// for the polished `<InsightsCardPreview>` (top severity-ordered AI
// recommendations + ring confidence meter + "View all" CTA).
insightsPreview: "dashboard.insightsPreview",
// v1.4.25 W8d — VO2 max secondary-metric tile (opt-in).
vo2Max: "dashboard.vo2Max",
};
export function DashboardLayoutSection({ id }: { id: string }) {