Per side: log the total, show the split
Feedback on #31: a rep count that sometimes means one side and sometimes both is the ambiguity, not the fix for it. So the logged number is the total — 16 — the same as every other set in the app, and the split is derived for planning: "8 per side" on the exercise, "3 × 16 · 8/side" on the plan line and the printed sheet. Unilateral targets step in twos. 16 → 18 → 20, in the config stepper, the set-row stepper and the bodyweight rep progression, because half of an odd total is a rep one side never gets. Turning the flag on rounds an existing target up to even, and a saved target is stored even for the same reason. An odd total that arrives some other way still displays honestly, as 8.5 per side, since that is what it means. Volume loses its per-side case: both sides are already in the number logged.
This commit is contained in:
1 parent
c33ff15d9d
commit
4afffcb248
19 files changed
+103
-90
No files matched your search
+10
-5
@@ -3,7 +3,7 @@ import { useStore } from './store/useStore.js'
|
||||
import { useUI } from './store/useUI.js'
|
||||
import { EXDB, EXIDX, BODYPARTS, isCardio, isBodyweightEq, allExercises, equipmentOf } from './lib/exercises.js'
|
||||
import { fmtDate, fmtNum, fmtVol, fmtDur, durPart, todayISO, uid, exCount, DAYN, MONTHS_LONG, ACCENTS } from './lib/format.js'
|
||||
import { lastEntryFor, bestWeightFor, buildSets, effectiveRoutineId, workoutVolume, setsDone, setsDoneActive, lastBW, supersetUnits, unitOf, setLabel, defaultConfig, cleanupSg, modeOf, effortOf, isBw, isPerSide } from './lib/history.js'
|
||||
import { lastEntryFor, bestWeightFor, buildSets, effectiveRoutineId, workoutVolume, setsDone, setsDoneActive, lastBW, supersetUnits, unitOf, setLabel, defaultConfig, cleanupSg, modeOf, effortOf, isBw, isPerSide, sideReps } from './lib/history.js'
|
||||
import { beep, vibrate } from './lib/sound.js'
|
||||
import { t, instrFor, getLang, INSTR_LANGS } from './lib/i18n.js'
|
||||
import { nav } from './lib/nav.js'
|
||||
@@ -510,7 +510,10 @@ function ExConfig({ ex, existing, onSave, onDelete, close, routine }) {
|
||||
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 {
|
||||
const reps = Math.max(1, Math.round(c.reps) || 10)
|
||||
// A unilateral target is stored even: the split has to divide, and a typed 15 would
|
||||
// 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 }
|
||||
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.
|
||||
@@ -541,7 +544,7 @@ function ExConfig({ ex, existing, onSave, onDelete, close, routine }) {
|
||||
<Stepper label={t('Weight ({0})', st.unit)} value={c.weight} step={2.5} onChange={v => setC(x => ({ ...x, weight: v }))} />
|
||||
</> : <>
|
||||
<Stepper label={t('Sets')} value={c.sets} step={1} decimal={false} onChange={v => setC(x => ({ ...x, sets: v }))} />
|
||||
<Stepper label={t('Reps')} value={c.reps} step={1} decimal={false} onChange={v => setC(x => ({ ...x, reps: v }))} />
|
||||
<Stepper label={t('Reps')} value={c.reps} step={perSide ? 2 : 1} decimal={false} onChange={v => setC(x => ({ ...x, reps: v }))} />
|
||||
{/* On bodyweight work the weight stepper is the click #32 is about, so it is not here
|
||||
until there is a belt to describe — see the added-weight row below. */}
|
||||
{!bw && <Stepper label={t('Weight ({0})', st.unit)} value={c.weight} step={2.5} onChange={v => setC(x => ({ ...x, weight: v }))} />}
|
||||
@@ -561,8 +564,10 @@ function ExConfig({ ex, existing, onSave, onDelete, close, routine }) {
|
||||
<Stepper value={c.weight || 0} step={2.5} onChange={v => setC(x => ({ ...x, weight: v }))} />
|
||||
</Row>}
|
||||
{mode === 'reps' && <Row icon="shuffle" iconTint="var(--blue)" title={t('Reps per side')}
|
||||
subtitle={perSide ? t('{0} logged is {1} in total.', c.reps || 0, (c.reps || 0) * 2) : t('For lunges, single-arm rows and the like.')}>
|
||||
<Switch checked={perSide} onChange={v => setC(x => ({ ...x, side: v || undefined }))} />
|
||||
subtitle={perSide ? t('You still log the total: {0} is {1} per side.', c.reps || 0, fmtNum(sideReps(c.reps))) : t('For lunges, single-arm rows and the like.')}>
|
||||
{/* Turning it on rounds the target up to an even number, since half of an odd
|
||||
total is a rep one side does not get. */}
|
||||
<Switch checked={perSide} onChange={v => setC(x => ({ ...x, side: v || undefined, reps: v ? Math.ceil((x.reps || 0) / 2) * 2 : x.reps }))} />
|
||||
</Row>}
|
||||
</div>}
|
||||
{/* The rep ceiling only means something when there is no load to add instead. */}
|
||||
|
||||
Reference in new issue
Block a user