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: editing an exercise keeps a per-side set with one side done (#636)
Space-Hermesae2070aa34bf
diff --git a/frontend/src/views/Workout.jsx b/frontend/src/views/Workout.jsxindex 67739164d..1c255bb1a 100644--- a/frontend/src/views/Workout.jsx+++ b/frontend/src/views/Workout.jsx@@ -1593,8 +1593,10 @@ function ActiveWorkout() {// by hand keeps its prescription, so its Undo leaves the numbers it should count at.const built = buildPlannedEntry(sessionHistory(s), full, activeRoutine, { noProg: builtOutOfProgression(activeEntry, activeRoutine) })const fresh = built.sets- const doneWarm = activeEntry.sets.filter(x => x.done && isWarmupRow(x))- const doneWork = activeEntry.sets.filter(x => x.done && !isWarmupRow(x))+ // A per-side set with one side ticked is logged work too, not a row to rebuild.+ const logged = x => x.done || x.sides?.L?.done || x.sides?.R?.done+ const doneWarm = activeEntry.sets.filter(x => logged(x) && isWarmupRow(x))+ const doneWork = activeEntry.sets.filter(x => logged(x) && !isWarmupRow(x))const freshWarm = fresh.filter(isWarmupRow)const freshWork = fresh.filter(x => !isWarmupRow(x))activeEntry.target = built.targetdiff --git a/frontend/src/views/Workout.test.jsx b/frontend/src/views/Workout.test.jsxindex 459f43e9b..014462541 100644--- a/frontend/src/views/Workout.test.jsx+++ b/frontend/src/views/Workout.test.jsx@@ -1197,6 +1197,19 @@ describe('progression settings rebuild the rows like a session start', () => {expect(saved.sets.map(s => s.r)).toEqual([15, 15])expect(saved.target.reps).toBe(10)})++ // A per-side set with only its left side ticked is logged work too: a rebuild dropped it (#636).+ it('keeps a per-side set that has only one side done', async () => {+ const half = { w: 20, r: 10, done: false, sides: { L: { w: 20, r: 10, done: true }, R: { w: 20, r: 10, done: false } } }+ await mount([exercise('plain-bench', [false, false], { plan, target: { mode: 'reps', sets: 2, reps: 10, weight: 20, side: true },+ sets: [half, { w: 20, r: 10, done: false, sides: { L: { w: 20, r: 10, done: false }, R: { w: 20, r: 10, done: false } } }] })], 0)+ await pressProgression()+ const save = mocks.exConfigSheet.mock.calls.at(-1)[2]+ await act(async () => { save({ mode: 'reps', sets: 3, reps: 8, weight: 20, side: true }) })+ const sets = mocks.S.active.entries[0].sets+ expect(sets).toHaveLength(3)+ expect(sets[0].sides.L).toMatchObject({ done: true, r: 10 })+ })})// The settings sheet edits the plan, so it opens at the plan's sets and reps, not at today's