Repository navigation
fix(warm-ups): a barbell warm-up is never lighter than the bar - #409
Open
kurktchiev wants to merge 1 commit into
Open
kurktchiev wants to merge 1 commit into
kurktchiev wants to merge 1 commit into
Conversation
Warm-up rows halve the gap from 0 toward the work weight, so a 55 lb barbell press planned with two warm-ups opened at 25 and 40 lb. Neither fits on a 45 lb bar. history.js barFloor reads the bar from bar.js barWeightFor: the athlete's own bar weight for that exercise, 0 when they set "no bar", else the default for the bar type in their unit. buildSets, insertWarmupRow, rerampWarmups and applyPrescription take it as the lightest rung they will build, and never go past the work weight when the bar is heavier. The session builder (session-start.js) and the in-session "Add warm-up set" button pass it in. Dumbbell, machine, cable and bodyweight lifts have no bar and ramp as before. The routine sheet's warm-up help says so, in all 17 packs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
kurktchiev
force-pushed
the
gh/warmup-bar-floor
branch
from
October 7, 2026 17:25
d136c51 to
ce69b83
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A 55 lb barbell press planned with two warm-up sets opens at 25 and 40 lb, and neither fits on a 45 lb bar. Each warm-up row halves the gap left to the work weight, starting from 0: insertWarmupRow builds each planned row, then rerampWarmups runs again once the prescription has moved the work weight. Nothing in that ramp knows the lift is done with a bar.
barFloor(S, exId)in history.js returns bar.jsbarWeightFor, or 0 for a lift without a bar. Both ramp computations, in insertWarmupRow and rerampWarmups, now keep a rung at or above that floor and at or below the work weight. buildSets reads the floor from S. applyPrescription takes it as a new last argument (default 0), and buildPlannedEntry passes it. The in-session "Add warm-up set" button passes it to insertWarmupRow. Session start, logging a past workout, editing, adding or swapping an exercise mid-session, combined routines and "Repeat today" all build through buildSets or buildPlannedEntry, so they get the floor with no change of their own. So does the MCPpreview_session, but only for built-in exercises until #412 lands. The MCP server doesn't register custom exercises, so a custom barbell lift at 30 kg with two warm-ups still previews 15 / 22.5.The floor follows the athlete's own bar setting for that exercise:
Dumbbell, cable, machine and bodyweight lifts have no bar and ramp as before.
I ran the old and the new code on the barbell bench press (0025), lb profile with a 5 lb step unless noted:
The routine sheet's warm-up help now reads "Each one closes half the gap to the work weight, never below the bar on a barbell lift", in all 17 packs. The new lines were translated with Claude, and no native speaker has checked them in any pack. German and Hungarian say "never lighter than the empty bar" («nie leichter als die leere Stange», «soha nem könnyebb az üres rúdnál»), because the earlier «nie unter der leeren Stange» and «soha nem az üres rúd alatt» read as physically under the bar. I wrote the zh-TW line during the rebase. @nauish, since you added the pack in #368, could you check it?
Tests:
#312 replaces buildSets, rerampWarmups and applyPrescription with its engine. Beyond the conflicts it already has with main, it conflicts with this branch in
lib/session-start.jsandlib/session-start.test.js. Its warm-up planner (planWarmupRowsin api/engine/warmup.js) works in percentages of the work weight and does not read the bar. One more open PR conflicts with this branch: #443 inviews/Workout.test.jsx. No other open PR gains a conflict from this branch.🤖 Generated with Claude Code