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
fix: decrement cur when the removed entry sits below it (superset picker case)
root237d1c5cf265
diff --git a/frontend/src/views/Workout.jsx b/frontend/src/views/Workout.jsxindex 93ad58885..1e7242cb7 100644--- a/frontend/src/views/Workout.jsx+++ b/frontend/src/views/Workout.jsx@@ -178,6 +178,7 @@ export function removeActiveExercise(idx) {if (idx < 0 || idx >= s.active.entries.length) returns.active.entries.splice(idx, 1)cleanupSg(s.active.entries)+ if (idx < s.active.cur) s.active.cur--if (s.active.cur >= s.active.entries.length) s.active.cur = Math.max(0, s.active.entries.length - 1)}, true)}diff --git a/frontend/src/views/Workout.remove.test.jsx b/frontend/src/views/Workout.remove.test.jsxindex f1c2d0a4f..1243c3934 100644--- a/frontend/src/views/Workout.remove.test.jsx+++ b/frontend/src/views/Workout.remove.test.jsx@@ -22,11 +22,11 @@ const entry = (id, sg) => ({let rootlet container-function setActive(entries) {+function setActive(entries, cur = 0) {const S = clone(DEF)S.active = {id: 'remove-test', d: '2026-08-11', start: Date.now(), routineId: null,- name: 'Remove test', bw: null, cur: 0, entries+ name: 'Remove test', bw: null, cur, entries}useStore.setState({ S, user: null })}@@ -75,7 +75,8 @@ describe('active-session exercise removal', () => {})it('cancels a pending timed callback before indexes shift and cleans a one-member group', () => {- setActive([entry('1001', 'sg-1'), entry('1002', 'sg-1'), entry('1003')])+ setActive([entry('1001', 'sg-1'), entry('1002', 'sg-1'), entry('1003')], 1)+ expect(useStore.getState().S.active.cur).toBe(1)const wrongWrite = vi.fn(elapsed => {useStore.getState().update(s => { s.active.entries[0].sets[0].sec = elapsed })})@@ -88,6 +89,7 @@ describe('active-session exercise removal', () => {expect(useUI.getState().work).toBeNull()expect(wrongWrite).not.toHaveBeenCalled()expect(active.entries.map(e => e.id)).toEqual(['1002', '1003'])+ expect(active.cur).toBe(0)expect(active.entries[0].sg).toBeUndefined()expect(active.entries[0].sets[0].sec).toBeUndefined()})