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
Your bars, quick bar picks and a warm-up rest for every exercise (Discord)
Duarte Santosa36cf4c1ac9a
diff --git a/frontend/src/lib/bar-defaults.test.js b/frontend/src/lib/bar-defaults.test.jsnew file mode 100644index 000000000..c53b5d4bb--- /dev/null+++ b/frontend/src/lib/bar-defaults.test.js@@ -0,0 +1,151 @@+/* Your bars (Discord: "Add short olympic bar (15kg)"): one weight per bar type for the whole+ profile, S.barDefaults[unit][eq]. Precedence everywhere a bar weight is read: the exercise's own+ barWeights entry (0 = no bar), then your bar for the type, then the built-in default. */+import { describe, expect, it } from 'vitest'+import { barWeightFor, barTypeWeight, ownBarDefault, withBarDefault, withStandardBars, plateSplit } from './bar.js'+import { baseWeightFor, rowLoad, dropGrid } from './plates.js'+import { barFloor } from './history.js'+import { convertStateUnit } from './units.js'+import { mergeStates, stampChange, stampEdits, stampRestore } from './sync-merge.js'+import * as Server from '../../../api/sync-stamps.js'+import { EXDB } from './exercises-data.js'++const idOf = eq => EXDB.find(e => e.eq === eq).id+const OLY = idOf('olympic barbell'), BB = idOf('barbell'), EZ = idOf('ez barbell'), DB = idOf('dumbbell')+const clone = v => JSON.parse(JSON.stringify(v))++describe('precedence: exercise override, then your bar, then the built-in', () => {+ const S = { unit: 'kg', barDefaults: { kg: { 'olympic barbell': 15 } }, barWeights: {} }++ it('an exercise without its own bar uses yours for the type', () => {+ expect(ownBarDefault(S, 'olympic barbell')).toBe(15)+ expect(barTypeWeight(S, 'olympic barbell')).toBe(15)+ expect(barWeightFor(S, OLY)).toBe(15)+ expect(baseWeightFor(S, OLY)).toBe(15)+ expect(barFloor(S, OLY)).toBe(15)+ })++ it('other bar types keep the built-in', () => {+ expect(ownBarDefault(S, 'barbell')).toBeNull()+ expect(barWeightFor(S, BB)).toBe(20)+ expect(barWeightFor(S, EZ)).toBe(10)+ })++ it('the exercise own bar wins, and its "no bar" 0 stays 0', () => {+ expect(barWeightFor({ ...S, barWeights: { [OLY]: 20 } }, OLY)).toBe(20)+ expect(baseWeightFor({ ...S, barWeights: { [OLY]: 20 } }, OLY)).toBe(20)+ expect(barWeightFor({ ...S, barWeights: { [OLY]: 0 } }, OLY)).toBe(0)+ expect(baseWeightFor({ ...S, barWeights: { [OLY]: 0 } }, OLY)).toBe(0)+ })++ it('is kept per unit: a lb profile reads its own list, not a converted kg one', () => {+ const lb = { unit: 'lb', barDefaults: { kg: { 'olympic barbell': 15 } } }+ expect(barWeightFor(lb, OLY)).toBe(45)+ expect(barWeightFor({ unit: 'lb', barDefaults: { lb: { 'olympic barbell': 35 } } }, OLY)).toBe(35)+ })++ it('ignores junk and non-bar equipment', () => {+ for (const v of [0, -5, '15', null, NaN, Infinity]) {+ expect(barWeightFor({ unit: 'kg', barDefaults: { kg: { 'olympic barbell': v } } }, OLY), String(v)).toBe(20)+ }+ expect(baseWeightFor({ unit: 'kg', barDefaults: { kg: { dumbbell: 5 } } }, DB)).toBe(0)+ expect(barWeightFor({ unit: 'kg', barDefaults: 'x' }, OLY)).toBe(20)+ })++ it('feeds the plate math and the drop steps; logged totals stay totals', () => {+ expect(plateSplit(60, barWeightFor(S, OLY))).toBe(22.5)+ expect(rowLoad('pairs', 60, baseWeightFor(S, OLY), [{ w: 20, n: 9 }, { w: 2.5, n: 9 }]).perSide).toBe(22.5)+ const grid = dropGrid({ ...S, plates: { kg: { 20: 2, 10: 2, _ts: 1 } } }, { id: OLY })+ expect(grid(50)).toBe(35) // 15 kg bar + 10 a side; 20 a side would be 55+ expect(grid(12)).toBe(15) // never under the bar+ })+})++describe('withBarDefault / withStandardBars', () => {+ it('sets, clears and drops what equals the built-in', () => {+ let S = { unit: 'kg' }+ S.barDefaults = withBarDefault(S, 'olympic barbell', 15)+ expect(S.barDefaults).toEqual({ kg: { 'olympic barbell': 15 } })+ S.barDefaults = withBarDefault(S, 'barbell', 20) // the built-in: nothing to store+ expect(S.barDefaults).toEqual({ kg: { 'olympic barbell': 15 } })+ S.barDefaults = withBarDefault(S, 'olympic barbell', 0)+ expect(S.barDefaults).toEqual({})+ })++ it('the standard bars come back for this unit only', () => {+ const S = { unit: 'lb', barDefaults: { kg: { barbell: 15 }, lb: { barbell: 35, 'ez barbell': 15 } } }+ expect(withStandardBars(S)).toEqual({ kg: { barbell: 15 } })+ expect(S.barDefaults.lb).toEqual({ barbell: 35, 'ez barbell': 15 }) // not mutated+ })+})++describe('a unit switch', () => {+ it('keeps your bars per unit and an override that is the standard bar a standard bar', () => {+ const S = { unit: 'kg', barDefaults: { kg: { barbell: 15 }, lb: { barbell: 35 } }, barWeights: { [BB]: 20, [EZ]: 10 } }+ const lb = convertStateUnit(S, 'lb')+ expect(lb.barDefaults).toEqual(S.barDefaults)+ expect(lb.barWeights[BB]).toBe(45) // a 20 kg bar is a 45 lb one, not your 35+ expect(lb.barWeights[EZ]).toBeUndefined() // the built-in either way+ expect(barWeightFor(lb, BB)).toBe(45)+ expect(barWeightFor({ ...lb, barWeights: {} }, BB)).toBe(35)+ })++ it('an override that lands on your bar for the type drops out', () => {+ const lb = convertStateUnit({ unit: 'kg', barDefaults: { lb: { barbell: 35 } }, barWeights: { [BB]: 15.88 } }, 'lb')+ expect(lb.barWeights[BB]).toBeUndefined()+ expect(barWeightFor(lb, BB)).toBe(35)+ })+})++describe('sync', () => {+ const T = Date.UTC(2026, 9, 14, 8)+ const base = { _ts: T, unit: 'kg', restSec: 90, workouts: [], routines: [], customEx: [], bodyweight: [], barWeights: {} }++ it('is a stamped setting: set on one device, it survives the other device\'s later, unrelated change', () => {+ const phone = clone(base)+ phone.barDefaults = { kg: { 'olympic barbell': 15 } }+ phone._ts = stampChange(base, phone, T + 1000)+ stampEdits(base, phone, phone._ts)+ expect(phone.edited.barDefaults).toBe(phone._ts)+ const desk = clone(base)+ desk.restSec = 120+ desk._ts = T + 5000+ stampEdits(base, desk, desk._ts)+ for (const m of [mergeStates(phone, desk), mergeStates(desk, phone)]) {+ expect(m.barDefaults).toEqual({ kg: { 'olympic barbell': 15 } })+ expect(m.restSec).toBe(120)+ }+ })++ it('the later change wins, a clear included', () => {+ const a = clone(base); a.barDefaults = { kg: { barbell: 15 } }; stampEdits(base, a, T + 1000); a._ts = T + 1000+ const b = clone(a); delete b.barDefaults; stampEdits(a, b, T + 2000); b._ts = T + 2000+ expect(mergeStates(a, b).barDefaults).toBeUndefined()+ expect(mergeStates(b, a).barDefaults).toBeUndefined()+ })++ it('a copy that never had the key (an older app) does not drop it', () => {+ const now = clone(base); now.barDefaults = { kg: { barbell: 15 } }; stampEdits(base, now, T + 1000); now._ts = T + 1000+ const old = clone(base); old.workouts = [{ id: 'w1', d: '2026-10-14', start: T + 3000, entries: [] }]; old._ts = T + 3000+ for (const m of [mergeStates(old, now), mergeStates(now, old)]) {+ expect(m.barDefaults).toEqual({ kg: { barbell: 15 } })+ expect(m.workouts.map(w => w.id)).toEqual(['w1'])+ }+ })++ it('the server puts it back for a writer that does not know it', () => {+ const cur = clone(base); cur.barDefaults = { kg: { barbell: 15 } }; cur.edited = { barDefaults: T + 1000 }; cur._ts = T + 1000+ const old = clone(base); old.restSec = 60; old._ts = T + 2000+ Server.stampPut(cur, old, { overRead: true, now: T + 3000 })+ expect(old.barDefaults).toEqual({ kg: { barbell: 15 } })+ })++ it('a restored backup brings it back', () => {+ const backup = clone(base); backup.barDefaults = { kg: { barbell: 15 } }+ const cur = clone(base); cur.edited = { barDefaults: T + 500 }; cur._ts = T + 500+ const next = stampRestore(clone(backup), [cur], T + 9000)+ expect(next.edited.barDefaults).toBe(T + 9000)+ expect(mergeStates(next, cur).barDefaults).toEqual({ kg: { barbell: 15 } })+ expect(mergeStates(cur, next).barDefaults).toEqual({ kg: { barbell: 15 } })+ })+})diff --git a/frontend/src/lib/bar.js b/frontend/src/lib/bar.jsindex cfd74edad..515ae3e60 100644--- a/frontend/src/lib/bar.js+++ b/frontend/src/lib/bar.js@@ -30,6 +30,46 @@ export const usesBar = exOrId => BAR_EQ.has(exOf(exOrId)?.eq)export const defaultBarWeight = (eq, unit) =>(unit === 'lb' ? DEFAULT_BAR_LB : DEFAULT_BAR_KG)[eq] ?? null+/** The bar types Settings > Equipment > Your bars lists, most used first. */+export const BAR_TYPES = ['barbell', 'olympic barbell', 'ez barbell', 'trap bar', 'smith machine']++/** Quick picks for a bar's weight, per unit: the bars gyms actually rack (15 kg / 35 lb is the short one). */+export const BAR_PICKS = { kg: [20, 15, 10, 7.5], lb: [45, 35, 25, 15] }+export const barPicks = unit => BAR_PICKS[unit === 'lb' ? 'lb' : 'kg']++/**+ * Your own weight for a bar type, set once for the whole profile (Discord: the 15 kg short+ * olympic bar). S.barDefaults = { kg: { 'olympic barbell': 15 }, lb: { … } }: kept per unit like+ * the plate inventory, so a unit switch finds the other unit's bars instead of a 33.07 lb one.+ * A plain setting, synced and stamped as a whole (lib/sync-merge.js stampEdits). null when you+ * kept the built-in weight.+ */+export function ownBarDefault(S, eq) {+ if (!BAR_EQ.has(eq)) return null+ const v = S?.barDefaults?.[S?.unit === 'lb' ? 'lb' : 'kg']?.[eq]+ return typeof v === 'number' && Number.isFinite(v) && v > 0 ? v : null+}++/** The bar an exercise of this type starts from: yours for the type, else the built-in. */+export const barTypeWeight = (S, eq) => ownBarDefault(S, eq) ?? defaultBarWeight(eq, S?.unit)++/**+ * A new S.barDefaults with the profile unit's `eq` set to `w`, or back on the built-in for+ * anything not above 0 (or the built-in weight itself). Empty unit maps are dropped.+ */+export function withBarDefault(S, eq, w) {+ const unit = S?.unit === 'lb' ? 'lb' : 'kg'+ const all = { ...(S?.barDefaults && typeof S.barDefaults === 'object' ? S.barDefaults : {}) }+ const mine = { ...(all[unit] || {}) }+ const n = Math.round((Number(w) || 0) * 100) / 100+ if (n > 0 && n !== defaultBarWeight(eq, unit)) mine[eq] = n; else delete mine[eq]+ if (Object.keys(mine).length) all[unit] = mine; else delete all[unit]+ return all+}++/** S.barDefaults with the profile unit back on the built-in bars; the other unit's are kept. */+export const withStandardBars = S => BAR_TYPES.reduce((all, eq) => withBarDefault({ unit: S?.unit, barDefaults: all }, eq, 0), S?.barDefaults)+/*** A stored 0 is "no bar", not "unset" (issue #138). Smith machines that counterbalance their* carriage put nothing in your hands, so the plate math and the drop-set steps have to start@@ -48,8 +88,8 @@ export const hasBarOverride = (S, exId) => {/*** Effective bar weight for one exercise, in the profile unit: the explicit* S.barWeights[exId] if set — an explicit 0 is "no bar" (a Smith machine whose carriage is- * counterbalanced, issue #138) and stays 0 — else the default for the bar type. null for- * anything that is not a bar exercise.+ * counterbalanced, issue #138) and stays 0 — else your bar for the type (ownBarDefault), else+ * the built-in default. null for anything that is not a bar exercise.*/export function barWeightFor(S, exOrId) {const ex = exOf(exOrId)@@ -57,7 +97,7 @@ export function barWeightFor(S, exOrId) {const own = (S?.barWeights || {})[ex.id]if (own === 0) return 0if (own > 0) return own- return defaultBarWeight(ex.eq, S?.unit)+ return barTypeWeight(S, ex.eq)}/**diff --git a/frontend/src/lib/plates.js b/frontend/src/lib/plates.jsindex fefb49c45..0fa4db0ed 100644--- a/frontend/src/lib/plates.js+++ b/frontend/src/lib/plates.js@@ -10,7 +10,7 @@// Logged weights stay the total on the bar (or the added load). Everything here is display.import { EXIDX } from './exercises.js'-import { usesBar, defaultBarWeight } from './bar.js'+import { usesBar, barTypeWeight } from './bar.js'import { isBw } from './history.js'import { weightIncrement } from './progression.js'import { ownedWeightsFor, ownedFloor } from './dumbbells.js'@@ -203,15 +203,15 @@ export function loadKindFor(S, cfgOrId) {/*** The weight that is there before any plate goes on, in the profile unit: the bar for bar- * exercises (S.barWeights override, 0 = "no bar", else the type's default), the explicit- * override for anything else (a sled's own weight), 0 otherwise.+ * exercises (S.barWeights override, 0 = "no bar", else your bar for the type in S.barDefaults,+ * else the built-in), the explicit override for anything else (a sled's own weight), 0 otherwise.*/export function baseWeightFor(S, exOrId) {const ex = exOf(exOrId)if (!ex) return 0const own = S?.barWeights?.[ex.id]if (typeof own === 'number' && own >= 0) return own- return defaultBarWeight(ex.eq, S?.unit) ?? 0+ return barTypeWeight(S, ex.eq) ?? 0}/**diff --git a/frontend/src/lib/supersetFlow.js b/frontend/src/lib/supersetFlow.jsindex e982d8b0e..f51f10e72 100644--- a/frontend/src/lib/supersetFlow.js+++ b/frontend/src/lib/supersetFlow.js@@ -119,10 +119,11 @@ export function restSecFor(entries, unit, defaultRestSec, setRest = null) {* Ramp sets are light and short, so an exercise may carry its own `warmupRestSec` in its target* next to `restSec`. It applies between ramp sets only: the break after the LAST ramp set, into* the first work set, is `workRestSec` (the value restSecFor resolved), because that is the rest- * the first heavy set actually needs. An exercise without the field, or a work set, rests- * `workRestSec` — exactly what every routine did before the field existed.+ * the first heavy set actually needs. An exercise without the field falls back to `profileSec`,+ * the profile's warm-up rest (0 = no timer), and without that, like a work set, rests+ * `workRestSec` — exactly what every routine did before either existed.*/-export function warmupRestSecFor(entry, setIdx, workRestSec) {+export function warmupRestSecFor(entry, setIdx, workRestSec, profileSec) {const sets = Array.isArray(entry?.sets) ? entry.sets : []const set = sets[setIdx]if (!set || !isWarmupRow(set)) return workRestSec@@ -131,7 +132,12 @@ export function warmupRestSecFor(entry, setIdx, workRestSec) {// "No timer" between ramp sets: an optional `warmupRestOff` (set in the exercise's settings).if (entry?.target?.warmupRestOff === true) return 0const own = Number(entry?.target?.warmupRestSec)- return own > 0 ? own : workRestSec+ if (own > 0) return own+ // Then the profile's (Settings > Workout, S.warmupRestSec): 0 is "no timer", absent is like+ // the work sets.+ const all = typeof profileSec === 'number' && Number.isFinite(profileSec) ? Math.round(profileSec) : null+ if (all === 0) return 0+ return all > 0 ? all : workRestSec}/**diff --git a/frontend/src/lib/supersetFlow.test.js b/frontend/src/lib/supersetFlow.test.jsindex c674201f9..52d2e14e4 100644--- a/frontend/src/lib/supersetFlow.test.js+++ b/frontend/src/lib/supersetFlow.test.js@@ -191,6 +191,23 @@ describe('warmupRestSecFor', () => {expect(warmupRestSecFor(ramp(45, [true, true, false, false]), 0, 150)).toBe(150)})+ // Discord (seals187): one warm-up rest for the whole profile, S.warmupRestSec.+ it('without its own, a ramp set rests the profile\'s warm-up rest; 0 is no timer', () => {+ expect(warmupRestSecFor(ramp(null), 0, 150, 30)).toBe(30)+ expect(warmupRestSecFor(ramp(null), 0, 150, 0)).toBe(0)+ for (const v of [undefined, null, '30', NaN]) expect(warmupRestSecFor(ramp(null), 0, 150, v), String(v)).toBe(150)+ })++ it('the exercise\'s own wins over the profile\'s, its "no timer" too', () => {+ expect(warmupRestSecFor(ramp(45), 0, 150, 30)).toBe(45)+ expect(warmupRestSecFor({ target: { warmupRestOff: true }, sets: ramp(null).sets }, 0, 150, 30)).toBe(0)+ })++ it('the profile\'s never touches the last ramp set or a work set', () => {+ expect(warmupRestSecFor(ramp(null), 1, 150, 0)).toBe(150)+ expect(warmupRestSecFor(ramp(null), 2, 150, 30)).toBe(150)+ })+it('is safe on a legacy warmup boolean and on missing entries', () => {const legacy = { target: { warmupRestSec: 45 }, sets: [{ warmup: true, done: false }, { warmup: true, done: false }, { done: false }] }expect(warmupRestSecFor(legacy, 0, 120)).toBe(45)diff --git a/frontend/src/lib/units.js b/frontend/src/lib/units.jsindex ac8e3dc1a..49b2db4af 100644--- a/frontend/src/lib/units.js+++ b/frontend/src/lib/units.js@@ -5,7 +5,7 @@import { isSideSet, syncSideAggregate } from './workout-model.js'import { workoutVolume } from './history.js'import { EXIDX } from './exercises.js'-import { defaultBarWeight } from './bar.js'+import { defaultBarWeight, barTypeWeight } from './bar.js'const LB_PER_KG = 2.2046226218@@ -51,15 +51,17 @@ const convTarget = (cfg, from, to) => {// default takes over — 45 lb → 20 kg, not 20.5, which with a kg plate set would leave every row// "1 kg short". An explicit 0 ("no bar", lib/bar.js) stays 0. A custom bar converts like any// other weight (a 33 lb women's bar → 15 kg), and drops out too if it lands on the new default.-const convBarWeights = (bw, from, to) => {+// Your own bars (S.barDefaults, kept per unit) count as the new unit's default: an override that+// lands on the bar you set for the type there drops out, and a standard bar stays a standard bar+// (20 kg → 45 lb) even when your lb default for the type is something else.+const convBarWeights = (bw, from, to, own) => {const out = {}for (const [id, v] of Object.entries(bw || {})) {if (typeof v !== 'number' || !Number.isFinite(v) || v < 0) continueif (v === 0) { out[id] = 0; continue }const eq = EXIDX[id]?.eq- if (eq && v === defaultBarWeight(eq, from)) continue- const c = convertWeight(v, from, to)- if (eq && c === defaultBarWeight(eq, to)) continue+ const c = eq && v === defaultBarWeight(eq, from) ? defaultBarWeight(eq, to) : convertWeight(v, from, to)+ if (eq && c === barTypeWeight({ unit: to, barDefaults: own }, eq)) continueout[id] = c}return out@@ -96,13 +98,13 @@ export function convertStateUnit(S, to) {if (Array.isArray(S.bodyweight)) out.bodyweight = S.bodyweight.map(b => ({ ...b, w: bw(b.w) }))if (S.targetW != null) out.targetW = bw(S.targetW)if (S.exWeights) out.exWeights = Object.fromEntries(Object.entries(S.exWeights).map(([k, v]) => [k, v && typeof v === 'object' ? { ...v, w: c(v.w) } : c(v)]))- if (S.barWeights) out.barWeights = convBarWeights(S.barWeights, from, to)+ if (S.barWeights) out.barWeights = convBarWeights(S.barWeights, from, to, S.barDefaults)// The plate inventory (S.plates) is carried over as it is, not converted: it is kept per unit// (lib/plates.js), because a 45 lb plate does not become a 20.4 kg one. After the switch the// rows load from the new unit's own list, or the standard set until you count yours, and- // switching back finds the old list as you left it. The dumbbell list (S.dumbbells) is kept per- // unit the same way. The load kinds (S.loadKind) and what a dumbbell weight means (S.dbLoad)- // hold no weight.+ // switching back finds the old list as you left it. The dumbbell list (S.dumbbells) and your+ // bars (S.barDefaults) are kept per unit the same way. The load kinds (S.loadKind) and what a+ // dumbbell weight means (S.dbLoad) hold no weight.if (Array.isArray(S.routines)) out.routines = S.routines.map(r => ({ ...r, ex: (r.ex || []).map(cfg => convTarget(cfg, from, to)) }))if (Array.isArray(S.workouts)) out.workouts = S.workouts.map(convSession)if (S.active) out.active = convSession(S.active)diff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.jsindex 2e6223da0..0c50aeeef 100644--- a/frontend/src/locales/ar.js+++ b/frontend/src/locales/ar.js@@ -2430,4 +2430,13 @@ export default {'Workout running': 'تمرين جارٍ','Set {0} of {1}': 'المجموعة {0} من {1}','All sets done': 'اكتملت كل المجموعات',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'البارات الخاصة بك',+ 'Set the bar once for every exercise of a type.': 'اضبط البار مرة واحدة لكل تمارين النوع نفسه.',+ 'Your bar for this type, set in Your bars.': 'البار الخاص بك لهذا النوع، مضبوط في البارات الخاصة بك.',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'كم تزن البارات في ناديك. كل تمرين بهذا البار يحسب الأقراص منه، إلا إذا أعطيت التمرين بارًا خاصًا به. الأوزان المسجلة تبقى أوزانًا إجمالية.',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'معظم تمارين المكتبة تستخدم «{0}»، وبعضها «{1}». لبار قصير في كل مكان، اضبط الاثنين.',+ 'Back to the standard bars': 'العودة إلى البارات القياسية',+ 'Standard bars. Tap if yours are lighter.': 'بارات قياسية. اضغط إذا كانت باراتك أخف.',+ 'The last warm-up still gets the full rest before your first work set.': 'آخر مجموعة إحماء تحصل مع ذلك على الراحة الكاملة قبل أول مجموعة عمل.',}diff --git a/frontend/src/locales/bn.js b/frontend/src/locales/bn.jsindex d5c52a1d6..1adfb89fa 100644--- a/frontend/src/locales/bn.js+++ b/frontend/src/locales/bn.js@@ -2454,4 +2454,13 @@ export default {'Workout running': 'ওয়ার্কআউট চলছে','Set {0} of {1}': 'সেট {0} / {1}','All sets done': 'সব সেট শেষ',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'আপনার বার',+ 'Set the bar once for every exercise of a type.': 'একই ধরনের সব ব্যায়ামের জন্য বার একবারই সেট করুন।',+ 'Your bar for this type, set in Your bars.': 'এই ধরনের জন্য আপনার বার, আপনার বার-এ সেট করা।',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'আপনার জিমের বারগুলোর ওজন কত। ওই বারের প্রতিটি ব্যায়াম এখান থেকে প্লেট গোনে, যদি না ব্যায়ামটিকে আলাদা বার দিয়ে থাকেন। লেখা ওজন মোট ওজনই থাকে।',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'লাইব্রেরির বেশিরভাগ ব্যায়াম “{0}” ব্যবহার করে, কয়েকটি “{1}”। সবখানে ছোট বারের জন্য দুটোই সেট করুন।',+ 'Back to the standard bars': 'স্ট্যান্ডার্ড বারে ফিরে যান',+ 'Standard bars. Tap if yours are lighter.': 'স্ট্যান্ডার্ড বার। আপনারগুলো হালকা হলে ট্যাপ করুন।',+ 'The last warm-up still gets the full rest before your first work set.': 'শেষ ওয়ার্ম-আপ সেট তবুও প্রথম কাজের সেটের আগে পুরো বিশ্রাম পায়।',}diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.jsindex c6e416ac5..e2ba02344 100644--- a/frontend/src/locales/de.js+++ b/frontend/src/locales/de.js@@ -2341,7 +2341,7 @@ export default {'No timer': 'Kein Timer','Pick a time': 'Zeit wählen','Rest between sides': 'Pause zwischen den Seiten',- 'Rest between warm-ups': 'Pause zwischen Aufwärmsätzen',+ 'Rest between warm-ups': 'Aufwärmpausen','Warm-ups are light, so they can rest less, or not at all. The last one still gets the full rest before your first work set.': 'Aufwärmsätze sind leicht, da reicht weniger Pause oder gar keine. Der letzte bekommt trotzdem die volle Pause vor dem ersten Arbeitssatz.',// --- progress photos for any day (#557) ---'Add photos': 'Fotos hinzufügen',@@ -2395,4 +2395,13 @@ export default {'Workout running': 'Training läuft','Set {0} of {1}': 'Satz {0} von {1}','All sets done': 'Alle Sätze erledigt',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'Deine Stangen',+ 'Set the bar once for every exercise of a type.': 'Stell die Stange einmal für alle Übungen eines Typs ein.',+ 'Your bar for this type, set in Your bars.': 'Deine Stange für diesen Typ, eingestellt unter Deine Stangen.',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'Was die Stangen in deinem Gym wiegen. Jede Übung mit dieser Stange rechnet die Scheiben davon aus, außer du hast der Übung eine eigene gegeben. Eingetragene Gewichte bleiben Gesamtgewichte.',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'Die meisten Übungen in der Bibliothek nutzen „{0}“, ein paar „{1}“. Für eine kurze Stange überall stellst du beide ein.',+ 'Back to the standard bars': 'Zurück zu den Standardstangen',+ 'Standard bars. Tap if yours are lighter.': 'Standardstangen. Tippe, wenn deine leichter sind.',+ 'The last warm-up still gets the full rest before your first work set.': 'Der letzte Aufwärmsatz bekommt trotzdem die volle Pause vor deinem ersten Arbeitssatz.',}diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.jsindex 9f1a47c23..97570322e 100644--- a/frontend/src/locales/es.js+++ b/frontend/src/locales/es.js@@ -2375,4 +2375,13 @@ export default {'Workout running': 'Entreno en curso','Set {0} of {1}': 'Serie {0} de {1}','All sets done': 'Todas las series hechas',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'Tus barras',+ 'Set the bar once for every exercise of a type.': 'Ajusta la barra una vez para todos los ejercicios de un tipo.',+ 'Your bar for this type, set in Your bars.': 'Tu barra para este tipo, ajustada en Tus barras.',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'Lo que pesan las barras de tu gimnasio. Cada ejercicio con esa barra cuenta los discos a partir de ella, salvo que le hayas dado una propia. Los pesos registrados siguen siendo totales.',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'La mayoría de los ejercicios de la biblioteca usan «{0}», unos pocos «{1}». Para una barra corta en todos, ajusta las dos.',+ 'Back to the standard bars': 'Volver a las barras estándar',+ 'Standard bars. Tap if yours are lighter.': 'Barras estándar. Toca si las tuyas pesan menos.',+ 'The last warm-up still gets the full rest before your first work set.': 'La última serie de calentamiento sigue teniendo el descanso completo antes de tu primera serie de trabajo.',}diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.jsindex 2c6372554..44a2aa637 100644--- a/frontend/src/locales/fr.js+++ b/frontend/src/locales/fr.js@@ -2375,4 +2375,13 @@ export default {'Workout running': 'Séance en cours','Set {0} of {1}': 'Série {0} sur {1}','All sets done': 'Toutes les séries faites',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'Tes barres',+ 'Set the bar once for every exercise of a type.': 'Règle la barre une fois pour tous les exercices d’un type.',+ 'Your bar for this type, set in Your bars.': 'Ta barre pour ce type, réglée dans Tes barres.',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'Ce que pèsent les barres de ta salle. Chaque exercice avec cette barre compte les disques à partir d’elle, sauf si tu lui en as donné une propre. Les poids notés restent des totaux.',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'La plupart des exercices de la bibliothèque utilisent « {0} », quelques-uns « {1} ». Pour une barre courte partout, règle les deux.',+ 'Back to the standard bars': 'Revenir aux barres standard',+ 'Standard bars. Tap if yours are lighter.': 'Barres standard. Touche si les tiennes sont plus légères.',+ 'The last warm-up still gets the full rest before your first work set.': 'La dernière série d’échauffement garde le repos complet avant ta première série de travail.',}diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.jsindex 1a6fdc5ff..7dad466ee 100644--- a/frontend/src/locales/hi.js+++ b/frontend/src/locales/hi.js@@ -2375,4 +2375,13 @@ export default {'Workout running': 'वर्कआउट चल रहा है','Set {0} of {1}': 'सेट {0} / {1}','All sets done': 'सारे सेट पूरे',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'आपकी बार',+ 'Set the bar once for every exercise of a type.': 'एक तरह की सभी एक्सरसाइज़ के लिए बार एक बार सेट करें।',+ 'Your bar for this type, set in Your bars.': 'इस तरह के लिए आपकी बार, आपकी बार में सेट की गई।',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'आपके जिम की बार का वज़न। उस बार वाली हर एक्सरसाइज़ प्लेटें इसी से गिनती है, जब तक आपने उसे अपनी अलग बार न दी हो। लॉग किए वज़न कुल वज़न ही रहते हैं।',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'लाइब्रेरी की ज़्यादातर एक्सरसाइज़ “{0}” इस्तेमाल करती हैं, कुछ “{1}”। हर जगह छोटी बार के लिए दोनों सेट करें।',+ 'Back to the standard bars': 'स्टैंडर्ड बार पर वापस जाएँ',+ 'Standard bars. Tap if yours are lighter.': 'स्टैंडर्ड बार। आपकी हल्की हैं तो टैप करें।',+ 'The last warm-up still gets the full rest before your first work set.': 'आख़िरी वार्म-अप सेट को फिर भी पहले वर्क सेट से पहले पूरा आराम मिलता है।',}diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.jsindex ebd969c95..7a6d1faba 100644--- a/frontend/src/locales/hu.js+++ b/frontend/src/locales/hu.js@@ -2378,4 +2378,13 @@ export default {'Workout running': 'Edzés folyamatban','Set {0} of {1}': '{0}. sorozat / {1}','All sets done': 'Minden sorozat kész',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'Saját rudaid',+ 'Set the bar once for every exercise of a type.': 'Állítsd be a rudat egyszer egy típus összes gyakorlatához.',+ 'Your bar for this type, set in Your bars.': 'A rudad ehhez a típushoz, a Saját rudaid alatt beállítva.',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'Mennyit nyomnak a rudak a termedben. Minden gyakorlat ezzel a rúddal ebből számolja a tárcsákat, hacsak nem adtál neki sajátot. A rögzített súlyok összsúlyok maradnak.',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'A könyvtár legtöbb gyakorlata „{0}”, néhány „{1}”. Ha mindenhol rövid rudat akarsz, állítsd be mindkettőt.',+ 'Back to the standard bars': 'Vissza a szabványos rudakhoz',+ 'Standard bars. Tap if yours are lighter.': 'Szabványos rudak. Koppints, ha a tieid könnyebbek.',+ 'The last warm-up still gets the full rest before your first work set.': 'Az utolsó bemelegítő sorozat így is teljes pihenőt kap az első munkasorozatod előtt.',}diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.jsindex 4ef0209db..fa9771309 100644--- a/frontend/src/locales/it.js+++ b/frontend/src/locales/it.js@@ -2375,4 +2375,13 @@ export default {'Workout running': 'Allenamento in corso','Set {0} of {1}': 'Serie {0} di {1}','All sets done': 'Tutte le serie fatte',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'I tuoi bilancieri',+ 'Set the bar once for every exercise of a type.': 'Imposta il bilanciere una volta per tutti gli esercizi di un tipo.',+ 'Your bar for this type, set in Your bars.': 'Il tuo bilanciere per questo tipo, impostato in I tuoi bilancieri.',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'Quanto pesano i bilancieri della tua palestra. Ogni esercizio con quel bilanciere conta i dischi da lì, a meno che tu non gliene abbia dato uno suo. I pesi registrati restano totali.',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'La maggior parte degli esercizi della libreria usa «{0}», alcuni «{1}». Per un bilanciere corto ovunque, imposta entrambi.',+ 'Back to the standard bars': 'Torna ai bilancieri standard',+ 'Standard bars. Tap if yours are lighter.': 'Bilancieri standard. Tocca se i tuoi sono più leggeri.',+ 'The last warm-up still gets the full rest before your first work set.': 'L’ultima serie di riscaldamento ha comunque il recupero pieno prima della tua prima serie allenante.',}diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.jsindex c8f8367ef..f3c0b6914 100644--- a/frontend/src/locales/ko.js+++ b/frontend/src/locales/ko.js@@ -2375,4 +2375,13 @@ export default {'Workout running': '운동 중','Set {0} of {1}': '{1}세트 중 {0}세트','All sets done': '모든 세트 완료',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': '내 바',+ 'Set the bar once for every exercise of a type.': '종류별로 바를 한 번만 설정하면 모든 운동에 적용돼요.',+ 'Your bar for this type, set in Your bars.': '이 종류의 내 바, 내 바에서 설정했어요.',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': '내 헬스장 바의 무게예요. 그 바를 쓰는 모든 운동은 따로 바를 정해 주지 않는 한 여기서부터 플레이트를 계산해요. 기록한 무게는 그대로 총무게예요.',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': '라이브러리의 운동 대부분은 “{0}”, 일부는 “{1}”을 써요. 모든 곳에 짧은 바를 쓰려면 둘 다 설정하세요.',+ 'Back to the standard bars': '기본 바로 되돌리기',+ 'Standard bars. Tap if yours are lighter.': '기본 바. 내 바가 더 가벼우면 탭하세요.',+ 'The last warm-up still gets the full rest before your first work set.': '마지막 워밍업 세트는 그래도 첫 본 세트 전에 전체 휴식을 받아요.',}diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.jsindex d51462c9d..968cfaaf1 100644--- a/frontend/src/locales/pl.js+++ b/frontend/src/locales/pl.js@@ -2375,4 +2375,13 @@ export default {'Workout running': 'Trening trwa','Set {0} of {1}': 'Seria {0} z {1}','All sets done': 'Wszystkie serie zrobione',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'Twoje gryfy',+ 'Set the bar once for every exercise of a type.': 'Ustaw gryf raz dla wszystkich ćwiczeń danego typu.',+ 'Your bar for this type, set in Your bars.': 'Twój gryf dla tego typu, ustawiony w Twoje gryfy.',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'Ile ważą gryfy na twojej siłowni. Każde ćwiczenie z tym gryfem liczy talerze od niego, chyba że dałeś mu własny. Zapisane ciężary pozostają sumami.',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'Większość ćwiczeń w bibliotece używa „{0}”, kilka „{1}”. Krótki gryf wszędzie to ustawienie obu.',+ 'Back to the standard bars': 'Wróć do standardowych gryfów',+ 'Standard bars. Tap if yours are lighter.': 'Standardowe gryfy. Stuknij, jeśli twoje są lżejsze.',+ 'The last warm-up still gets the full rest before your first work set.': 'Ostatnia seria rozgrzewkowa i tak dostaje pełną przerwę przed pierwszą serią roboczą.',}diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.jsindex 8ba2e9e19..203f0f337 100644--- a/frontend/src/locales/pt-BR.js+++ b/frontend/src/locales/pt-BR.js@@ -1500,6 +1500,15 @@ export const PT_BR_OVERRIDES = {'Switch it off anytime in Settings': 'Desligue quando quiser nas Configurações','You can change it anytime in Settings.': 'Você pode mudar isso quando quiser nas Configurações.','Workout running': 'Treino em andamento',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'Suas barras',+ 'Set the bar once for every exercise of a type.': 'Defina a barra uma vez para todos os exercícios de um tipo.',+ 'Your bar for this type, set in Your bars.': 'Sua barra para este tipo, definida em Suas barras.',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'O quanto pesam as barras da sua academia. Cada exercício com essa barra conta as anilhas a partir dela, a menos que você tenha dado uma própria a ele. Os pesos registrados continuam sendo totais.',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'A maioria dos exercícios da biblioteca usa “{0}”, alguns usam “{1}”. Para uma barra curta em todos, defina as duas.',+ 'Back to the standard bars': 'Voltar às barras padrão',+ 'Standard bars. Tap if yours are lighter.': 'Barras padrão. Toque se as suas forem mais leves.',+ 'The last warm-up still gets the full rest before your first work set.': 'O último aquecimento continua tendo o descanso completo antes da sua primeira série de trabalho.',}export default { ...pt, ...PT_BR_OVERRIDES }diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.jsindex aefccb1a1..6555a62d0 100644--- a/frontend/src/locales/pt.js+++ b/frontend/src/locales/pt.js@@ -2375,4 +2375,13 @@ export default {'Workout running': 'Treino a decorrer','Set {0} of {1}': 'Série {0} de {1}','All sets done': 'Todas as séries feitas',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'As tuas barras',+ 'Set the bar once for every exercise of a type.': 'Define a barra uma vez para todos os exercícios de um tipo.',+ 'Your bar for this type, set in Your bars.': 'A tua barra para este tipo, definida em As tuas barras.',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'O que pesam as barras do teu ginásio. Cada exercício com essa barra conta os discos a partir dela, a não ser que lhe tenhas dado uma própria. Os pesos registados continuam a ser totais.',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'A maioria dos exercícios da biblioteca usa «{0}», alguns usam «{1}». Para uma barra curta em todos, define as duas.',+ 'Back to the standard bars': 'Voltar às barras padrão',+ 'Standard bars. Tap if yours are lighter.': 'Barras padrão. Toca se as tuas forem mais leves.',+ 'The last warm-up still gets the full rest before your first work set.': 'O último aquecimento continua a ter o descanso completo antes da tua primeira série de trabalho.',}diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.jsindex 5975d6d5a..196a571a8 100644--- a/frontend/src/locales/ru.js+++ b/frontend/src/locales/ru.js@@ -2379,4 +2379,13 @@ export default {'Workout running': 'Тренировка идёт','Set {0} of {1}': 'Подход {0} из {1}','All sets done': 'Все подходы сделаны',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'Твои грифы',+ 'Set the bar once for every exercise of a type.': 'Задай гриф один раз для всех упражнений одного типа.',+ 'Your bar for this type, set in Your bars.': 'Твой гриф для этого типа, задан в «Твои грифы».',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'Сколько весят грифы в твоём зале. Каждое упражнение с этим грифом считает блины от него, если ты не задал ему свой. Записанные веса остаются общими.',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'Большинство упражнений в библиотеке используют «{0}», некоторые «{1}». Чтобы короткий гриф был везде, задай оба.',+ 'Back to the standard bars': 'Вернуть стандартные грифы',+ 'Standard bars. Tap if yours are lighter.': 'Стандартные грифы. Нажми, если твои легче.',+ 'The last warm-up still gets the full rest before your first work set.': 'Последний разминочный подход всё равно получает полный отдых перед первым рабочим.',}diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.jsindex 05f005b59..377c73a4a 100644--- a/frontend/src/locales/th.js+++ b/frontend/src/locales/th.js@@ -2386,4 +2386,13 @@ export default {'Workout running': 'กำลังฝึกอยู่','Set {0} of {1}': 'เซ็ต {0} จาก {1}','All sets done': 'ครบทุกเซ็ตแล้ว',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'บาร์ของคุณ',+ 'Set the bar once for every exercise of a type.': 'ตั้งบาร์ครั้งเดียวสำหรับทุกท่าของบาร์ชนิดนั้น',+ 'Your bar for this type, set in Your bars.': 'บาร์ของคุณสำหรับชนิดนี้ ตั้งไว้ในบาร์ของคุณ',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'น้ำหนักบาร์ที่ยิมของคุณ ทุกท่าที่ใช้บาร์นั้นจะนับแผ่นน้ำหนักจากค่านี้ เว้นแต่คุณตั้งบาร์ให้ท่านั้นเอง น้ำหนักที่บันทึกยังเป็นน้ำหนักรวม',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'ท่าส่วนใหญ่ในคลังใช้ “{0}” บางท่าใช้ “{1}” ถ้าจะใช้บาร์สั้นทุกท่า ให้ตั้งทั้งสองอย่าง',+ 'Back to the standard bars': 'กลับไปใช้บาร์มาตรฐาน',+ 'Standard bars. Tap if yours are lighter.': 'บาร์มาตรฐาน แตะถ้าบาร์ของคุณเบากว่า',+ 'The last warm-up still gets the full rest before your first work set.': 'เซ็ตวอร์มอัพสุดท้ายยังได้พักเต็มก่อนเซ็ตหลักเซ็ตแรก',}diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.jsindex b246d4897..8ad3015ad 100644--- a/frontend/src/locales/tr.js+++ b/frontend/src/locales/tr.js@@ -2375,4 +2375,13 @@ export default {'Workout running': 'Antrenman sürüyor','Set {0} of {1}': 'Set {0}/{1}','All sets done': 'Tüm setler tamam',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'Barların',+ 'Set the bar once for every exercise of a type.': 'Barı bir türdeki tüm egzersizler için bir kez ayarla.',+ 'Your bar for this type, set in Your bars.': 'Bu tür için barın, Barların bölümünde ayarlandı.',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'Salonundaki barların ağırlığı. O barla yapılan her egzersiz, kendine ait bir bar vermediysen diskleri buradan hesaplar. Kaydedilen ağırlıklar toplam olarak kalır.',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'Kütüphanedeki çoğu egzersiz “{0}”, birkaçı “{1}” kullanır. Her yerde kısa bar için ikisini de ayarla.',+ 'Back to the standard bars': 'Standart barlara dön',+ 'Standard bars. Tap if yours are lighter.': 'Standart barlar. Seninkiler daha hafifse dokun.',+ 'The last warm-up still gets the full rest before your first work set.': 'Son ısınma seti yine de ilk çalışma setinden önce tam dinlenmeyi alır.',}diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.jsindex 13e7e55a5..82a98a096 100644--- a/frontend/src/locales/uk.js+++ b/frontend/src/locales/uk.js@@ -2372,4 +2372,13 @@ export default {'Workout running': 'Тренування триває','Set {0} of {1}': 'Підхід {0} з {1}','All sets done': 'Усі підходи зроблено',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': 'Твої грифи',+ 'Set the bar once for every exercise of a type.': 'Задай гриф один раз для всіх вправ одного типу.',+ 'Your bar for this type, set in Your bars.': 'Твій гриф для цього типу, заданий у «Твої грифи».',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': 'Скільки важать грифи у твоєму залі. Кожна вправа з цим грифом рахує блини від нього, якщо ти не задав їй власний. Записані ваги лишаються загальними.',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': 'Більшість вправ у бібліотеці використовують «{0}», деякі «{1}». Щоб короткий гриф був усюди, задай обидва.',+ 'Back to the standard bars': 'Повернути стандартні грифи',+ 'Standard bars. Tap if yours are lighter.': 'Стандартні грифи. Торкнися, якщо твої легші.',+ 'The last warm-up still gets the full rest before your first work set.': 'Останній розминковий підхід усе одно отримує повний відпочинок перед першим робочим.',}diff --git a/frontend/src/locales/zh-TW.js b/frontend/src/locales/zh-TW.jsindex 3ec8840b7..2557f8460 100644--- a/frontend/src/locales/zh-TW.js+++ b/frontend/src/locales/zh-TW.js@@ -2368,4 +2368,13 @@ export default {'Workout running': '訓練進行中','Set {0} of {1}': '第 {0} 組,共 {1} 組','All sets done': '所有組已完成',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': '你的槓鈴桿',+ 'Set the bar once for every exercise of a type.': '依類型設定一次,該類型的所有動作都會套用。',+ 'Your bar for this type, set in Your bars.': '你為這類槓設定的重量,來自「你的槓鈴桿」。',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': '你健身房裡槓鈴桿的重量。用這根槓的每個動作都從它開始算槓片,除非你替動作另外設了槓。記錄的重量仍是總重。',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': '動作庫裡大多數動作用「{0}」,少數用「{1}」。想全部用短槓,兩個都要設。',+ 'Back to the standard bars': '恢復標準槓鈴桿',+ 'Standard bars. Tap if yours are lighter.': '標準槓鈴桿。如果你的比較輕,點這裡。',+ 'The last warm-up still gets the full rest before your first work set.': '最後一組熱身仍會在第一組正式組前完整休息。',}diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.jsindex a8b7325e9..47794c223 100644--- a/frontend/src/locales/zh.js+++ b/frontend/src/locales/zh.js@@ -2375,4 +2375,13 @@ export default {'Workout running': '训练进行中','Set {0} of {1}': '第 {0} 组,共 {1} 组','All sets done': '所有组已完成',+ // --- your bars + warm-up rest default (Discord) ---+ 'Your bars': '你的杠铃杆',+ 'Set the bar once for every exercise of a type.': '按类型设置一次,该类型的所有动作都用它。',+ 'Your bar for this type, set in Your bars.': '你为这类杆设置的重量,来自「你的杠铃杆」。',+ 'What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.': '你健身房里杠铃杆的重量。用这根杆的每个动作都从它开始算杠铃片,除非你给动作单独设了杆。记录的重量仍是总重。',+ 'Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.': '动作库里大多数动作用「{0}」,少数用「{1}」。想全部用短杆,两个都要设。',+ 'Back to the standard bars': '恢复标准杠铃杆',+ 'Standard bars. Tap if yours are lighter.': '标准杠铃杆。如果你的更轻,点这里。',+ 'The last warm-up still gets the full rest before your first work set.': '最后一组热身仍会在第一组正式组前完整休息。',}diff --git a/frontend/src/sheets.config-rest.test.jsx b/frontend/src/sheets.config-rest.test.jsxindex 62ed82c7f..59f331295 100644--- a/frontend/src/sheets.config-rest.test.jsx+++ b/frontend/src/sheets.config-rest.test.jsx@@ -88,6 +88,21 @@ describe('exercise settings: rest for warm-ups and between sides', () => {expect('warmupRestOff' in out || 'warmupRestSec' in out || 'sideRestSec' in out).toBe(false)})+ it('without its own, the row names the profile\'s warm-up rest and still writes nothing', () => {+ useStore.setState(s => ({ S: { ...s.S, warmupRestSec: 30 } }))+ const onSave = vi.fn()+ exConfigSheet(ex, { sets: 3, reps: 10, weight: 40, mode: 'reps', warmupSets: 2 }, onSave)+ let host = render(useUI.getState().sheets.at(-1))+ expect(row(host, 'Rest between warm-ups').querySelector('.lrow-v').textContent).toBe('Default (30s)')+ act(() => save(host))+ expect('warmupRestOff' in onSave.mock.calls[0][0] || 'warmupRestSec' in onSave.mock.calls[0][0]).toBe(false)+ useStore.setState(s => ({ S: { ...s.S, warmupRestSec: 0 } }))+ exConfigSheet(ex, { sets: 3, reps: 10, weight: 40, mode: 'reps', warmupSets: 2 }, vi.fn())+ host = render(useUI.getState().sheets.at(-1))+ expect(row(host, 'Rest between warm-ups').querySelector('.lrow-v').textContent).toBe('Default (No timer)')+ useStore.setState(s => { const { warmupRestSec, ...rest } = s.S; return { S: rest } })+ })+it('keeps what it was given: a warm-up rest from the Coach, "no timer", a break between sides', () => {const onSave = vi.fn()exConfigSheet(ex, { sets: 3, reps: 10, weight: 40, mode: 'reps', side: true, warmupRestSec: 45, sideRestSec: 20 }, onSave)diff --git a/frontend/src/sheets.jsx b/frontend/src/sheets.jsxindex 39b4c1023..76baa336c 100644--- a/frontend/src/sheets.jsx+++ b/frontend/src/sheets.jsx@@ -5,7 +5,7 @@ import { EXDB, EXIDX, BODYPARTS, isCardio, isBodyweightEq, allExercises, equipmeimport { activeProfile, exAvailable, ALL_EQUIPMENT, newProfile, profileEquipment, ACC_V } from './lib/equipment.js'import { fmtDate, fmtDateRange, fmtNum, fmtPlate, exerciseNameText, fmtVol, fmtDur, durPart, todayISO, isoOf, uid, exCount, routineCount, setsWorkCount, DAYN, DAYS, weekOrder, weekStartOf, weekDayOffset, MONTHS_LONG, ACCENTS } from './lib/format.js'import { lastEntryFor, bestWeightFor, bestWeightForEntry, buildSets, effectiveRoutineIds, workoutDay, workoutVolume, setsDone, setsDoneActive, setUnitsTotal, lastBW, sessionSections, setLabel, defaultConfig, cleanupSg, modeOf, effortOf, EFFORT, capEffort, stepEffort, isBw, isPerSide, sideReps, workSetsDone, applyIntensifierPlan, MAX_PLANNED_WARMUPS, NOTE_MAX } from './lib/history.js'-import { usesBar, defaultBarWeight, hasBarOverride, isNoBar } from './lib/bar.js'+import { usesBar, hasBarOverride, isNoBar, barTypeWeight, ownBarDefault, barPicks, withBarDefault, withStandardBars, defaultBarWeight, BAR_TYPES } from './lib/bar.js'import { PLATE_SIZES, pairsOf, ownsPlates, withPlatePairs, withStandardPlates, withLoadKind, loadKindFor, baseWeightFor, dropGrid } from './lib/plates.js'import { toScale, rirOf, EFFORT_PRESETS, effortColor } from './lib/effort.js'import { beep, vibrate } from './lib/sound.js'@@ -761,7 +761,10 @@ function BarWeightEditor({ ex, cfg, extra }) {const kind = loadKindFor(st, ctx)const explicit = hasBarOverride(st, ex.id)const noBar = bar && isNoBar(st, ex.id)- const def = defaultBarWeight(ex.eq, st.unit)+ // What "default" means for this bar: your bar for the type (Settings > Equipment > Your bars),+ // else the built-in one.+ const def = barTypeWeight(st, ex.eq)+ const mine = bar && ownBarDefault(st, ex.eq) !== nullconst base = baseWeightFor(st, ex)// The kinds a pick would only be restating. With a `cfg` there is one: the same default the// rows derive. Without one the equipment decides — and for body-weight equipment that answer@@ -785,6 +788,9 @@ function BarWeightEditor({ ex, cfg, extra }) {const n = Math.max(0, Math.round((v || 0) * 100) / 100)if (n > 0) s.barWeights[ex.id] = n; else delete s.barWeights[ex.id]})+ // A quick pick of the type's own weight takes the override off, so the exercise keeps following+ // your bars instead of freezing today's number onto it.+ const pickBar = v => (v === def ? setBar(0) : setBar(v))// "No bar" is a stored 0, which is a different thing from no entry at all: a counterbalanced// Smith carriage weighs nothing in your hands, so the plate math and the drop-set steps must// start from what you logged (issue #138). Clearing it goes back to the bar type's default.@@ -809,12 +815,20 @@ function BarWeightEditor({ ex, cfg, extra }) {{!noBar && <div className="row cfgrow" style={{ marginBottom: 6 }}><Stepper label={bar ? t('Bar ({0})', st.unit) : t('Base weight ({0})', st.unit)} value={base} step={2.5} onChange={setBar} /></div>}- <div className="small dim" style={{ marginBottom: 18 }}>+ {bar && !noBar && <div className="chips" style={{ flexWrap: 'wrap', overflow: 'visible', touchAction: 'auto', marginBottom: 6 }}>+ {[...new Set([def, ...barPicks(st.unit)])].map(w => <button key={w} className={'chip nocap' + (base === w ? ' on' : '')}+ aria-pressed={base === w} onClick={() => pickBar(w)}>{fmtNum(w) + ' ' + st.unit}</button>)}+ </div>}+ <div className="small dim" style={{ marginBottom: bar ? 10 : 18 }}>{noBar ? t('Plates are counted from 0. Turn this off for the default ({0}).', fmtNum(def) + ' ' + st.unit)- : bar ? (explicit ? t('Set to 0 to go back to the default ({0}).', fmtNum(def) + ' ' + st.unit) : t('Default for this bar type.'))+ : bar ? (explicit ? t('Set to 0 to go back to the default ({0}).', fmtNum(def) + ' ' + st.unit) : mine ? t('Your bar for this type, set in Your bars.') : t('Default for this bar type.')): t('The machine or sled itself, before any plate goes on. 0 if it is all plates.')}{extra ? ' ' + extra : ''}</div>+ {/* The profile-wide side of it: one bar weight per type, for every exercise without its own. */}+ {bar && <div className="list menu-list" style={{ marginBottom: 18 }}>+ <Row icon="barbell" title={t('Your bars')} subtitle={t('Set the bar once for every exercise of a type.')} accessory="chevron" onClick={() => barDefaultsSheet()} />+ </div>}</>}</>}@@ -920,6 +934,43 @@ function DumbbellInventorySheet({ close }) {}export const dumbbellInventorySheet = () => ui().openSheet(close => <DumbbellInventorySheet close={close} />)+// Your bars (Settings > Equipment, and the plate-loading editor): one weight per bar type for the+// profile's unit (S.barDefaults, lib/bar.js), for every exercise of that type without a bar of its+// own. A short 15 kg olympic bar is set here once instead of on every lift. Logged weights stay+// totals, so history keeps its meaning; only the plate math and the drop steps move.+function BarDefaultsSheet({ close }) {+ const st = useStore(s => s.S)+ const unit = st.unit === 'lb' ? 'lb' : 'kg'+ const set = (eq, w) => update(s => { s.barDefaults = withBarDefault(s, eq, w) })+ const any = BAR_TYPES.some(eq => ownBarDefault(st, eq) !== null)+ const name = eq => { const n = t(eq); return n.charAt(0).toLocaleUpperCase() + n.slice(1) }+ return <>+ <h3>{t('Your bars')}</h3>+ <div className="muted small" style={{ marginBottom: 14 }}>+ {t('What the bars at your gym weigh. Every exercise with that bar counts plates from it, unless you gave the exercise its own. Logged weights stay totals.')}+ </div>+ {BAR_TYPES.map(eq => {+ const w = barTypeWeight(st, eq)+ const builtIn = defaultBarWeight(eq, unit)+ return <div key={eq} style={{ marginBottom: 12 }}>+ <div className="row cfgrow" style={{ marginBottom: 6 }}>+ <Stepper label={name(eq) + ' (' + unit + ')'} value={w} step={unit === 'lb' ? 5 : 2.5} onChange={v => set(eq, v)} />+ </div>+ <div className="chips" style={{ flexWrap: 'wrap', overflow: 'visible', touchAction: 'auto' }}>+ {[...new Set([builtIn, ...barPicks(unit)])].map(p => <button key={p} className={'chip nocap' + (w === p ? ' on' : '')}+ aria-pressed={w === p} onClick={() => set(eq, p)}>{fmtNum(p) + ' ' + unit}</button>)}+ </div>+ </div>+ })}+ <div className="small dim" style={{ margin: '4px 0 14px' }}>+ {t('Most lifts in the library use “{0}”, a few use “{1}”. A short bar for all of them means setting both.', name('barbell'), name('olympic barbell'))}+ </div>+ {any && <Button onClick={() => update(s => { s.barDefaults = withStandardBars(s); if (!Object.keys(s.barDefaults).length) delete s.barDefaults })} style={{ marginBottom: 8 }}>{t('Back to the standard bars')}</Button>}+ <Button variant="primary" onClick={close}>{t('Done')}</Button>+ </>+}+export const barDefaultsSheet = () => ui().openSheet(close => <BarDefaultsSheet close={close} />)+/* ============================ exercise detail ============================ */// Estimated 1RM for one exercise (issue #18): what the log already implies, plus a calculator// for a set you have not done — so the number is reachable before there is any history.@@ -1700,6 +1751,9 @@ function BackupsSheet({ ex, subs: initial, onChange, close }) {function ExConfig({ ex, existing, onSave, onDelete, onReplace, close, routine, initial, saveLabel, backupsEditable }) {const st = useStore(s => s.S)+ // No warm-up rest of its own: the profile's (Settings > Workout) when it has one, else the work rest.+ const warmAll = typeof st.warmupRestSec === 'number' ? st.warmupRestSec : null+ const warmLikeAll = warmAll === null ? t('Like the work sets') : t('Default ({0})', warmAll > 0 ? fmtRest(warmAll) : t('No timer'))const cardio = isCardio(ex.id)const speedUnit = speedUnitOf(st)const seed = existing || initial || defaultConfig(ex.id)@@ -1954,16 +2008,16 @@ function ExConfig({ ex, existing, onSave, onDelete, onReplace, close, routine, i<div className="small dim" style={{ marginBottom: 18 }}>{t('Rest after each set of this exercise. 0:00 means your default rest.')}</div>- {/* The warm-ups' own rest: like the work sets (no field, as always), no timer, or a time of- their own. The last warm-up still rests the full work rest before the first work set. */}+ {/* The warm-ups' own rest: the profile's or like the work sets (no field, as always), no timer,+ or a time of their own. The last warm-up still rests the full work rest before the first work set. */}{!cardio && <><div className="sect-b cfg-rest" style={{ marginBottom: 6 }}><Row icon="timer" iconTint="var(--yellow)" title={t('Rest between warm-ups')} accessory="chevron"- value={c.warmupRestOff === true ? t('No timer') : c.warmupRestSec > 0 ? fmtRest(c.warmupRestSec) : t('Like the work sets')}+ value={c.warmupRestOff === true ? t('No timer') : c.warmupRestSec > 0 ? fmtRest(c.warmupRestSec) : warmLikeAll}onClick={() => menuSheet({title: t('Rest between warm-ups'),items: [- { icon: 'timer', label: t('Like the work sets'), on: !(c.warmupRestOff === true) && !(c.warmupRestSec > 0), onClick: () => setC(x => { const { warmupRestOff, warmupRestSec, ...rest } = x; return rest }) },+ { icon: 'timer', label: warmLikeAll, on: !(c.warmupRestOff === true) && !(c.warmupRestSec > 0), onClick: () => setC(x => { const { warmupRestOff, warmupRestSec, ...rest } = x; return rest }) },{ icon: 'pause', label: t('No timer'), on: c.warmupRestOff === true, onClick: () => setC(x => { const { warmupRestSec, ...rest } = x; return { ...rest, warmupRestOff: true } }) },{ icon: 'clock', label: t('Pick a time'), on: c.warmupRestOff !== true && c.warmupRestSec > 0, onClick: () => durationSheet({title: t('Rest between warm-ups'), value: c.warmupRestSec > 0 ? c.warmupRestSec : 30, max: REST_MAX, off: t('No timer'),diff --git a/frontend/src/sheets.plates.test.jsx b/frontend/src/sheets.plates.test.jsxindex fb9d92695..955c3c594 100644--- a/frontend/src/sheets.plates.test.jsx+++ b/frontend/src/sheets.plates.test.jsx@@ -8,9 +8,10 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest'import { createRoot } from 'react-dom/client'import { useStore, DEF } from './store/useStore.js'import { useUI } from './store/useUI.js'-import { barWeightSheet, plateInventorySheet } from './sheets.jsx'+import { barWeightSheet, plateInventorySheet, barDefaultsSheet } from './sheets.jsx'import { EXIDX } from './lib/exercises.js'-import { loadKindFor } from './lib/plates.js'+import { loadKindFor, baseWeightFor } from './lib/plates.js'+import { barWeightFor } from './lib/bar.js'const SQUAT = '0043' // barbellconst COCOONS = '0260' // body weight@@ -209,3 +210,66 @@ describe('plate inventory sheet', () => {expect(S().plates.lb[35]).toBe(6)})})++// Discord: "Add short olympic bar (15kg)". Quick picks in the editor, and one bar per type for the+// whole profile (S.barDefaults) that every exercise without its own bar follows.+describe('your bars', () => {+ const OLY = Object.values(EXIDX).find(e => e.eq === 'olympic barbell').id+ const chip = (root, text) => [...root.querySelectorAll('.chip')].find(b => b.textContent.trim() === text)+ const block = (host, label) => stepperOf(host, label).closest('.cfgrow').parentElement+ beforeEach(() => {+ globalThis.IS_REACT_ACT_ENVIRONMENT = true+ useUI.setState({ sheets: [], toasts: [] })+ useStore.setState({ S: { ...JSON.parse(JSON.stringify(DEF)), unit: 'lb' }, user: null })+ document.body.innerHTML = ''+ })+ afterEach(() => { act(() => { mounted.splice(0).forEach(root => root.unmount()) }) })++ it('the editor has quick picks; the type\'s own weight takes the override off again', () => {+ act(() => barWeightSheet(SQUAT))+ const host = mountTopSheet()+ expect(['45 lb', '35 lb', '25 lb', '15 lb'].every(t => chip(host, t))).toBe(true)+ expect(chip(host, '45 lb').classList.contains('on')).toBe(true)+ act(() => chip(host, '35 lb').click())+ expect(S().barWeights[SQUAT]).toBe(35)+ expect(valueOf(stepperOf(host, 'Bar (lb)'))).toBe('35')+ act(() => chip(host, '45 lb').click())+ expect(S().barWeights[SQUAT]).toBeUndefined()+ })++ it('the editor opens Your bars', () => {+ act(() => barWeightSheet(SQUAT))+ const host = mountTopSheet()+ const row = [...host.querySelectorAll('.lrow')].find(r => r.textContent.includes('Your bars'))+ expect(row).toBeTruthy()+ act(() => row.click())+ expect(useUI.getState().sheets).toHaveLength(2)+ expect(mountTopSheet().querySelector('h3').textContent).toBe('Your bars')+ })++ it('a bar set once in Your bars is what every exercise of the type starts from', () => {+ useStore.setState(s => ({ S: { ...s.S, unit: 'kg' } }))+ act(() => barDefaultsSheet())+ const host = mountTopSheet()+ expect(host.textContent).not.toContain('Back to the standard bars')+ act(() => chip(block(host, 'Olympic barbell (kg)'), '15 kg').click())+ expect(S().barDefaults).toEqual({ kg: { 'olympic barbell': 15 } })+ expect(barWeightFor(S(), OLY)).toBe(15)+ expect(baseWeightFor(S(), OLY)).toBe(15)+ expect(barWeightFor(S(), SQUAT)).toBe(20) // a plain "barbell" is its own type+ expect(valueOf(stepperOf(host, 'Olympic barbell (kg)'))).toBe('15')++ act(() => barWeightSheet(OLY))+ const ed = mountTopSheet()+ expect(valueOf(stepperOf(ed, 'Bar (kg)'))).toBe('15')+ expect(chip(ed, '15 kg').classList.contains('on')).toBe(true)+ expect(ed.textContent).toContain('Your bar for this type, set in Your bars.')+ act(() => chip(ed, '20 kg').click()) // this one exercise on a full bar+ expect(S().barWeights[OLY]).toBe(20)+ expect(ed.textContent).toContain('Set to 0 to go back to the default (15 kg).')++ act(() => button(host, 'Back to the standard bars').click())+ expect(S().barDefaults).toBeUndefined()+ expect(barWeightFor({ ...S(), barWeights: {} }, OLY)).toBe(20)+ })+})diff --git a/frontend/src/store/useStore.js b/frontend/src/store/useStore.jsindex 81d07cd49..45f4bfbbd 100644--- a/frontend/src/store/useStore.js+++ b/frontend/src/store/useStore.js@@ -157,6 +157,10 @@ export const DEF = {// lib/bar.js). Personal equipment, so it syncs with the account but never travels in a// shared plan. Logged weights stay the total — this only feeds the plate math.barWeights: {},+ // Your bars, per unit: { kg: { 'olympic barbell': 15, … }, lb: { … } } (lib/bar.js+ // ownBarDefault). What every exercise of that bar type without its own barWeights entry+ // starts from. Not in DEF on purpose: absent means the built-in bars, and a plain setting+ // like restSec for the sync (stamped as a whole in `edited`).// Plate inventory, per unit: { lb: { 45: 1, 35: 1, …, _ts }, kg: { … } } — pairs of each size// you own (lib/plates.js), stamped with when the list was last changed so a sync keeps the// later one (lib/sync-merge.js). Kept per unit: a 45 lb plate is not a 20.4 kg one, so a unitdiff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsxindex b200313e1..bcbe0c5aa 100644--- a/frontend/src/views/Settings.jsx+++ b/frontend/src/views/Settings.jsx@@ -9,6 +9,7 @@ import { copyText } from '../lib/clipboard.js'import { useUI } from '../store/useUI.js'import { ACCENTS, ACCENT_NAMES, todayISO, localTZ, weekStartOf, MONDAY, SUNDAY, fmtPlate } from '../lib/format.js'import { inventoryFor, ownsPlates } from '../lib/plates.js'+import { BAR_TYPES, ownBarDefault } from '../lib/bar.js'import { dumbbellsOf } from '../lib/dumbbells.js'import { effortOf } from '../lib/history.js'import { figureOf } from '../lib/exercises.js'@@ -35,7 +36,7 @@ import { checkForUpdate, downloadAndInstall, fetchChecksum, RELEASES_PAGE } fromimport { selfUpdates } from '../lib/channel.js'import { forgetCoach } from '../lib/coach-api.js'import { REST_MAX, REST_PAUSE_MIN, REST_PAUSE_MAX, fmtRest, fmtDuration } from '../lib/duration.js'-import { starterPlanSheet, confirmSheet, importFromApp, importFromHevy, equipmentProfileSheet, plateInventorySheet, dumbbellInventorySheet, menuSheet } from '../sheets.jsx'+import { starterPlanSheet, confirmSheet, importFromApp, importFromHevy, equipmentProfileSheet, plateInventorySheet, dumbbellInventorySheet, barDefaultsSheet, menuSheet } from '../sheets.jsx'import Icon from '../components/Icon.jsx'import { durationSheet } from '../components/DurationWheel.jsx'import { showsConnection, showsLocalLine } from '../components/SyncBanner.jsx'@@ -457,10 +458,30 @@ export default function Settings({ page = null, find = null, via = null, entryKeonDone: v => update(s => { s.restPauseSec = v }),})} />+ // The rest between warm-up sets for every exercise without its own (Discord: seals' "separate+ // warm-up rest"). Absent is like the work sets, 0 no timer (lib/supersetFlow.js warmupRestSecFor).+ const warmAll = typeof S.warmupRestSec === 'number' ? S.warmupRestSec : null+ const setWarm = v => update(s => { if (v === null) delete s.warmupRestSec; else s.warmupRestSec = v })+ const warmupRestRow = <Row icon="timer" iconTint="var(--yellow)" title={t('Rest between warm-ups')} accessory="chevron"+ subtitle={t('The last warm-up still gets the full rest before your first work set.')}+ value={warmAll === null ? t('Like the work sets') : warmAll > 0 ? fmtRest(warmAll) : t('No timer')}+ onClick={() => menuSheet({+ title: t('Rest between warm-ups'),+ items: [+ { icon: 'timer', label: t('Like the work sets'), on: warmAll === null, onClick: () => setWarm(null) },+ { icon: 'pause', label: t('No timer'), on: warmAll === 0, onClick: () => setWarm(0) },+ { icon: 'clock', label: t('Pick a time'), on: warmAll > 0, onClick: () => durationSheet({+ title: t('Rest between warm-ups'), value: warmAll > 0 ? warmAll : 30, max: REST_MAX, off: t('No timer'),+ onDone: v => setWarm(v > 0 ? v : 0),+ }) },+ ],+ })} />+const pages = {workout: () => <><Section title={t('Rest')} footer={t('Each exercise can have its own rest too. Set it in the exercise settings of a routine.')}>{restRow}+ {warmupRestRow}{restPauseRow}</Section><Section title={t('Logging')}>@@ -1337,9 +1358,16 @@ function EquipmentCard({ S, update }) {const dumbbellSummary = bells.length? bells.map(fmtPlate).join(' · '): t('Any weight. Tap to list the ones you own.')+ // Your bars (lib/bar.js ownBarDefault): the types you set a weight for, in the profile unit.+ const unit = S.unit === 'lb' ? 'lb' : 'kg'+ const ownBars = BAR_TYPES.filter(eq => ownBarDefault(S, eq) !== null)+ const barSummary = ownBars.length+ ? ownBars.map(eq => { const n = t(eq); return n.charAt(0).toLocaleUpperCase() + n.slice(1) + ' ' + fmtPlate(ownBarDefault(S, eq)) + ' ' + unit }).join(' · ')+ : t('Standard bars. Tap if yours are lighter.')return <Section title={t('Equipment')} footer={t('Filters the exercise library and picker, and flags routine exercises that need something you don’t have in the active profile.')}><Row icon="plate" iconTint="var(--orange)" title={t('Plates')} subtitle={plateSummary} accessory="chevron" onClick={() => plateInventorySheet()} /><Row icon="dumbbell" iconTint="var(--teal)" title={t('Dumbbells')} subtitle={dumbbellSummary} accessory="chevron" onClick={() => dumbbellInventorySheet()} />+ <Row icon="barbell" iconTint="var(--blue)" title={t('Your bars')} subtitle={barSummary} accessory="chevron" onClick={() => barDefaultsSheet()} />{profiles.length > 0 && <Row icon="kettlebell" iconTint="var(--acc)" title={t('Filter by equipment')}><Switch checked={!!S.equipFilterOn} onChange={v => update(s => { s.equipFilterOn = v })} /></Row>}diff --git a/frontend/src/views/Settings.warmup-bars.test.jsx b/frontend/src/views/Settings.warmup-bars.test.jsxnew file mode 100644index 000000000..8312fa889--- /dev/null+++ b/frontend/src/views/Settings.warmup-bars.test.jsx@@ -0,0 +1,112 @@+// @vitest-environment happy-dom+import React, { act } from 'react'+import { createRoot } from 'react-dom/client'+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'+import Settings from './Settings.jsx'+import { bindUI } from '../components/ui.jsx'++globalThis.IS_REACT_ACT_ENVIRONMENT = true++const mocks = vi.hoisted(() => {+ const state = { S: null }+ state.snapshot = () => ({+ S: state.S,+ user: null,+ update: mut => {+ const next = structuredClone(state.S)+ mut(next)+ state.S = next+ },+ replaceState: vi.fn(), setUser: vi.fn(), pullState: vi.fn(), pushState: vi.fn(),+ signOut: vi.fn(), signOutAll: vi.fn(), resetDemo: vi.fn(), disconnectServer: vi.fn(),+ })+ return state+})+vi.mock('../store/useStore.js', () => {+ const useStore = selector => selector ? selector(mocks.snapshot()) : mocks.snapshot()+ useStore.getState = mocks.snapshot+ return { useStore, DEF: { reminder: { time: '17:30' } }, hasData: () => false }+})+vi.mock('../store/useUI.js', () => {+ const snap = () => ({ toast: vi.fn(), openSheet: vi.fn() })+ const useUI = selector => selector ? selector(snap()) : snap()+ useUI.getState = snap+ return { useUI }+})+vi.mock('react-router-dom', () => ({ useNavigate: () => () => {} }))+vi.mock('../lib/api.js', () => ({+ api: vi.fn(), webauthnOK: () => false, passkeyLogin: vi.fn(), passkeyRegister: vi.fn(), IS_ANDROID: false,+}))+vi.mock('../lib/push.js', () => ({ pushSupported: () => false, enablePush: vi.fn(), disablePush: vi.fn(), sendTestPush: vi.fn() }))+vi.mock('../lib/wakelock.js', () => ({ wakeLockSupported: () => false }))+vi.mock('../lib/mobile.js', () => ({ MOBILE: false, isAndroid: () => Promise.resolve(false), shareExport: vi.fn(), syncReminder: vi.fn() }))+vi.mock('./MobileOnboarding.jsx', () => ({ ConnectSheet: () => null }))+vi.mock('../sheets.jsx', () => ({+ loadStarterPlan: vi.fn(), starterPlanSheet: vi.fn(), confirmSheet: vi.fn(), importFromApp: vi.fn(),+ importFromHevy: vi.fn(), equipmentProfileSheet: vi.fn(), barDefaultsSheet: vi.fn(),+ menuSheet: opts => { mocks.menu = opts },+}))+vi.mock('../components/DurationWheel.jsx', () => ({ durationSheet: opts => { mocks.wheel = opts } }))++// The Settings view reads the build-time version constant at render time.+globalThis.__APP_VERSION__ ??= 'test'++let host, root+beforeEach(() => {+ mocks.menu = null+ mocks.wheel = null+ mocks.S = {+ unit: 'kg', restSec: 90, restPauseSec: 15, sound: false, effort: 'none',+ gifSize: 'full', workouts: [], routines: [], exWeights: {},+ }+ host = document.createElement('div')+ document.body.appendChild(host)+ root = createRoot(host)+})+afterEach(() => {+ act(() => root.unmount())+ host.remove()+})++const mount = page => act(() => root.render(<Settings page={page} />))+const row = title => [...host.querySelectorAll('.lrow')].find(r => r.querySelector('.lrow-t')?.textContent === title)+const pick = label => act(() => mocks.menu.items.find(i => i.label === label).onClick())++// Discord (seals187): one warm-up rest for every exercise without its own.+describe('Settings: rest between warm-ups', () => {+ it('an older profile reads like the work sets and stores nothing', () => {+ mount('workout')+ expect(row('Rest between warm-ups').querySelector('.lrow-v').textContent).toBe('Like the work sets')+ expect('warmupRestSec' in mocks.S).toBe(false)+ })++ it('no timer is a 0, a picked time its seconds, and like the work sets takes the key away', () => {+ mount('workout')+ act(() => row('Rest between warm-ups').click())+ pick('No timer')+ expect(mocks.S.warmupRestSec).toBe(0)+ mount('workout')+ expect(row('Rest between warm-ups').querySelector('.lrow-v').textContent).toBe('No timer')+ act(() => row('Rest between warm-ups').click())+ pick('Pick a time')+ act(() => mocks.wheel.onDone(30))+ expect(mocks.S.warmupRestSec).toBe(30)+ mount('workout')+ expect(row('Rest between warm-ups').querySelector('.lrow-v').textContent).toBe('30s')+ act(() => row('Rest between warm-ups').click())+ pick('Like the work sets')+ expect('warmupRestSec' in mocks.S).toBe(false)+ })+})++// Discord (adam934912): Your bars sits next to the plates and says which bars are yours.+describe('Settings: your bars', () => {+ it('reads the standard bars, then the ones you set for this unit', () => {+ mount('equipment')+ expect(row('Your bars').textContent).toContain('Standard bars. Tap if yours are lighter.')+ mocks.S = { ...mocks.S, barDefaults: { kg: { 'olympic barbell': 15 }, lb: { barbell: 35 } } }+ mount('equipment')+ expect(row('Your bars').textContent).toContain('Olympic barbell 15 kg')+ expect(row('Your bars').textContent).not.toContain('35')+ })+})diff --git a/frontend/src/views/Workout.jsx b/frontend/src/views/Workout.jsxindex 045455044..02e505a1a 100644--- a/frontend/src/views/Workout.jsx+++ b/frontend/src/views/Workout.jsx@@ -1721,9 +1721,9 @@ function ActiveWorkout({ onActionChange }) {// A pyramid set may carry its own rest, standing in for the exercise's (pyramidRestFor).const setRest = { idx, sec: pyramidRestFor(fresh.entries[idx].target, fresh.entries[idx].sets, i) }const restSec = restSecFor(fresh.entries, freshUnit || [idx], S.restSec, setRest)- // A warm-up ramp set may rest shorter than a work set (the exercise's warmupRestSec); the- // last ramp set, into the first work set, still gets the working rest.- const restAfter = warmupRestSecFor(fresh.entries[idx], i, restSec)+ // A warm-up ramp set may rest shorter than a work set (the exercise's warmupRestSec, else the+ // profile's); the last ramp set, into the first work set, still gets the working rest.+ const restAfter = warmupRestSecFor(fresh.entries[idx], i, restSec, useStore.getState().S.warmupRestSec)// A re-check of finished work must not navigate or reopen a sheet, but it may still owe// you a rest — see restOnRecheck, and the other half of issue #3. A rest that already randiff --git a/frontend/src/views/settings-pages.js b/frontend/src/views/settings-pages.jsindex ef9c4c6c1..15a726dbe 100644--- a/frontend/src/views/settings-pages.js+++ b/frontend/src/views/settings-pages.js@@ -53,6 +53,7 @@ export const SEARCH = [// Workout{ page: 'workout', title: 'Rest timer', icon: 'timer', tint: 'var(--orange)', kw: 'rest pause break seconds minutes timer countdown' },{ page: 'workout', title: 'Rest-pause rest', icon: 'bolt', tint: 'var(--orange)', kw: 'burst cluster rest pause' },+ { page: 'workout', title: 'Rest between warm-ups', icon: 'timer', tint: 'var(--yellow)', kw: 'warm-up warmup ramp rest break timer shorter no rest' },{ page: 'workout', title: 'Effort per set', icon: 'gauge', tint: 'var(--purple)', kw: 'rir rpe effort reps in reserve difficulty', opts: ['RIR', 'RPE'] },{ page: 'workout', title: 'Shown under each exercise', icon: 'history', tint: 'var(--blue)', kw: 'last time best set reference previous', opts: ['Last time', 'Best set'] },{ page: 'workout', title: 'Layout', icon: 'layout', tint: 'var(--blue)', kw: 'workout view cards list compact', opts: ['Cards', 'List', 'Compact'] },@@ -101,6 +102,7 @@ export const SEARCH = [// Equipment{ page: 'equipment', title: 'Plates', icon: 'plate', tint: 'var(--orange)', kw: 'plates bar plate math barbell' },{ page: 'equipment', title: 'Dumbbells', icon: 'dumbbell', tint: 'var(--teal)', kw: 'dumbbells dumbbell rack inventory adjustable weights own home gym' },+ { page: 'equipment', title: 'Your bars', icon: 'barbell', tint: 'var(--blue)', kw: 'bar barbell weight olympic short women 15 kg 35 lb ez trap smith plate math' },{ page: 'equipment', title: 'Filter by equipment', icon: 'kettlebell', tint: 'var(--green)', kw: 'equipment filter home gym', when: c => c.profiles },{ page: 'equipment', title: 'Active profile', icon: 'house', tint: 'var(--blue)', kw: 'equipment profile home gym', when: c => c.profiles },{ page: 'equipment', title: 'Add equipment profile', icon: 'plusCircle', tint: 'var(--green)', kw: 'equipment profile home gym hotel' },diff --git a/frontend/src/views/settings-pages.test.jsx b/frontend/src/views/settings-pages.test.jsxindex df7e78113..a1664ac94 100644--- a/frontend/src/views/settings-pages.test.jsx+++ b/frontend/src/views/settings-pages.test.jsx@@ -274,7 +274,7 @@ describe('the pages', () => {it('every old row has a home: the Workout page holds the rest, logging and the before/during rows', () => {mount('workout')expect([...host.querySelectorAll('.sect-t')].map(e => e.textContent)).toEqual(['Rest', 'Logging', 'Before and during'])- expect(titles()).toEqual(['Rest timer', 'Rest-pause rest', 'Effort per set', 'Shown under each exercise', 'Layout',+ expect(titles()).toEqual(['Rest timer', 'Rest between warm-ups', 'Rest-pause rest', 'Effort per set', 'Shown under each exercise', 'Layout','Collapse completed exercises', 'Skip completed exercises', 'Weigh in before workouts', 'Keep screen awake', 'Exercise animations', 'Fine-tuning'])// QA 10-05: the "screen stays on" line is the awake row's own subtitle, not a section footer// that read as if it explained the animations above it.