warm-ups: keep them out of volume, and make the ramp follow the weight

Three defects, all of them latent before v1.2.10 and live the moment a routine
started planning warm-ups by default.

workoutVolume counted warm-up rows. It was the only consumer that did — onerm,
muscles, recovery and progression all filter them — while the config sheet tells
users in so many words that warm-ups are "left out of volume, records and
progression", and a comment in this very file asserts it. Three planned warm-ups
on a 3x5 at 100kg reported 2562.5 instead of 1500, and that number is written
into the finished workout, so it would have stayed wrong forever.

The ramp aimed at last session's weight. buildSets prepends the warm-ups and
applyPrescription rewrites work rows only, by design — so nothing ever re-derived
the ramp once progression moved the target. Deload 100 -> 50 produced warm-ups of
50 and 75 under work sets of 50: the second "warm-up" heavier than everything it
was warming up for. applyPrescription now finishes by re-ramping, which is where
the invariant cannot be forgotten, rather than at the two call sites where it
already was. A logged warm-up keeps its weight and becomes what the next one
ramps from — it happened, and rewriting performed work is data loss.

insertWarmupRow's early return was unclamped. Once a warm-up sat above the work
weight, every warm-up added after it inherited that number. The clamp guarded
only the other branch. A hand-edited row stays as typed; what stops is the
inheritance.
This commit is contained in:
Duarte Santos committed 2026-08-25 21:50:50 +02:00
1 parent 8104539932
commit 287550df6c
5 files changed
+129 -8

No files matched your search

+1 -1
View File
@@ -520,7 +520,7 @@ function ActiveWorkout() {
const full = { ...cfg, id: ex.id }
const plan = freestyle ? null : nextPrescription(s, full, s.routines.find(r => r.id === s.active.routineId))
const sets = buildSets(s, full, { step: defaultIncrement(ex.id, s.unit), ...(freestyle ? { preferLast: true } : {}) })
const progressed = freestyle ? sets : applyPrescription(sets, plan)
const progressed = freestyle ? sets : applyPrescription(sets, plan, defaultIncrement(ex.id, s.unit))
s.active.entries.push({ id: ex.id, target: { ...cfg }, plan, sets: applyIntensifierPlan(progressed, full) })
s.active.cur = s.active.entries.length - 1
}), null, routine, seed)