@@ -575,10 +581,14 @@ function ProgressionFields({ ex, mode, c, setC, routine, unit }) {
{t(POLICY_DESC[active])}
{active !== 'off' &&
setC(x => ({ ...x, inc: v }))} />
+ step={mode === 'time' ? 5 : 1.25} decimal={mode !== 'time'} invalid={invalid} className={invalid ? 'invalid' : ''}
+ onChange={v => setC(x => ({ ...x, inc: v }))} />
{active === 'double' && setC(x => ({ ...x, repsMin: v }))} />}
}
+ {invalid &&
+ {t('Enter a positive step to use this progression rule.')}
+
}
>
}
@@ -592,9 +602,12 @@ function ExConfig({ ex, existing, onSave, onDelete, close, routine, initial }) {
// Both default from the dataset and are then whatever the config says — see isBw.
const bw = !cardio && isBw({ ...c, id: ex.id })
const perSide = isPerSide(c)
+ const progressionPolicy = policyFor({ ...c, id: ex.id }, routine, mode)
+ const progressionStepInvalid = !progressionStepIsValid(progressionStepOf(c, mode, ex, st.unit), progressionPolicy)
// Keep whatever the other mode already had (sets, weight) and fill only what is missing.
const setMode = m => setC(x => ({ ...defaultConfig(ex.id, m), ...x, mode: m }))
const save = () => {
+ if (progressionStepInvalid) return
close()
const sets = Math.max(1, Math.round(c.sets) || (cardio ? 1 : 3))
// Only carry progression settings that differ from the inherited default, so a plan file
@@ -768,7 +781,7 @@ function ExConfig({ ex, existing, onSave, onDelete, close, routine, initial }) {