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(warm-ups): a barbell warm-up is never lighter than the bar

Boris 'B' Kurktchievce69b8381eea
diff --git a/frontend/src/lib/history.js b/frontend/src/lib/history.js
index 7247ac061..b972b213d 100644
--- a/frontend/src/lib/history.js
+++ b/frontend/src/lib/history.js
@@ -2,6 +2,7 @@
import { todayISO, isoOf, weekKey, weekStartOf, fmtNum } from './format.js'
import { fmtSpeed } from './speed.js'
import { isCardio, isBodyweightEq, isAssisted, betterWeight } from './exercises.js'
+import { barWeightFor } from './bar.js'
import { phaseForSet, modeForSet, modeForEntry, isWarmupRow, isDropSet, isRestPauseSet, normalizeMode, completedVolumeOf, hasCompletedWork, nextDropWeight, splitBurstReps, makeSideSet, isSideSet, syncSideAggregate, WEIGHT_ORIGIN_MANUAL, dropsOf, clustersOf } from './workout-model.js'
const objectOf = value => value && typeof value === 'object' && !Array.isArray(value) ? value : {}
// Completed-state-independent work rows whose authoritative mode matches the requested mode.
@@ -477,8 +478,9 @@ export function nextTrainingDay(S, iso) {
*
* The warm-ups are stacked with insertWarmupRow, one call each, so the ramp is the same one
* the in-session "Add warm-up set" button produces: each row halves the gap left to the work
- * weight, giving 50% / 75% / 87.5% for three. `options.step` is the exercise's loading step,
- * passed in by the caller (see insertWarmupRow for why this module cannot read it itself).
+ * weight, giving 50% / 75% / 87.5% for three, and never under the bar on a barbell lift
+ * (barFloor). `options.step` is the exercise's loading step, passed in by the caller (see
+ * insertWarmupRow for why this module cannot read it itself).
*/
export function buildSets(S, cfg, options = {}) {
const rows = buildWorkSets(S, cfg, options)
@@ -486,13 +488,21 @@ export function buildSets(S, cfg, options = {}) {
if (!warm) return rows
const mode = modeOf(cfg)
let out = rows
- for (let i = 0; i < warm; i++) out = insertWarmupRow(out, mode, cfg, options.step)
+ const floor = barFloor(S, cfg.id)
+ for (let i = 0; i < warm; i++) out = insertWarmupRow(out, mode, cfg, options.step, floor)
return out
}
/** Beyond this a "warm-up" is its own workout; the config stepper stops here too. */
export const MAX_PLANNED_WARMUPS = 5
+/**
+ * The lightest warm-up a lift can have: the bar it is done with (bar.js barWeightFor, the
+ * athlete's own bar weight included), 0 for anything without one. Half of a 55 lb press is
+ * 25 lb, which no one can load onto a 45 lb bar, so a warm-up rung never goes under it.
+ */
+export const barFloor = (S, exId) => barWeightFor(S, exId) || 0
+
function buildWorkSets(S, cfg, options = {}) {
const preferLast = !!options.preferLast
const useTarget = !!options.useTarget
@@ -869,9 +879,10 @@ export function cascadeWeight(rows, from, value, side) {
*
* A warm-up already logged keeps its weight and becomes what the next one ramps from: it
* happened, and rewriting performed work is data loss. Entries with nothing to ramp toward
- * — cardio, bodyweight, an unloaded hold — are returned untouched.
+ * — cardio, bodyweight, an unloaded hold — are returned untouched. `floor` is the lift's bar
+ * (barFloor): no open warm-up is ramped under it.
*/
-export function rerampWarmups(rows, step = 2.5) {
+export function rerampWarmups(rows, step = 2.5, floor = 0) {
const firstWork = rows.findIndex(x => !isWarmupRow(x))
if (firstWork <= 0) return rows
const target = rows[firstWork].w || 0
@@ -881,7 +892,7 @@ export function rerampWarmups(rows, step = 2.5) {
for (let i = 0; i < firstWork; i++) {
if (out[i].done) { from = out[i].w || 0; continue }
const w = target > from
- ? Math.max(0, Math.min(target, Math.floor((from + (target - from) / 2) / step) * step))
+ ? Math.min(target, Math.max(0, floor, Math.floor((from + (target - from) / 2) / step) * step))
: target
out[i] = { ...out[i], w }
from = w
@@ -889,7 +900,7 @@ export function rerampWarmups(rows, step = 2.5) {
return out
}
-export function insertWarmupRow(rows, mode, target, step = 2.5) {
+export function insertWarmupRow(rows, mode, target, step = 2.5, floor = 0) {
const firstWork = rows.findIndex(x => !isWarmupRow(x))
const at = firstWork === -1 ? rows.length : firstWork
const prev = at > 0 ? rows[at - 1] : null // the warm-up this one ramps from
@@ -903,8 +914,9 @@ export function insertWarmupRow(rows, mode, target, step = 2.5) {
// let it propagate down the block. A warm-up is never heavier than the set it warms up for.
if (to <= from) return to
// Rounded DOWN to the step: a warm-up that lands a notch light costs nothing, one that
- // lands a notch heavy is a set you have to strip plates off before you can use it.
- return Math.max(0, Math.min(to, Math.floor((from + (to - from) / 2) / step) * step))
+ // lands a notch heavy is a set you have to strip plates off before you can use it. Never
+ // under `floor` (barFloor), and never over the work weight even when the bar is heavier.
+ return Math.min(to, Math.max(0, floor, Math.floor((from + (to - from) / 2) / step) * step))
}
const warm = mode === 'cardio'
? {
diff --git a/frontend/src/lib/history.test.js b/frontend/src/lib/history.test.js
index b3f43aeac..c54a154dc 100644
--- a/frontend/src/lib/history.test.js
+++ b/frontend/src/lib/history.test.js
@@ -471,6 +471,29 @@ describe('freestyleConfig', () => {
expect(rows.slice(3).every(r => r.phase === undefined)).toBe(true)
})
+ // A 55 lb bench used to get warm-ups at 25 and 40 lb, lighter than the 45 lb bar it is done
+ // with. A barbell rung never goes under the bar; everything without a bar ramps as before.
+ it('never ramps a barbell warm-up below the bar it is done with', () => {
+ const S = { unit: 'lb', exWeights: {}, workouts: [] }
+ const bench = { id: '0025', mode: 'reps', sets: 3, reps: 10, weight: 55, warmupSets: 1 }
+ expect(buildSets(S, bench, { step: 5 }).map(r => r.w)).toEqual([45, 55, 55, 55])
+ // two rungs from the bar: 45, then half the gap left
+ expect(buildSets(S, { ...bench, warmupSets: 2 }, { step: 5 }).map(r => r.w).slice(0, 2)).toEqual([45, 50])
+ // heavy lifts ramp exactly as before: every rung is above the bar anyway
+ expect(buildSets(S, { ...bench, weight: 135, warmupSets: 3 }, { step: 5 }).map(r => r.w).slice(0, 3)).toEqual([65, 100, 115])
+ // the athlete's own bar weight wins, and "no bar" (0) floors nothing
+ expect(buildSets({ ...S, barWeights: { '0025': 35 } }, bench, { step: 5 })[0].w).toBe(35)
+ expect(buildSets({ ...S, barWeights: { '0025': 0 } }, bench, { step: 5 })[0].w).toBe(25)
+ // a bar heavier than the work weight still never makes a warm-up heavier than the work set
+ expect(buildSets({ ...S, barWeights: { '0025': 65 } }, bench, { step: 5 })[0].w).toBe(55)
+ // a dumbbell lift has no bar: half, as always
+ expect(buildSets(S, { id: '0289', mode: 'reps', sets: 1, reps: 10, weight: 50, warmupSets: 1 }, { step: 5 })[0].w).toBe(25)
+ // the in-session button takes the same floor
+ const rows = [{ w: 55, r: 10, done: false }]
+ expect(insertWarmupRow(rows, 'reps', bench, 5, 45)[0].w).toBe(45)
+ expect(insertWarmupRow(rows, 'reps', bench, 5)[0].w).toBe(25)
+ })
+
it('caps the planned warm-ups and ignores nonsense values', () => {
const S = { exWeights: {}, workouts: [] }
const base = { id: '0025', mode: 'reps', sets: 1, reps: 5, weight: 100 }
diff --git a/frontend/src/lib/progression.js b/frontend/src/lib/progression.js
index 12b2dfda7..b30e94103 100644
--- a/frontend/src/lib/progression.js
+++ b/frontend/src/lib/progression.js
@@ -604,9 +604,10 @@ export function nextPrescription(S, cfg, routine) {
/**
* Apply a prescription to freshly built sets. Only the fields the policy actually decided
- * are touched, and only on sets that have not been logged yet.
+ * are touched, and only on sets that have not been logged yet. `floor` is the lift's bar
+ * (history.js barFloor), which the re-ramped warm-ups never go under.
*/
-export function applyPrescription(sets, p, step = 2.5) {
+export function applyPrescription(sets, p, step = 2.5, floor = 0) {
if (!p || p.kind === 'off' || p.kind === 'first') return sets
const out = sets.map(s => {
// Never rewrite a logged set (a ticked warm-up falling through here would be the data-loss
@@ -642,7 +643,7 @@ export function applyPrescription(sets, p, step = 2.5) {
if (p.sets > workRows.length) {
// An all-warm-up entry has no work row to seed growth from - growing warm-up copies
// would both invent work and never terminate the loop. Leave the entry untouched.
- if (!workRows.length) return rerampWarmups(out, step)
+ if (!workRows.length) return rerampWarmups(out, step, floor)
const seed = workRows[workRows.length - 1]
// A freshly appended row hasn't been performed, so it never inherits a seed's already-
// logged drops/clusters — that would invent extra work the row never actually did. Its
@@ -657,5 +658,5 @@ export function applyPrescription(sets, p, step = 2.5) {
}
// Last, because the work rows now carry their final weight: the warm-up block ramps toward
// what you are actually about to lift, not toward what you lifted last time.
- return rerampWarmups(out, step)
+ return rerampWarmups(out, step, floor)
}
diff --git a/frontend/src/lib/progression.test.js b/frontend/src/lib/progression.test.js
index e16d2b40b..f35dfc84b 100644
--- a/frontend/src/lib/progression.test.js
+++ b/frontend/src/lib/progression.test.js
@@ -977,6 +977,12 @@ describe('applyPrescription', () => {
expect(applyPrescription(sets, { kind: 'up', weight: 42.5, reps: 8 })[1]).toEqual({ w: 42.5, r: 8, done: false })
})
+ it('re-ramps an open warm-up toward the new weight but never under the bar', () => {
+ const sets = [{ w: 25, r: 10, done: false, phase: 'warmup', warmup: true }, { w: 50, r: 10, done: false }]
+ expect(applyPrescription(sets, { kind: 'up', weight: 55 }, 5, 45).map(r => r.w)).toEqual([45, 55])
+ expect(applyPrescription(sets, { kind: 'up', weight: 55 }, 5).map(r => r.w)).toEqual([25, 55])
+ })
+
it('touches nothing for "off" or a first session', () => {
expect(applyPrescription(sets, { kind: 'off' })).toBe(sets)
expect(applyPrescription(sets, { kind: 'first' })).toBe(sets)
diff --git a/frontend/src/lib/session-start.js b/frontend/src/lib/session-start.js
index d0d2d6ec3..c9ad593f3 100644
--- a/frontend/src/lib/session-start.js
+++ b/frontend/src/lib/session-start.js
@@ -3,7 +3,7 @@
// to identical entries, or the two paths drift apart the first time a prescription rule changes.
// Imports both history.js and progression.js (which itself imports history.js); nothing in
// either imports this file, so there is no cycle.
-import { buildSets, applyIntensifierPlan, modeOf } from './history.js'
+import { buildSets, applyIntensifierPlan, modeOf, barFloor } from './history.js'
import { isWarmupRow } from './workout-model.js'
import { nextPrescription, applyPrescription, defaultIncrement, weightIncrement, plannedOf } from './progression.js'
import { dropGrid } from './plates.js'
@@ -33,7 +33,7 @@ export function buildPlannedEntry(st, cfg, routine, { noProg = false } = {}) {
// default for its optional load.
const step = modeOf(cfg) === 'reps' ? weightIncrement(cfg, st.unit) : defaultIncrement(cfg.id, st.unit)
const planReps = !startsFromLast(st)
- const rows = applyPrescription(buildSets(st, cfg, { step, rid: routine?.id, useTarget: plan.kind === 'off', planReps }), plan, step)
+ const rows = applyPrescription(buildSets(st, cfg, { step, rid: routine?.id, useTarget: plan.kind === 'off', planReps }), plan, step, barFloor(st, cfg.id))
const sets = applyIntensifierPlan(rows, cfg, dropGrid(st, cfg))
const target = { ...cfg }
if (plan.weight != null) target.weight = plan.weight
diff --git a/frontend/src/lib/session-start.test.js b/frontend/src/lib/session-start.test.js
index f7b2365fe..995341a10 100644
--- a/frontend/src/lib/session-start.test.js
+++ b/frontend/src/lib/session-start.test.js
@@ -86,6 +86,16 @@ describe('buildSessionEntries', () => {
expect(entry.sets.map(s => [isWarmupRow(s) ? 'warm' : 'work', s.r])).toEqual([['warm', 10], ['work', 10], ['work', 10]])
})
+ it('re-ramps a progressed barbell lift\'s warm-up from the bar, not from half the weight', () => {
+ const lb = { unit: 'lb', exWeights: {}, routines: [], workouts: [{ d: '2026-01-01', routineIds: ['r'], entries: [{ id: '0025', target: { sets: 2, reps: 10, weight: 50 }, sets: [10, 10].map(r => ({ w: 50, r, done: true })) }] }] }
+ const cfg = { id: '0025', sets: 2, reps: 10, weight: 50, prog: 'linear', warmupSets: 1 }
+ const [entry] = buildSessionEntries(lb, { id: 'r', prog: 'linear', ex: [cfg] })
+ expect(entry.plan.weight).toBe(55)
+ expect(entry.sets.map(s => s.w)).toEqual([45, 55, 55])
+ const [noBar] = buildSessionEntries({ ...lb, barWeights: { '0025': 0 } }, { id: 'r', prog: 'linear', ex: [cfg] })
+ expect(noBar.sets.map(s => s.w)).toEqual([25, 55, 55])
+ })
+
it('splits the plan\'s reps evenly per side', () => {
const cfg = { id: '0025', sets: 1, reps: 16, weight: 20, side: true, prog: 'linear' }
const side = (w, r) => ({ w, r, done: true })
diff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.js
index b92f6745e..e3f83a06e 100644
--- a/frontend/src/locales/ar.js
+++ b/frontend/src/locales/ar.js
@@ -719,7 +719,7 @@ export default {
'reps': 'تكرارات',
'Most reps in a set per workout': 'أكثر تكرارات في مجموعة لكل تمرين',
'Warm-up sets': 'مجموعات الإحماء',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': 'تُضاف قبل مجموعات العمل ولا تُحتسب في الحجم أو الأرقام القياسية أو التدرج. كل واحدة تقلص الفجوة إلى وزن العمل إلى النصف، ويمكنك تعديل أي منها أثناء الجلسة.',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': 'تُضاف قبل مجموعات العمل ولا تُحتسب في الحجم أو الأرقام القياسية أو التدرج. كل واحدة تقلص الفجوة إلى وزن العمل إلى النصف، ولا تقل أبدًا عن وزن البار في تمارين البار، ويمكنك تعديل أي منها أثناء الجلسة.',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': 'مجموعات إحماء تصاعدية تُضاف قبل مجموعات العمل، حتى لا تضطر لإضافتها يدويًا في كل جلسة.',
'Note': 'ملاحظة',
'This session': 'هذه الجلسة',
diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js
index 7fdb20e04..449bbae37 100644
--- a/frontend/src/locales/de.js
+++ b/frontend/src/locales/de.js
@@ -1042,7 +1042,7 @@ export default {
'reps': 'Wdh.',
'Most reps in a set per workout': 'Meiste Wdh. in einem Satz pro Training',
'Warm-up sets': 'Aufwärmsätze',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': 'Kommen vor deine Arbeitssätze und zählen nicht für Volumen, Rekorde und Progression. Jeder halbiert den Abstand zum Arbeitsgewicht, und im Training kannst du jeden davon trotzdem ändern.',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': 'Kommen vor deine Arbeitssätze und zählen nicht für Volumen, Rekorde und Progression. Jeder halbiert den Abstand zum Arbeitsgewicht, bei Langhantelübungen nie leichter als die leere Stange, und im Training kannst du jeden davon trotzdem ändern.',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': 'Aufwärmsätze vor den Arbeitssätzen, damit du sie nicht jedes Mal von Hand hinzufügen musst.',
'Note': 'Notiz',
'This session': 'Dieses Training',
diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js
index 592a333e1..30f2b9897 100644
--- a/frontend/src/locales/es.js
+++ b/frontend/src/locales/es.js
@@ -1024,7 +1024,7 @@ export default {
'reps': 'reps',
'Most reps in a set per workout': 'Más reps en una serie por entrenamiento',
'Warm-up sets': 'Series de calentamiento',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': 'Se añaden antes de tus series de trabajo y no cuentan para el volumen, los récords ni la progresión. Cada una reduce a la mitad la distancia hasta el peso de trabajo, y puedes cambiar cualquiera durante la sesión.',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': 'Se añaden antes de tus series de trabajo y no cuentan para el volumen, los récords ni la progresión. Cada una reduce a la mitad la distancia hasta el peso de trabajo, sin bajar nunca de la barra vacía en un ejercicio con barra, y puedes cambiar cualquiera durante la sesión.',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': 'Series de aproximación antes de las series de trabajo, para no añadirlas a mano cada vez.',
'Note': 'Nota',
'This session': 'Esta sesión',
diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js
index a6c2a3d84..0745c6d80 100644
--- a/frontend/src/locales/fr.js
+++ b/frontend/src/locales/fr.js
@@ -1024,7 +1024,7 @@ export default {
'reps': 'reps',
'Most reps in a set per workout': 'Plus de reps dans une série par séance',
'Warm-up sets': 'Séries d’échauffement',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': 'Ajoutées avant tes séries de travail et exclues du volume, des records et de la progression. Chacune réduit de moitié l’écart avec la charge de travail, et tu peux toujours les modifier pendant la séance.',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': 'Ajoutées avant tes séries de travail et exclues du volume, des records et de la progression. Chacune réduit de moitié l’écart avec la charge de travail, sans jamais descendre sous la barre à vide pour un exercice à la barre, et tu peux toujours les modifier pendant la séance.',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': 'Séries de montée en charge avant les séries de travail, pour ne pas les ajouter à la main chaque fois.',
'Note': 'Note',
'This session': 'Cette séance',
diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js
index 8c05a4933..440765d01 100644
--- a/frontend/src/locales/hi.js
+++ b/frontend/src/locales/hi.js
@@ -1024,7 +1024,7 @@ export default {
'reps': 'रेप्स',
'Most reps in a set per workout': 'प्रति कसरत एक सेट में सबसे ज़्यादा रेप्स',
'Warm-up sets': 'वार्म-अप सेट',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': 'ये आपके वर्क सेट से पहले जुड़ते हैं और वॉल्यूम, रिकॉर्ड तथा प्रोग्रेशन में नहीं गिने जाते। हर सेट वर्क वज़न तक बची दूरी को आधा कर देता है, और कसरत के बीच भी आप इनमें से किसी को बदल सकते हैं।',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': 'ये आपके वर्क सेट से पहले जुड़ते हैं और वॉल्यूम, रिकॉर्ड तथा प्रोग्रेशन में नहीं गिने जाते। हर सेट वर्क वज़न तक बची दूरी को आधा कर देता है, बारबेल लिफ़्ट में कभी खाली बार से हल्का नहीं होता, और कसरत के बीच भी आप इनमें से किसी को बदल सकते हैं।',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': 'वर्क सेट से पहले जुड़ने वाले तैयारी सेट, ताकि हर बार खुद जोड़ना न पड़े।',
'Note': 'नोट',
'This session': 'यह कसरत',
diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.js
index 3b8a3698f..696309c94 100644
--- a/frontend/src/locales/hu.js
+++ b/frontend/src/locales/hu.js
@@ -822,7 +822,7 @@ export default {
'This session': 'Ez az edzés',
'Note': 'Megjegyzés',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': 'Fokozatosan növekvő sorozatok a munkasorozatok elé, hogy ne kelljen minden edzésen kézzel hozzáadnod őket.',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': 'A munkasorozatok elé kerülnek, és kimaradnak a volumenből, a rekordokból és a progresszióból. Mindegyik a felére zárja a különbséget a munkasúlyhoz, és edzés közben is bármelyiket módosíthatod.',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': 'A munkasorozatok elé kerülnek, és kimaradnak a volumenből, a rekordokból és a progresszióból. Mindegyik a felére zárja a különbséget a munkasúlyhoz, rúddal végzett gyakorlatnál soha nem könnyebb az üres rúdnál, és edzés közben is bármelyiket módosíthatod.',
'Warm-up sets': 'Bemelegítő sorozatok',
'Most reps in a set per workout': 'Legtöbb ismétlés egy sorozatban edzésenként',
'reps': 'ism.',
diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js
index 81f392217..c90cd079f 100644
--- a/frontend/src/locales/it.js
+++ b/frontend/src/locales/it.js
@@ -1024,7 +1024,7 @@ export default {
'reps': 'rip.',
'Most reps in a set per workout': 'Più rip. in una serie per allenamento',
'Warm-up sets': 'Serie di riscaldamento',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': 'Vengono aggiunte prima delle serie di lavoro e non contano per volume, record e progressione. Ognuna dimezza la distanza dal peso di lavoro, e puoi comunque modificarle durante la sessione.',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': 'Vengono aggiunte prima delle serie di lavoro e non contano per volume, record e progressione. Ognuna dimezza la distanza dal peso di lavoro, senza mai scendere sotto il bilanciere scarico negli esercizi con bilanciere, e puoi comunque modificarle durante la sessione.',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': 'Serie di avvicinamento prima delle serie di lavoro, così non devi aggiungerle a mano ogni volta.',
'Note': 'Nota',
'This session': 'Questa sessione',
diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js
index fc4f356c8..adf043a23 100644
--- a/frontend/src/locales/ko.js
+++ b/frontend/src/locales/ko.js
@@ -1024,7 +1024,7 @@ export default {
'reps': '회',
'Most reps in a set per workout': '운동당 한 세트 최다 횟수',
'Warm-up sets': '워밍업 세트',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': '작업 세트 앞에 추가되며 볼륨, 기록, 진행에는 포함되지 않습니다. 각 세트는 작업 중량까지의 차이를 절반으로 줄이며, 운동 중에도 언제든 바꿀 수 있어요.',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': '작업 세트 앞에 추가되며 볼륨, 기록, 진행에는 포함되지 않습니다. 각 세트는 작업 중량까지의 차이를 절반으로 줄이고 바벨 운동에서는 빈 바보다 가벼워지지 않으며, 운동 중에도 언제든 바꿀 수 있어요.',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': '작업 세트 앞에 넣는 준비 세트로, 매번 직접 추가하지 않아도 됩니다.',
'Note': '메모',
'This session': '이번 운동',
diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js
index 92579d18f..df5fd8ef9 100644
--- a/frontend/src/locales/pl.js
+++ b/frontend/src/locales/pl.js
@@ -1024,7 +1024,7 @@ export default {
'reps': 'powt.',
'Most reps in a set per workout': 'Najwięcej powt. w serii na trening',
'Warm-up sets': 'Serie rozgrzewkowe',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': 'Dodawane przed seriami roboczymi i pomijane w objętości, rekordach i progresji. Każda zmniejsza o połowę dystans do ciężaru roboczego, a w trakcie treningu nadal możesz każdą zmienić.',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': 'Dodawane przed seriami roboczymi i pomijane w objętości, rekordach i progresji. Każda zmniejsza o połowę dystans do ciężaru roboczego, przy sztandze nigdy nie schodzi poniżej pustego gryfu, a w trakcie treningu nadal możesz każdą zmienić.',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': 'Serie wprowadzające przed seriami roboczymi, żeby nie dodawać ich ręcznie za każdym razem.',
'Note': 'Notatka',
'This session': 'Ta sesja',
diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.js
index c2c52d5f7..954f461d6 100644
--- a/frontend/src/locales/pt-BR.js
+++ b/frontend/src/locales/pt-BR.js
@@ -480,7 +480,7 @@ export const PT_BR_OVERRIDES = {
// --- workout notes and planned warm-ups ---
'Most reps in a set per workout': 'Mais reps em uma série por treino',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': 'Entram antes das suas séries de trabalho e ficam de fora do volume, dos recordes e da progressão. Cada uma fecha metade da distância até o peso de trabalho, e você ainda pode mudar qualquer uma no meio do treino.',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': 'Entram antes das suas séries de trabalho e ficam de fora do volume, dos recordes e da progressão. Cada uma fecha metade da distância até o peso de trabalho, nunca abaixo da barra vazia em um exercício com barra, e você ainda pode mudar qualquer uma no meio do treino.',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': 'Séries de aproximação antes das séries de trabalho, para você não precisar adicioná-las na mão a cada treino.',
'How it went, what to change. Saved with today’s workout.': 'Como foi, o que mudar. Fica salvo com o treino de hoje.',
'Brings it up again the next time you train this exercise.': 'Aparece de novo na próxima vez que você treinar este exercício.',
diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js
index ad06595ac..c4f587898 100644
--- a/frontend/src/locales/pt.js
+++ b/frontend/src/locales/pt.js
@@ -1024,7 +1024,7 @@ export default {
'reps': 'reps',
'Most reps in a set per workout': 'Mais reps numa série por treino',
'Warm-up sets': 'Séries de aquecimento',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': 'São acrescentadas antes das tuas séries de trabalho e ficam de fora do volume, dos recordes e da progressão. Cada uma reduz a metade a distância até ao peso de trabalho, e podes alterar qualquer uma a meio da sessão.',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': 'São acrescentadas antes das tuas séries de trabalho e ficam de fora do volume, dos recordes e da progressão. Cada uma reduz a metade a distância até ao peso de trabalho, nunca abaixo da barra vazia num exercício com barra, e podes alterar qualquer uma a meio da sessão.',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': 'Séries de aproximação antes das séries de trabalho, para não teres de as acrescentar à mão em cada treino.',
'Note': 'Nota',
'This session': 'Esta sessão',
diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js
index 576e5cbe6..06756e390 100644
--- a/frontend/src/locales/ru.js
+++ b/frontend/src/locales/ru.js
@@ -1004,7 +1004,7 @@ export default {
'reps': 'повт.',
'Most reps in a set per workout': 'Больше всего повт. в подходе за тренировку',
'Warm-up sets': 'Разминочные подходы',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': 'Добавляются перед рабочими подходами и не учитываются в объёме, рекордах и прогрессии. Каждый вдвое сокращает разрыв до рабочего веса, и любой из них можно изменить прямо во время тренировки.',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': 'Добавляются перед рабочими подходами и не учитываются в объёме, рекордах и прогрессии. Каждый вдвое сокращает разрыв до рабочего веса, но в упражнениях со штангой никогда не легче пустого грифа, и любой из них можно изменить прямо во время тренировки.',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': 'Подводящие подходы перед рабочими, чтобы не добавлять их вручную каждый раз.',
'Note': 'Заметка',
'This session': 'Эта тренировка',
diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.js
index 1031f9448..ec799b504 100644
--- a/frontend/src/locales/th.js
+++ b/frontend/src/locales/th.js
@@ -861,7 +861,7 @@ export default {
'reps': 'ครั้ง',
'Most reps in a set per workout': 'จำนวนครั้งมากที่สุดในหนึ่งเซ็ตต่อการออกกำลังกาย',
'Warm-up sets': 'เซ็ตวอร์มอัพ',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': 'เพิ่มไว้ก่อนเซ็ตหลัก และไม่นับรวมในปริมาณงาน สถิติ หรือการเพิ่มน้ำหนัก แต่ละเซ็ตจะลดช่องว่างไปครึ่งหนึ่งจนถึงน้ำหนักเซ็ตหลัก และยังปรับเปลี่ยนได้ระหว่างออกกำลังกาย',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': 'เพิ่มไว้ก่อนเซ็ตหลัก และไม่นับรวมในปริมาณงาน สถิติ หรือการเพิ่มน้ำหนัก แต่ละเซ็ตจะลดช่องว่างไปครึ่งหนึ่งจนถึงน้ำหนักเซ็ตหลัก ท่าบาร์เบลจะไม่เบากว่าบาร์เปล่า และยังปรับเปลี่ยนได้ระหว่างออกกำลังกาย',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': 'เพิ่มเซ็ตไต่ระดับไว้ก่อนเซ็ตหลัก จะได้ไม่ต้องเพิ่มเองทุกครั้ง',
'Note': 'บันทึก',
'This session': 'รอบนี้',
diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js
index d6fa067cf..6836e4a23 100644
--- a/frontend/src/locales/tr.js
+++ b/frontend/src/locales/tr.js
@@ -1024,7 +1024,7 @@ export default {
'reps': 'tekrar',
'Most reps in a set per workout': 'Antrenman başına bir sette en çok tekrar',
'Warm-up sets': 'Isınma setleri',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': 'Çalışma setlerinden önce eklenir; hacim, rekor ve ilerlemeye sayılmaz. Her biri çalışma ağırlığına kalan farkı yarıya indirir ve antrenman sırasında hâlâ istediğini değiştirebilirsin.',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': 'Çalışma setlerinden önce eklenir; hacim, rekor ve ilerlemeye sayılmaz. Her biri çalışma ağırlığına kalan farkı yarıya indirir, halter hareketlerinde boş barın altına hiç inmez ve antrenman sırasında hâlâ istediğini değiştirebilirsin.',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': 'Çalışma setlerinden önce eklenen hazırlık setleri, böylece her antrenmanda elle eklemen gerekmez.',
'Note': 'Not',
'This session': 'Bu antrenman',
diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.js
index a4a775ede..131da4e0a 100644
--- a/frontend/src/locales/uk.js
+++ b/frontend/src/locales/uk.js
@@ -834,7 +834,7 @@ export default {
'reps': 'повт.',
'Most reps in a set per workout': 'Найбільше повт. в підході за тренування',
'Warm-up sets': 'Розминкові підходи',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': 'Додаються перед робочими підходами і не враховуються в обсязі, рекордах і прогресії. Кожен удвічі скорочує розрив до робочої ваги, і будь-який із них можна змінити під час тренування.',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': 'Додаються перед робочими підходами і не враховуються в обсязі, рекордах і прогресії. Кожен удвічі скорочує розрив до робочої ваги, але у вправах зі штангою ніколи не легший за порожній гриф, і будь-який із них можна змінити під час тренування.',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': 'Підвідні підходи перед робочими, щоб не додавати їх вручну щоразу.',
'Note': 'Нотатка',
'This session': 'Це тренування',
diff --git a/frontend/src/locales/zh-TW.js b/frontend/src/locales/zh-TW.js
index 0ab17d0bf..6f0808969 100644
--- a/frontend/src/locales/zh-TW.js
+++ b/frontend/src/locales/zh-TW.js
@@ -1016,7 +1016,7 @@ export default {
'reps': '下',
'Most reps in a set per workout': '每次訓練單組最高次數',
'Warm-up sets': '熱身組',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': '排在正式組之前,不列入總訓練量、個人紀錄與漸進計算。每組都會把與正式重量的差距縮小一半,訓練中仍可隨時修改任何一組。',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': '排在正式組之前,不列入總訓練量、個人紀錄與漸進計算。每組都會把與正式重量的差距縮小一半,槓鈴動作不會低於空槓,訓練中仍可隨時修改任何一組。',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': '在正式組前自動加入遞增熱身組,免除每次手動新增的麻煩。',
'Note': '備忘錄',
'This session': '本次筆記',
diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js
index 07765586e..f536136ec 100644
--- a/frontend/src/locales/zh.js
+++ b/frontend/src/locales/zh.js
@@ -1024,7 +1024,7 @@ export default {
'reps': '次',
'Most reps in a set per workout': '每次训练单组最多次数',
'Warm-up sets': '热身组',
- 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.': '加在正式组之前,不计入容量、纪录和进阶。每一组都把与正式重量的差距缩小一半,训练中仍可随时调整任意一组。',
+ 'Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.': '加在正式组之前,不计入容量、纪录和进阶。每一组都把与正式重量的差距缩小一半,杠铃动作不会低于空杠,训练中仍可随时调整任意一组。',
'Ramp-up sets added before the work sets, so you do not have to add them by hand each session.': '在正式组之前加入的爬升组,这样就不用每次手动添加。',
'Note': '备注',
'This session': '本次训练',
diff --git a/frontend/src/sheets.jsx b/frontend/src/sheets.jsx
index e5e4a6928..9cd748ebf 100644
--- a/frontend/src/sheets.jsx
+++ b/frontend/src/sheets.jsx
@@ -1645,7 +1645,7 @@ function ExConfig({ ex, existing, onSave, onDelete, onReplace, close, routine, i
</div>
<div className="small dim" style={{ marginBottom: 18 }}>
{(c.warmupSets || 0) > 0
- ? t('Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, and you can still change any of them mid-session.')
+ ? t('Added before your work sets and left out of volume, records and progression. Each one closes half the gap to the work weight, never below the bar on a barbell lift, and you can still change any of them mid-session.')
: t('Ramp-up sets added before the work sets, so you do not have to add them by hand each session.')}
</div>
</>}
diff --git a/frontend/src/views/Workout.jsx b/frontend/src/views/Workout.jsx
index 39a96e3d8..20caf8b3b 100644
--- a/frontend/src/views/Workout.jsx
+++ b/frontend/src/views/Workout.jsx
@@ -8,7 +8,7 @@ import { useUI } from '../store/useUI.js'
import { exOr, betterWeight } from '../lib/exercises.js'
import { usesBar } from '../lib/bar.js'
import { loadKindFor, baseWeightFor, inventoryFor, rowLoad, sameLoad, plateDelta, dropGrid } from '../lib/plates.js'
-import { effectiveRoutines, effectiveRoutineIds, lastEntryFor, bestWeightFor, bestWeightForEntry, buildSets, freestyleConfig, defaultConfig, setsDoneActive, setUnitsTotal, supersetUnits, unitOf, setLabel, modeOf, isBw, isPerSide, repStep, EFFORT, effortOf, stepEffort, capEffort, cascadeWeight, insertWarmupRow, makeWarmupAt, canBeWarmup, makeWorkAt, removeRowAt, removeLastSet, setSpanAt, copyRowAt, copySpanAt, insertRowAt, pairAdjacent, unpairSuperset, cleanupSg, applyIntensifierPlan, pinnedNoteFor, exNoteFor, setsRepsOf } from '../lib/history.js'
+import { effectiveRoutines, effectiveRoutineIds, lastEntryFor, bestWeightFor, bestWeightForEntry, buildSets, freestyleConfig, defaultConfig, setsDoneActive, setUnitsTotal, supersetUnits, unitOf, setLabel, modeOf, isBw, isPerSide, repStep, EFFORT, effortOf, stepEffort, capEffort, cascadeWeight, insertWarmupRow, barFloor, makeWarmupAt, canBeWarmup, makeWorkAt, removeRowAt, removeLastSet, setSpanAt, copyRowAt, copySpanAt, insertRowAt, pairAdjacent, unpairSuperset, cleanupSg, applyIntensifierPlan, pinnedNoteFor, exNoteFor, setsRepsOf } from '../lib/history.js'
import { fmtNum, fmtPlate, exerciseNameText, fmtDate, fmtDaysAgo, todayISO, exCount, DAYN } from '../lib/format.js'
import { speedUnitOf, toSpeed, fromSpeed } from '../lib/speed.js'
import { beep, vibrate, unlock } from '../lib/sound.js'
@@ -1115,7 +1115,7 @@ function ActiveWorkout() {
const removeSet = idx => mutEntry(idx, e => { e.sets = removeLastSet(e.sets) })
const addWarmup = idx => mutEntry(idx, e => {
const m = modeOf({ ...(e.target || {}), id: e.id })
- e.sets = insertWarmupRow(e.sets, m, e.target || {}, defaultIncrement(e.id, S.unit))
+ e.sets = insertWarmupRow(e.sets, m, e.target || {}, defaultIncrement(e.id, S.unit), barFloor(S, e.id))
})
// The set-number menu's Remove and the swipe both go through deleteActiveSet, Undo and all.
const removeSetAt = (idx, i) => deleteActiveSet(idx, i, { editing })
diff --git a/frontend/src/views/Workout.test.jsx b/frontend/src/views/Workout.test.jsx
index 5e8e6384b..c67d8c3b7 100644
--- a/frontend/src/views/Workout.test.jsx
+++ b/frontend/src/views/Workout.test.jsx
@@ -1764,6 +1764,14 @@ describe('workout controls: the more menu and the set menu', () => {
expect(mocks.confirmSheet).toHaveBeenCalled()
})
+ it('adds an in-session warm-up at the bar, never under it', async () => {
+ const bench = exercise('0025', [false], { target: { mode: 'reps', reps: 10, weight: 55 }, sets: [{ w: 55, r: 10, done: false }] })
+ await mount([bench], 0, { unit: 'lb' })
+ await act(async () => { container.querySelector('button[aria-label="More"]').dispatchEvent(new dom.Event('click', { bubbles: true })) })
+ await act(async () => { item('Add warm-up set').onClick() })
+ expect(mocks.S.active.entries[0].sets.map(s => s.w)).toEqual([45, 55])
+ })
+
it('opens the exercise history sheet from the More menu, for the tapped exercise', async () => {
// the screen shows one exercise at a time, so "the tapped exercise" is the current one
await mount([exercise('plain-bench', [false]), exercise('plain-row', [false])], 1)