Skip to content

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.

fix(session-start): progression-off rows from last time say so, and the MCP preview names the source (#217)

Duarte Santosab934435236c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 242f3f204..485d0f770 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -78,6 +78,10 @@ per muscle. Settings → Workout → Fine-tuning turns it off.
Stats, the report and the coach. Off by default, and records ignore warm-ups either way.
- **Lifted in total.** Stats has a new tile with everything you've ever lifted, imports included.
Spoiler: it's a lot.
+- **"No automatic progression" remembers what you did** (#217, thanks @iggaM23). With Settings →
+ Workout → Fine-tuning → Planned sessions start from → Your last session, an exercise with
+ progression off now opens at last time's weight and reps, the way Strong does it, and the card says so. "Your
+ plan" (the default) still opens at the routine's own numbers, and deload routines keep theirs.
**Security.** Follow-ups to v1.4.2's audit.
- **Pairing the phone app asks you to confirm it's you** (passkey, or your password where that
diff --git a/frontend/src/lib/session-start.js b/frontend/src/lib/session-start.js
index 007207ff7..c29a1bbda 100644
--- a/frontend/src/lib/session-start.js
+++ b/frontend/src/lib/session-start.js
@@ -75,7 +75,8 @@ export function buildPlannedEntry(stored, cfg, routine, { noProg = false } = {})
// Rows that opened at last session's reps rather than the plan's ("Your last session", and no
// policy that decided reps), so the workout card can say where the number came from. Written
// only when true, and never saved with the finished workout.
- const carried = !planReps && plan.kind !== 'off' && plan.reps == null && modeOf(cfg) === 'reps'
+ // An exercise with progression off that opened at last time's numbers (fromLast) says so too.
+ const carried = !planReps && (plan.kind !== 'off' || fromLast) && plan.reps == null && modeOf(cfg) === 'reps'
&& rows.some(s => !isWarmupRow(s) && s.r !== cfg.reps)
// `planned` is what the routine asked for, kept apart from the target the prescription moved,
// so the next session can tell an edited plan from a progressed one (nextPrescription).
diff --git a/frontend/src/lib/session-start.plan.test.js b/frontend/src/lib/session-start.plan.test.js
index f727f1edd..cb7c6c5e5 100644
--- a/frontend/src/lib/session-start.plan.test.js
+++ b/frontend/src/lib/session-start.plan.test.js
@@ -293,6 +293,15 @@ describe('"Your last session" for an exercise with progression off', () => {
expect(work(e).map(s => [s.w, s.r])).toEqual([[60, 7], [60, 7]])
})
+ it('says on the card that the numbers are last time\'s (#217)', () => {
+ const st = state(routine(), { startFrom: 'last' })
+ train(st, ['A'], last)
+ expect(start(st, ['A'])[0].carried).toBe(true)
+ // "Your plan" opened at the routine's own 2 × 10, so there is nothing to explain.
+ st.startFrom = 'plan'
+ expect(start(st, ['A'])[0].carried).toBeUndefined()
+ })
+
it('does the same for a routine that never set a weight', () => {
const st = state(routine({ weight: 0 }), { startFrom: 'last' })
train(st, ['A'], last)
diff --git a/mcp/src/tools.js b/mcp/src/tools.js
index f3badd6b2..64cb93a78 100644
--- a/mcp/src/tools.js
+++ b/mcp/src/tools.js
@@ -515,7 +515,13 @@ export const muscleBalance = {
function sourceOf(S, cfg, plan, field, routine) {
// Progression off (or a deload routine): the session is built from the routine's own target,
// exactly as session-start.js does with useTarget — history and the confirmed weight are ignored.
- if (!plan || plan.kind === 'off') return 'routine_plan'
+ // Except progression off under "start from your last session" (#217): there both the weight and
+ // the reps are last time's, when there is a last time. A deload routine keeps its own numbers.
+ if (!plan) return 'routine_plan'
+ if (plan.kind === 'off') {
+ const fromLast = startsFromLast(S) && routine?.excludeFromProgression !== true
+ return fromLast && lastEntryFor(S, cfg.id, routine && routine.id) ? 'last_session' : 'routine_plan'
+ }
const decided = plan.kind !== 'first' && plan[field] != null
// A policy that settles on the routine's own reps or hold — a restart after the plan was
// edited, a bodyweight hold at the plan's count — is the plan speaking, not an override.
diff --git a/mcp/test/tools.test.js b/mcp/test/tools.test.js
index fe91fb88f..6eb1f1970 100644
--- a/mcp/test/tools.test.js
+++ b/mcp/test/tools.test.js
@@ -1185,6 +1185,28 @@ describe('preview_session', () => {
expect(out.overridden_count).toBe(0)
})
+ test('progression off under "start from your last session" reports last time as the source (#217)', () => {
+ only({ id: '0025', sets: 2, reps: 8, weight: 50 }, {
+ prog: 'off',
+ workouts: [{
+ id: 'w1', d: '2026-07-20', routineId: 'r-preview', name: 'Preview',
+ entries: [{ id: '0025', target: { id: '0025', sets: 2, reps: 8, weight: 50 }, sets: [{ w: 60, r: 6, done: true }, { w: 60, r: 6, done: true }] }]
+ }]
+ })
+ S.startFrom = 'last'
+ _seedStateForTests(S)
+ try {
+ const e = call('preview_session').exercises[0]
+ expect(e.prescription.kind).toBe('off')
+ expect(e.opening_sets.map(s => [s.w, s.r])).toEqual([[60, 6], [60, 6]])
+ expect(e.weight_source).toBe('last_session')
+ expect(e.reps_source).toBe('last_session')
+ } finally {
+ delete S.startFrom
+ _seedStateForTests(S)
+ }
+ })
+
test('a deload routine (excludeFromProgression) opens its own numbers even under a policy', () => {
only({ id: '0025', sets: 3, reps: 5, weight: 50 }, {
prog: 'linear', routine: { excludeFromProgression: true },