Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
Workout: 'Update routine' names a rest as the wheel does
Duarte Santos2e81c9f2d6e2
diff --git a/frontend/src/views/Workout.jsx b/frontend/src/views/Workout.jsxindex 2a1fca9fa..cf37aebc9 100644--- a/frontend/src/views/Workout.jsx+++ b/frontend/src/views/Workout.jsx@@ -986,6 +986,7 @@ function ActiveWorkout() {// edits it (lib/session-routines.js). This is the explicit way to keep them — an item in the// exercise's ⋯ menu, there only while the routine's slot says something else than the session// did. Sets, reps and weight are not part of it (routineChangesFromEntry).+ const restWord = v => (Number(v) > 0 ? fmtRest(v) : t('Default ({0})', fmtRest(S.restSec)))const routineUpdateFor = idx => {const entry = A.entries[idx]const routine = !editing && entry?.rid ? S.routines.find(r => r.id === entry.rid) : null@@ -994,8 +995,10 @@ function ActiveWorkout() {const activeId = A.idconst entryId = entry.idreturn {+ // A rest reads as the wheel shows it: "3:00", and 0 (no rest of its own) as the default.sub: found.changes.map(c => c.key === 'note' ? t('Note')- : (c.key === 'warmupSets' ? t('Warm-up sets') : t('Rest (s)')) + ' ' + c.from + ' → ' + c.to).join(' · '),+ : c.key === 'warmupSets' ? t('Warm-up sets') + ' ' + c.from + ' → ' + c.to+ : t('Rest') + ' ' + restWord(c.from) + ' → ' + restWord(c.to)).join(' · '),run: () => confirmSheet({title: t('Update “{0}”?', routine.name),message: t('Copy this exercise’s warm-up sets, and the rest and note from its Exercise settings, into the routine. A note added for today stays with this workout. Your workout history is kept.'),diff --git a/frontend/src/views/Workout.test.jsx b/frontend/src/views/Workout.test.jsxindex 2d0101eac..7eff8d1cb 100644--- a/frontend/src/views/Workout.test.jsx+++ b/frontend/src/views/Workout.test.jsx@@ -2124,12 +2124,18 @@ describe('Update routine, from the More menu of an exercise', () => {it('names the rest and note edited on the settings sheet mid-session', async () => {await mount([ownEntry({ target: { mode: 'reps', reps: 5, weight: 60, restSec: 150, note: 'pause on the chest' } })], 0, { routines: [routine({ restSec: 90 })] })await openMore()- expect(item('Update routine').sub).toBe('Rest (s) 90 → 150 · Note')+ expect(item('Update routine').sub).toBe('Rest 1:30 → 2:30 · Note')item('Update routine').onClick()mocks.confirmSheet.mock.calls[0][0].onConfirm()expect(mocks.S.routines[0].ex[0]).toMatchObject({ restSec: 150, note: 'pause on the chest' })})+ it('names a slot with no rest of its own as the default, as the wheel does', async () => {+ await mount([ownEntry({ target: { mode: 'reps', reps: 5, weight: 60, restSec: 180 } })], 0, { routines: [routine()] })+ await openMore()+ expect(item('Update routine').sub).toBe('Rest Default (1:30) → 3:00')+ })+it('leaves the note added for today with the workout, and says so before confirming', async () => {// "Add note" in the ⋯ menu is today's note (entry.note, kept with the finished workout and// optionally pinned for next time); the routine's own note is the one on Progression settings.