Skip to content

fix(workout): editing a warm-up's weight leaves the later warm-ups on their ramp - #442

Open
kurktchiev wants to merge 1 commit into
DuarteSantos8:mainfrom
kurktchiev:gh/warmup-edit-keeps-ramp
Open

kurktchiev wants to merge 1 commit into
DuarteSantos8:mainfrom
kurktchiev:gh/warmup-edit-keeps-ramp

Conversation

@kurktchiev

@kurktchiev kurktchiev commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Editing the weight of one warm-up set during a workout copies the new weight onto every later warm-up that isn't done yet. On an incline bench at 125 lb with three planned warm-ups (60 / 90 / 105), setting the first one to 65 turns the ramp into 65 / 65 / 65, and each later rung has to be put back by hand.

The copying is cascadeWeight in lib/history.js, which setField and setSide in views/Workout.jsx call after every weight edit. It carries an edit forward to the later rows of the same phase that are not done and not edited by hand. That made sense when "Add warm-up set" copied the row before it (86ac937). Since 0863aa7 and 287550d the warm-ups ramp toward the work weight, each rung at its own load, and the rule flattens them.

cascadeWeight now returns early when the edited row is a warm-up, and only work sets receive a cascade. The edited row is still marked as edited by hand. A work-set edit behaves as before. It carries through the later inherited work sets and never reaches back into the ramp.

I ran the same edits on main and on this branch: barbell incline bench (0047), lb profile, 5 lb step, { sets: 4, reps: 8, weight: 125, warmupSets: 3 } through buildSets, then the edit the way setField makes it.

edit main this branch
none 60 / 90 / 105 / 125 ×4 same
warm-up 1 → 65 65 / 65 / 65 / 125 ×4 65 / 90 / 105 / 125 ×4
warm-up 2 → 100 60 / 100 / 100 / 125 ×4 60 / 100 / 105 / 125 ×4
work set 1 → 130 60 / 90 / 105 / 130 ×4 same

One-side warm-ups follow the same rule. With two one-side warm-ups at 10 and 15 lb, setting the left side of the first to 5 used to set the left side of the second to 5 as well. It now stays at 15.

Tests:

  • history.test.js: two new tests, the built ramp above and the one-side case. The existing "cascadeWeight keeps phase-only warm-ups in their own lane" expected the old copying; it now expects the later warm-up to keep its load, and its name says so. All three fail on main. The file passes 188 tests.
  • The full frontend suite passes on 39bc71e.
  • check-locales.mjs: 17 locales, 1,979 keys each. check-source-strings.mjs --strict: 1,555 strings. No strings change. The production build passes.

No open PR gains a conflict from this branch.

🤖 Generated with Claude Code

… their ramp

cascadeWeight copied an edited load onto every later undone row of the same
phase. That suited warm-ups when "Add warm-up set" cloned the row before it
(86ac937). Since warm-ups ramp (0863aa7, 287550d), each rung halving the gap
to the work weight, editing rung 1 of 60/90/105 flattened the ramp to 65/65/65
and every later rung had to be put back by hand.

A warm-up edit now stays on its own row, whole-row and one-side alike. A
work-set edit still carries through the later inherited work sets and never
reaches into the ramp. The phase-only warm-up test flips to the new rule; two
new tests cover the built ramp and the one-side case.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@kurktchiev
kurktchiev force-pushed the gh/warmup-edit-keeps-ramp branch from 7a9a5b2 to c2a5207 Compare October 7, 2026 17:25
crstnmac added a commit to crstnmac/openGym that referenced this pull request Oct 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant