Skip to content

Add heart rate metric to dashboard - #40

Open
void-mckenzie wants to merge 2 commits into
aspain:mainfrom
void-mckenzie:feat/heart-rate-metric
Open

void-mckenzie wants to merge 2 commits into
aspain:mainfrom
void-mckenzie:feat/heart-rate-metric

Conversation

@void-mckenzie

@void-mckenzie void-mckenzie commented Jun 29, 2026 •

Copy link
Copy Markdown

Adds avg heart rate as a 4th metric alongside distance / time / elevation.

  • New "Heart Rate" chip in the frequency card
  • New "Avg HR" card in the summary row
  • "Heart rate: N bpm" line in heatmap cell tooltips (only when the activity had HR data)

Aggregated as a time-weighted average per day/type/year so a 5-min and a 2-hour session contribute proportionally instead of equally. Days without HR data just skip the line, no placeholder dashes.

Garmin needed a small fix in sync_garmin._normalize_activity: it was dropping averageHR when building the summary schema. Strava worked without changes since its sync already writes the full payload.

V1 scope is avg only. Max HR and HR zones (with zones used for the heatmap) are obvious follow-ups but I kept this PR tight.

Tests: 15 new ones covering field extraction, aggregation, JS-side rendering contracts, and an end-to-end pipeline run. Mutated each hotspot to confirm the tests actually catch regressions (broke the code, ran the test, restored).

Tested end-to-end against my own Garmin Connect account (~240 activities). Haven't tried Strava live yet. The field is in the raw payload and the unit tests cover it, but feel free to point it at a Strava account.

Let me know if you have any ideas of implementing new features, I'm happy to contribute @aspain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant