# Release v1.15.x - Changelog

Released: YYYY-MM-DD

## Overview

Comprehensive health dashboard with config-driven metric cards, collapsible categories, and lazy loading.

## Features

- **Config-driven health dashboard** — replaced hardcoded StepsCard/HeartRateCard/HrvCard with a generic MetricCard component and a registry of 50+ metrics across 8 categories (Core Vitals, Activity, Sleep, Body, Walking, Cycling, Running, Audio)
- **Collapsible category sections** — each metric category is a collapsible section with lazy data loading on expand; Core Vitals expanded by default
- **Available metrics discovery** — new server endpoint `GET /health/metrics/available` samples day files across the full history to discover which metrics have data, correctly finding sparse metrics like Withings body composition
- **Deep-linkable health dashboard** — `useSearchParams` for `range` and `section` URL params (e.g. `?range=30d&section=walking`)
- **Alcohol/HRV correlation moved to Alcohol tab** — AlcoholHrvCorrelation chart now lives alongside the consumption chart with synced view range

- **Apple Health clinical records import** — ZIP uploads now extract FHIR R4 JSON files from `clinical_records/`, parse lab observations with LOINC code mapping (~70 codes), and merge results into blood-tests.json with non-destructive merge (existing manual entries preserved)
- **Extended blood test reference ranges** — added 23 new metric keys to `REFERENCE_RANGES` (electrolytes, liver panel, CBC differentials, lipid ratios) with proper categorization in the Blood & Body tab

## Improvements

- **Smart aggregation for sum metrics** — refactored `getDailyAggregates` to use a `SUM_METRICS` set instead of hardcoded `metricName === 'step_count'`; covers active energy, basal energy, flights climbed, exercise time, stand time, walking/cycling distance, and time in daylight
- **Correct units from Apple Health** — metric display uses actual stored units (lb, mi, mi/hr, in, etc.) instead of assumed metric units
- **PM2 memory limits** — increased max memory restart to 2G for server and CoS processes
