From c3929b0a70ba1a5e0c8e6e10b8038f16663f9498 Mon Sep 17 00:00:00 2001 From: Octavio Di Marco Date: Thu, 30 Jul 2026 19:20:00 +0200 Subject: [PATCH] Remove RIR auto-check; gate the column behind a setting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two blockers from review: - NumberField.commit() fires onChange on every keystroke, so typing a decimal RIR (e.g. 1.5) committed the auto-check after the first character, before the value was finished — and the same auto-check turned a stray tap on an empty field's "−" (or clearing it) into a permanent "RIR 0", since 0 is indistinguishable from unset once the key exists on the set. Logging RIR is back to a plain field with no side effect; the checkbox is the only way to mark a set done, same as weight and reps. - The RIR stepper narrowed every reps-mode row's +/- buttons for everyone, including the majority not running an RIR-based program. It's now behind a `showRir` setting (Settings → Units & timer, default off), so the existing row is untouched unless opted in. --- frontend/src/store/useStore.js | 2 +- frontend/src/views/Settings.jsx | 3 +++ frontend/src/views/Workout.jsx | 27 ++++++++++----------------- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/frontend/src/store/useStore.js b/frontend/src/store/useStore.js index 5004767..9bdb253 100644 --- a/frontend/src/store/useStore.js +++ b/frontend/src/store/useStore.js @@ -11,7 +11,7 @@ export const DEF = { theme: 'dark', accent: 'lime', body: 'male', targetW: null, bodyweight: [], routines: [], week: {}, dayPlan: {}, exWeights: {}, workouts: [], active: null, customEx: [], gifSize: 'full', - reminder: { on: false, time: '08:00', tz: null } + reminder: { on: false, time: '08:00', tz: null }, showRir: false } const clone = o => JSON.parse(JSON.stringify(o)) diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsx index 86f8763..59fee80 100644 --- a/frontend/src/views/Settings.jsx +++ b/frontend/src/views/Settings.jsx @@ -133,6 +133,9 @@ export default function Settings() { update(s => { s.sound = v })} /> + + update(s => { s.showRir = v })} /> + {(user || MOBILE) && } diff --git a/frontend/src/views/Workout.jsx b/frontend/src/views/Workout.jsx index a3322c1..ba8b19f 100644 --- a/frontend/src/views/Workout.jsx +++ b/frontend/src/views/Workout.jsx @@ -75,25 +75,18 @@ function ExerciseBlock({ entryIdx, compact, onToggle, onField, onAddSet, onRemov const col2 = cardio ? { f: 'speed', step: 0.5, dec: true, hd: t('Speed (km/h)') } : timed ? { f: 'w', step: 2.5, dec: true, hd: t('Weight ({0})', S.unit) } : { f: 'r', step: 1, dec: false, hd: t('Reps') } - // RIR (reps in reserve) only makes sense for weighted rep sets, not cardio/timed holds. - const col3 = mode === 'reps' ? { f: 'rir', step: 0.5, dec: true, hd: t('RIR') } : null + // RIR (reps in reserve) only makes sense for weighted rep sets, not cardio/timed holds, + // and is opt-in (Settings) since it adds a third stepper to every row. + const col3 = mode === 'reps' && S.showRir ? { f: 'rir', step: 0.5, dec: true, hd: t('RIR') } : null // Uses the shared stepper markup so a set row picks up the same control styling // as every other +/- field in the app. - const cell = (s, i, col, cls) => { - // Logging RIR is the last thing you do for a set — it means you just finished it, so it - // checks the set off by itself instead of making you tap Done separately. Only fires once - // (guarded by !s.done) so editing RIR on an already-done set doesn't re-trigger the beep/ - // rest timer, and never applies to weight/reps, which you can set before you've lifted. - const markDoneFromRir = () => { if (col.f === 'rir' && !s.done) onToggle(i) } - const set = v => { onField(i, col.f, v); markDoneFromRir() } - return ( -
- - - -
- ) - } + const cell = (s, i, col, cls) => ( +
+ + onField(i, col.f, v)} /> + +
+ ) return <>