Config sheet: a stepper is not a list-row accessory
Added weight sat inside a list row next to its label, which is fine for a switch and wrong for a stepper: the control took the width it needed and left the text column wrapping one word per line. It now gets the same full-width treatment as sets and reps, with the explanation underneath, and reuses the "Added (kg)" label the set table already uses. Also stops a long value overlapping its own title in a list row — flex:none meant "Follow the routine (Linear progression)" ran straight through "Rule", since the title's column was already free to shrink to nothing. The value shrinks and ellipsises instead. Pre-existing, visible in every settings row with a long value.
This commit is contained in:
1 parent
a5e360cde5
commit
1e86d6ace2
13 files changed
+17
-16
No files matched your search
+12
-4
@@ -561,10 +561,6 @@ function ExConfig({ ex, existing, onSave, onDelete, close, routine }) {
|
||||
subtitle={bw ? t('No weight to enter — just log the reps.') : t('Ask for a weight on every set.')}>
|
||||
<Switch checked={bw} onChange={v => setC(x => ({ ...x, bodyweight: v, weight: v ? 0 : x.weight }))} />
|
||||
</Row>
|
||||
{bw && <Row icon="plus" iconTint="var(--indigo)" title={t('Added weight')}
|
||||
subtitle={t('For dips or pull-ups with a belt. Progression then follows the weight.')}>
|
||||
<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('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
|
||||
@@ -572,6 +568,18 @@ function ExConfig({ ex, existing, onSave, onDelete, close, routine }) {
|
||||
<Switch checked={perSide} onChange={v => setC(x => ({ ...x, side: v || undefined, reps: v ? Math.ceil((x.reps || 0) / 2) * 2 : x.reps }))} />
|
||||
</Row>}
|
||||
</div>}
|
||||
{/* A stepper is too wide to sit in a list row next to a label — it squeezes the text to
|
||||
one word per line — so added weight gets the same full-width treatment as sets and
|
||||
reps, with its explanation underneath. */}
|
||||
{bw && <>
|
||||
<div className="row cfgrow" style={{ marginBottom: 8 }}>
|
||||
<Stepper label={t('Added ({0})', st.unit)} value={c.weight || 0} step={2.5}
|
||||
onChange={v => setC(x => ({ ...x, weight: v }))} />
|
||||
</div>
|
||||
<div className="small dim" style={{ marginBottom: 18 }}>
|
||||
{t('For dips or pull-ups with a belt. Progression then follows the weight.')}
|
||||
</div>
|
||||
</>}
|
||||
{/* The rep ceiling only means something when there is no load to add instead. */}
|
||||
{mode === 'reps' && bw && !(c.weight > 0) && <div className="row cfgrow" style={{ marginBottom: 18 }}>
|
||||
<Stepper label={t('Top of the range')} value={c.repsMax || 0} step={1} decimal={false}
|
||||
|
||||
Reference in new issue
Block a user