Show expected vs actual pace/HR per lap in the Review Queue

Activities recorded from a structured Garmin workout carry a workoutId;
when its steps line up 1:1 with the recorded laps, the per-step target
pace/HR zone is resolved (via a Karvonen lookup for named zones) and stored
on each lap. The Review Queue plots it against the actual per-lap pace/HR
so the user can eyeball whether a run matches its plan while sorting it.
This commit is contained in:
2026-07-19 11:55:13 +02:00
parent 0610897541
commit af41aa0f7f
16 changed files with 666 additions and 47 deletions

View File

@@ -0,0 +1,12 @@
-- Structured Garmin workouts (created in Garmin Connect or a training plan
-- tool) attach a per-step target pace/HR zone. An activity recorded from one
-- carries that workout's id; when its laps line up 1:1 with the workout's
-- flattened steps (see internal/sync's alignWorkoutTargets), the expected
-- band is resolved and stored per lap so the Review Queue can plot expected
-- vs actual pace/HR without a live Garmin call on every page view.
ALTER TABLE activities ADD COLUMN workout_id INTEGER;
ALTER TABLE laps ADD COLUMN target_pace_low_mps REAL;
ALTER TABLE laps ADD COLUMN target_pace_high_mps REAL;
ALTER TABLE laps ADD COLUMN target_hr_low_bpm REAL;
ALTER TABLE laps ADD COLUMN target_hr_high_bpm REAL;