Per side stays on reps work, where reps exist
Switching a per-side exercise to Time carried `side` onto the hold: the config sheet hides the toggle in that mode but still saved the flag, and the workout badge then halved a rep count a timed set does not have, reading "0 per side". Dropped at all three points it could get through — the config sheet no longer writes it outside reps mode, the badge no longer renders outside it, and the plan serialiser refuses it on a hold so an older file cannot bring it back.
This commit is contained in:
1 parent
4afffcb248
commit
00b4f543a3
4 files changed
+13
-4
No files matched your search
@@ -504,9 +504,11 @@ function ExConfig({ ex, existing, onSave, onDelete, close, routine }) {
|
||||
if (c.inc > 0) prog.inc = c.inc
|
||||
// Written only when it differs from what the dataset already says, so a barbell config
|
||||
// stays exactly the shape it was before these flags existed.
|
||||
// `bodyweight` is true of a hold as much as of a set of reps; `side` is not — it counts
|
||||
// reps, and a timed hold has none. Switching an exercise to Time therefore drops it
|
||||
// rather than carrying a flag nothing downstream can read.
|
||||
const flags = {}
|
||||
if (bw !== isBodyweightEq(ex.id)) flags.bodyweight = bw
|
||||
if (perSide) flags.side = true
|
||||
if (cardio) onSave({ sets, min: Math.max(1, Math.round(c.min) || 20), speed: Math.max(0, c.speed || 8) })
|
||||
else if (mode === 'time') onSave({ sets, mode: 'time', sec: Math.max(1, Math.round(c.sec) || 45), weight: Math.max(0, c.weight || 0), ...flags, ...prog })
|
||||
else {
|
||||
@@ -514,7 +516,7 @@ function ExConfig({ ex, existing, onSave, onDelete, close, routine }) {
|
||||
// otherwise plan seven reps on one side and eight on the other, every session.
|
||||
const typed = Math.max(1, Math.round(c.reps) || 10)
|
||||
const reps = perSide ? Math.ceil(typed / 2) * 2 : typed
|
||||
const out = { sets, mode: 'reps', reps, weight: Math.max(0, c.weight || 0), ...flags, ...prog }
|
||||
const out = { sets, mode: 'reps', reps, weight: Math.max(0, c.weight || 0), ...flags, ...(perSide ? { side: true } : {}), ...prog }
|
||||
if (policyFor({ ...c, id: ex.id }, routine, 'reps') === 'double') out.repsMin = Math.min(reps, Math.max(1, Math.round(c.repsMin) || Math.max(1, reps - 2)))
|
||||
// A ceiling below the working reps would tell you to add a set on day one.
|
||||
if (bw && !(out.weight > 0) && c.repsMax > 0) out.repsMax = Math.max(reps, Math.round(c.repsMax))
|
||||
|
||||
Reference in new issue
Block a user