Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

Comment: history seeds a planned row's weight, and its reps only when the plan does not own them

Duarte Santos1fd77844b47b
diff --git a/frontend/src/lib/history.js b/frontend/src/lib/history.js
index 38b8975c5..18316f8e1 100644
--- a/frontend/src/lib/history.js
+++ b/frontend/src/lib/history.js
@@ -441,7 +441,8 @@ function buildWorkSets(S, cfg, options = {}) {
const mode = modeOf(cfg)
const sets = []
// A deload routine must use its own prescription instead of carrying regular-session values
- // into the workout. Other planned sessions keep the existing history-first behaviour.
+ // into the workout. Other planned sessions read the weight from history (and the reps too,
+ // unless the plan owns them — see planReps below).
const prevAt = i => (!useTarget && last ? (last.sets[i] || last.sets[last.sets.length - 1]) : null)
// `options.planReps`: a planned session opens at the routine's own reps, and history only
// decides the weight (Settings → "Planned sessions start from", lib/session-start.js). Without