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
feat(volume): "Count warm-ups in volume" switch, read by every volume the app shows (#719)
Duarte Santos90fc09425487
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d4a0f84d3..3f61dad72 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -70,6 +70,9 @@ per muscle. Settings → Workout → Fine-tuning turns it off.- **The rest wheel starts where your rest is.** Pick a time opens on the rest that applies rightnow (the exercise's, the warm-ups', or your default) instead of sitting at 0:00 (#735, thanks@lodepav).+- **Count warm-ups in volume**, if you like (#719). A new switch in Settings → Units & language+ adds your done warm-ups to every volume the app shows: the workout, the summary, history,+ Stats, the report and the coach. Off by default, and records ignore warm-ups either way.**Security.** Follow-ups to v1.4.2's audit.- **Pairing the phone app asks you to confirm it's you** (passkey, or your password where thatdiff --git a/frontend/src/components/Heatmap.jsx b/frontend/src/components/Heatmap.jsxindex 45ba9958d..019394014 100644--- a/frontend/src/components/Heatmap.jsx+++ b/frontend/src/components/Heatmap.jsx@@ -1,6 +1,6 @@import { useEffect, useRef, useState } from 'react'import { fmtVol, isoOf, todayISO, MONTHS, weekStartOf, weekDayOffset } from '../lib/format.js'-import { workoutDay, workoutDuration, workoutVolume } from '../lib/history.js'+import { workoutDay, workoutDuration, sessionVolume } from '../lib/history.js'import { t, tn } from '../lib/i18n.js'import { tappable } from '../lib/use-sheet-keyboard.js'import { Segmented } from './ui.jsx'@@ -8,15 +8,6 @@ import { dayNoteOf, dayNoteLine } from '../lib/day-notes.js'const normalizeMetric = value => value === 'vol' ? 'vol' : 'time'-// Legacy records without entries only have the cached volume available. Current records are-// always recomputed from their completed sets so unit changes and warm-up/per-side rules stay-// authoritative.-const volumeOf = w => {- if (Array.isArray(w?.entries)) return Math.max(0, Number(workoutVolume(w)) || 0)- const volume = Number(w?.vol)- return Number.isFinite(volume) ? Math.max(0, volume) : 0-}-// GitHub-style activity heatmap, shaded by the selected time or volume metric per day.export default function Heatmap({ S, onDay, metric: selectedMetric, onMetricChange }) {const wrapRef = useRef(null)@@ -37,7 +28,8 @@ export default function Heatmap({ S, onDay, metric: selectedMetric, onMetricChanif (!day) returnconst a = agg[day] = agg[day] || { n: 0, vol: 0, min: 0 }a.n++- a.vol += volumeOf(w)+ // Recounted from the sets (sessionVolume), so units, per-side and the warm-up switch apply.+ a.vol += sessionVolume(w, S)a.min += Math.max(0, Math.round(workoutDuration(w) / 60000))})const values = Object.values(agg).map(a => a[metricValue]).filter(v => v > 0).sort((a, b) => a - b)diff --git a/frontend/src/lib/coach-insights.js b/frontend/src/lib/coach-insights.jsindex 5c62bc215..17efe7ba3 100644--- a/frontend/src/lib/coach-insights.js+++ b/frontend/src/lib/coach-insights.js@@ -6,7 +6,7 @@// window it names, which is why an old proposal in the thread still draws its chart months// later, against the data as it was then.import { EXIDX } from './exercises.js'-import { workoutVolume, workoutAt } from './history.js'+import { sessionVolume, workoutAt } from './history.js'import { isWarmupRow } from './workout-model.js'import { bestSetOf } from './onerm.js'import { weighInAt } from './bodyweight.js'@@ -31,7 +31,8 @@ export function windowWorkouts(S, { from, to } = {}) {export function insightsFor(S, win = {}, { topN = 3 } = {}) {const ws = windowWorkouts(S, win)const minutes = ws.map(w => (w.end && w.start ? Math.round((w.end - w.start) / 60000) : null)).filter(n => n > 0)- const volume = ws.reduce((n, w) => n + (Number.isFinite(w.vol) ? w.vol : workoutVolume(w)), 0)+ // The volume the app shows, so the coach and the Stats screen quote the same number (#719).+ const volume = ws.reduce((n, w) => n + sessionVolume(w, S), 0)const byBp = {}let setsTotal = 0@@ -89,7 +90,7 @@ export function sessionInsights(S, workout) {const before = (idx >= 0 ? all.slice(0, idx) : all).filter(w => w.name && w.name === workout.name)const prev = before[before.length - 1] || nullconst stat = w => ({- volume: Math.round(Number.isFinite(w.vol) ? w.vol : workoutVolume(w)),+ volume: Math.round(sessionVolume(w, S)),sets: (w.entries || []).reduce((n, en) => n + (en.sets || []).filter(s => s.done && !isWarmupRow(s)).length, 0),minutes: w.end && w.start ? Math.round((w.end - w.start) / 60000) : null,prs: (w.prs || []).lengthdiff --git a/frontend/src/lib/exercise-history.js b/frontend/src/lib/exercise-history.jsindex f7376a0c1..451fb0d99 100644--- a/frontend/src/lib/exercise-history.js+++ b/frontend/src/lib/exercise-history.js@@ -1,5 +1,5 @@-import { metricEntriesForExercise, metricRowsForEntry, bestWeightForEntry, completedRepsOf, modeOf, workoutAt } from './history.js'-import { completedVolumeOf } from './workout-model.js'+import { metricEntriesForExercise, metricRowsForEntry, bestWeightForEntry, completedRepsOf, modeOf, workoutAt, countsWarmups } from './history.js'+import { completedVolumeOf, isWarmupRow } from './workout-model.js'import { bestSetOf } from './onerm.js'import { beatsWeight } from './exercises.js'import { currentDbLoad, historyAs, volumeFactor, workoutAs } from './dumbbells.js'@@ -18,7 +18,8 @@ import { currentDbLoad, historyAs, volumeFactor, workoutAs } from './dumbbells.j// mode still appears in the list (its sets are labelled by their own target) but gets no point// and no value, so the curve never mixes seconds with kilos.//-// Warm-up rows are excluded from every number here, as everywhere else.+// Warm-up rows are excluded from every number here, as everywhere else, except a session's+// volume when the profile counts warm-ups in it (#719).export const HISTORY_SESSIONS = 10@@ -43,7 +44,10 @@ export function exerciseHistory(S, exId, { limit = HISTORY_SESSIONS } = {}) {const sameMode = entries.filter(item => item.mode === mode)const rows = sameMode.flatMap(item => item.rows)const en = { ...sameMode.at(-1).entry, sets: rows }- if (rows.length) logged.push({ w, en, mode, rows })+ // Its done warm-ups, only ever added to the session's volume and only when the profile+ // counts them (#719): the sets, the best and the curve stay work sets.+ const warm = countsWarmups(S) ? sameMode.flatMap(item => (item.entry.sets || []).filter(isWarmupRow)) : []+ if (rows.length) logged.push({ w, en, mode, rows, warm })})logged.sort((a, b) => workoutAt(a.w) - workoutAt(b.w))@@ -62,7 +66,7 @@ export function exerciseHistory(S, exId, { limit = HISTORY_SESSIONS } = {}) {let best = 0, prId = nullconst sessions = [], points = [], e1rmPoints = []- logged.forEach(({ w, en, mode: m, rows }) => {+ logged.forEach(({ w, en, mode: m, rows, warm }) => {const same = m === modeconst value = same ? valueOf({ en, rows }) : nullconst e1rm = m === 'reps' ? (bestSetOf(en)?.est ?? null) : null@@ -74,7 +78,7 @@ export function exerciseHistory(S, exId, { limit = HISTORY_SESSIONS } = {}) {if (e1rm != null) e1rmPoints.push({ t, d: w.d, y: e1rm })sessions.push({id: w.id, d: w.d, t, mode: m, target: en.target || null, sets: rows, value, e1rm,- volume: m === 'reps' ? entryVolume(rows, en) : null,+ volume: m === 'reps' ? entryVolume(warm.length ? [...warm, ...rows] : rows, en) : null,})})// The "first reached" rule only holds for records above zero: a bodyweight session withdiff --git a/frontend/src/lib/history.js b/frontend/src/lib/history.jsindex 09f976dfc..0f62de7d5 100644--- a/frontend/src/lib/history.js+++ b/frontend/src/lib/history.js@@ -741,7 +741,7 @@ function shapeRows(sets, cfg, grid) {}return [warmup, work]}-export function workoutVolume(w) {+export function workoutVolume(w, { warmups = false } = {}) {let v = 0// Count each completed limb at its own load, including drops. A rest-pause side's r already// includes its bursts. Unchecked limbs and warm-ups contribute no volume.@@ -758,11 +758,22 @@ export function workoutVolume(w) {;(Array.isArray(w?.entries) ? w.entries : []).forEach(e => {const f = volumeFactor(e);(Array.isArray(e?.sets) ? e.sets : []).forEach(s => {- if (!isWarmupRow(s)) v += completedVolumeOf(s) * f+ if (warmups || !isWarmupRow(s)) v += completedVolumeOf(s) * f})})return v}+// Settings → Units → "Count warm-ups in volume" (#719), off by default. The saved `vol` stays+// work sets only whatever it says, so the switch only changes what screens show and can be+// flipped back without rewriting a single workout.+export const countsWarmups = S => S?.volumeWarmups === true+// The volume a screen shows for one session: counted from its sets, so units and the warm-up+// switch always apply. A legacy record without entries only has its cached number.+export function sessionVolume(w, S) {+ if (Array.isArray(w?.entries)) return Math.max(0, Number(workoutVolume(w, { warmups: countsWarmups(S) })) || 0)+ const v = Number(w?.vol)+ return Number.isFinite(v) ? Math.max(0, v) : 0+}// Finished sessions carry their canonical local calendar day in `d`. Keep it aligned with// History/calendar readers, and use the local start timestamp only for older records whose date// is missing or malformed. Invalid records stay out of the activity map.diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.jsindex bb6674ac5..c51d9731c 100644--- a/frontend/src/lib/pt-br-locale.test.js+++ b/frontend/src/lib/pt-br-locale.test.js@@ -41,7 +41,7 @@ describe('Brazilian Portuguese locale', () => {// has to be taught is a number nobody reads. What the numbers stood for is asserted above.// If the hash fails, review the changed keys and wording before accepting a new one. From// frontend/: node scripts/pt-br-inheritance-fingerprint.mjs --list- expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('a8af138d039c4140ca1c38aa1e1fe8d74d77466c1762804c257c4804fda727fb')+ expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('5854fc8bd0fa65b51bf0a54694cdd181e6993bc11c0bced2fb520e7fdbb1f75e')})// pt-PT labelled Unpair 'Desfazer': Undo, in Portuguese (it is pt-BR's Undo), on the button thatdiff --git a/frontend/src/lib/report-print.js b/frontend/src/lib/report-print.jsindex ff07725f6..e0e8e4843 100644--- a/frontend/src/lib/report-print.js+++ b/frontend/src/lib/report-print.js@@ -4,7 +4,7 @@// lib/print-doc.js. Charts are inline SVG drawn here, so they stay sharp at any zoom and print the// same on every platform. No exercise media is ever put on paper.import { EXIDX } from './exercises.js'-import { setLabel, sessionSections, workoutVolume, workoutDuration, workoutDay } from './history.js'+import { setLabel, sessionSections, workoutVolume, sessionVolume, countsWarmups, workoutDuration, workoutDay } from './history.js'import { isWarmupRow, hasCompletedWork } from './workout-model.js'import { fmtNum, fmtVol, fmtDur, fmtDate, todayISO, DAYS, weekOrder, weekDayOffset } from './format.js'import { t, tn, dateLocale } from './i18n-core.js'@@ -287,7 +287,7 @@ function setsHTML(e, speedUnit) {return rows.length ? `<div class="sets">${rows.join('')}</div>` : ''}-function entryVolume(e) { return workoutVolume({ entries: [e] }) }+function entryVolume(e, S) { return workoutVolume({ entries: [e] }, { warmups: countsWarmups(S) }) }/*** One finished workout on paper: what it was, when, how long and how heavy, then every exercise@@ -301,7 +301,7 @@ export function workoutPrintHTML(S, w, { owner = '', probe = false } = {}) {const ms = workoutDuration(w)const day = workoutDay(w)const sets = workSetsOf(w)- const vol = w.vol ?? workoutVolume(w)+ const vol = sessionVolume(w, S)const cards = [ms >= 60000 ? card(t('Duration'), esc(fmtDur(ms))) : '',card(t('Sets'), esc(fmtNum(sets))),@@ -312,7 +312,7 @@ export function workoutPrintHTML(S, w, { owner = '', probe = false } = {}) {].filter(Boolean).slice(0, 6)let num = 0const exHTML = e => {- const v = entryVolume(e)+ const v = entryVolume(e, S)const done = (e.sets || []).filter(s => !isWarmupRow(s) && hasCompletedWork(s)).lengthconst sum = [t('{0} sets', done), v > 0 ? fmtVol(v, unit) : ''].filter(Boolean).join(' · ')return `<div class="wx"><div class="wx-h"><div class="wx-num">${++num}</div><div class="wx-main">${nameHTML(e, { pr: prs.has(e.id) })}</div><div class="wx-sum">${esc(sum)}</div></div>`@@ -427,7 +427,7 @@ function prsHTML(R, unit, m) {function workoutListItem(S, w, unit, speedUnit, m, id, lead = '') {const prs = new Set(w.prs || [])const ms = workoutDuration(w)- const facts = [ms >= 60000 ? fmtDur(ms) : '', fmtVol(w.vol ?? workoutVolume(w), unit), t('{0} sets', workSetsOf(w))].filter(Boolean).join(' · ')+ const facts = [ms >= 60000 ? fmtDur(ms) : '', fmtVol(sessionVolume(w, S), unit), t('{0} sets', workSetsOf(w))].filter(Boolean).join(' · ')const rows = workoutUnits(w).flat().map((e, j) => {const sets = (e.sets || []).filter(s => !isWarmupRow(s) && hasCompletedWork(s)).map(s => setLabel(e.id, s, e.target, speedUnit))if (!sets.length) return ''diff --git a/frontend/src/lib/report.js b/frontend/src/lib/report.jsindex f0fab86b2..4f7f42d03 100644--- a/frontend/src/lib/report.js+++ b/frontend/src/lib/report.js@@ -3,14 +3,14 @@// here without a browser.//// The rules are the app's own, read through the same helpers the Stats screen uses:-// - volume is workoutVolume (work sets only, both sides of a per-side set, both dumbbells when+// - volume is sessionVolume (work sets only unless warm-ups are switched in, #719; both sides of a per-side set, both dumbbells when// logged per bell); sets are ticked work sets, a per-side set counting once per side, like the// share card (lib/workout-card.js);// - muscles are loadOfWorkouts, the Muscle balance card's effective sets;// - the 1RM trend is e1rmSeries, the Exercise progress card's "Est. 1RM";// - new bests are the ones each workout recorded when it was finished (w.prs).// Nothing here writes to the state.-import { workoutVolume, workoutDuration, workoutDay, workoutAt, doneUnits, streakWeeks } from './history.js'+import { sessionVolume, workoutDuration, workoutDay, workoutAt, doneUnits, streakWeeks } from './history.js'import { isWarmupRow } from './workout-model.js'import { loadOfWorkouts, rankOf, MUSCLE_NAME } from './muscles.js'import { e1rmSeries, bestSetOf, formulaOf } from './onerm.js'@@ -53,19 +53,19 @@ export function reportRange(range, { from, to, today = todayISO() } = {}) {// Ticked work sets: warm-ups left out, a per-side set counted once per side.export const workSetsOf = w => (w.entries || []).reduce((n, e) => n + (e.sets || []).reduce((m, s) => m + (isWarmupRow(s) ? 0 : doneUnits(s)), 0), 0)-// Legacy records without entries only carry the cached volume (the activity heatmap's rule).-const volumeOf = w => Array.isArray(w?.entries) ? Math.max(0, Number(workoutVolume(w)) || 0) : Math.max(0, Number(w?.vol) || 0)+// sessionVolume: counted from the sets, warm-ups in only when the profile says so (#719); legacy+// records without entries carry the cached volume. `S` is the profile, absent in older callers.export const inRange = (S, { from, to }) => (S.workouts || []).filter(w => { const d = workoutDay(w); return d && d >= from && d <= to }).sort((a, b) => (workoutAt(a) || 0) - (workoutAt(b) || 0))/** Headline numbers for a list of workouts (and the weigh-ins over the same days). */-export function totalsOf(workouts, bodyweight = []) {+export function totalsOf(workouts, bodyweight = [], S) {const t = { workouts: workouts.length, volume: 0, sets: 0, ms: 0, prs: 0, days: 0 }const days = new Set()for (const w of workouts) {- t.volume += volumeOf(w)+ t.volume += sessionVolume(w, S)t.sets += workSetsOf(w)t.ms += workoutDuration(w)t.prs += new Set(w.prs || []).size@@ -89,7 +89,7 @@ const weighInsIn = (S, { from, to }) => (S.bodyweight || [])* weeks or less, per week (the profile's first weekday) up to about four months, per month beyond.* Every bucket in the range is there, the empty ones too, so the gaps show.*/-export function bucketsOf(workouts, { from, to, days }, ws) {+export function bucketsOf(workouts, { from, to, days }, ws, S) {const unit = days <= 14 ? 'day' : days <= 124 ? 'week' : 'month'const keyOf = iso => unit === 'day' ? iso : unit === 'week' ? weekKey(iso, ws) : iso.slice(0, 7) + '-01'const buckets = []@@ -101,19 +101,19 @@ export function bucketsOf(workouts, { from, to, days }, ws) {for (const w of workouts) {const b = byKey[keyOf(workoutDay(w))]if (!b) continue- b.volume += volumeOf(w); b.sets += workSetsOf(w); b.workouts+++ b.volume += sessionVolume(w, S); b.sets += workSetsOf(w); b.workouts++}buckets.forEach(b => { b.volume = Math.round(b.volume * 10) / 10 })return { unit, buckets }}/** Every day of the range for the consistency calendar, shaded 0–4 by volume like the heatmap. */-export function calendarOf(workouts, { from, to }) {+export function calendarOf(workouts, { from, to }, S) {const agg = {}for (const w of workouts) {const d = workoutDay(w)const a = agg[d] = agg[d] || { n: 0, volume: 0 }- a.n++; a.volume += volumeOf(w)+ a.n++; a.volume += sessionVolume(w, S)}const values = Object.values(agg).map(a => a.volume).filter(v => v > 0).sort((a, b) => a - b)const q = p => (values.length ? values[Math.min(values.length - 1, Math.floor(p * values.length))] : 0)@@ -216,15 +216,15 @@ export function reportData(S, { range = '4w', from, to, today = todayISO() } = {const weighIns = weighInsIn(S, r)const before = { from: addDays(r.from, -r.days), to: addDays(r.from, -1), days: r.days }const prevWorkouts = inRange(S, before)- const totals = totalsOf(workouts, weighIns)+ const totals = totalsOf(workouts, weighIns, S)return {range: { ...r, kind: range },workouts,totals,- prev: totalsOf(prevWorkouts, weighInsIn(S, before)),+ prev: totalsOf(prevWorkouts, weighInsIn(S, before), S),perWeek: Math.round(workouts.length / (r.days / 7) * 10) / 10,- buckets: bucketsOf(workouts, r, ws),- calendar: calendarOf(workouts, r),+ buckets: bucketsOf(workouts, r, ws, S),+ calendar: calendarOf(workouts, r, S),muscles: musclesOfRange(workouts),lifts: topLiftsOf(S, workouts, r),prs: prsOf(S, workouts),diff --git a/frontend/src/lib/volume-warmups.test.js b/frontend/src/lib/volume-warmups.test.jsnew file mode 100644index 000000000..9e37e1ab5--- /dev/null+++ b/frontend/src/lib/volume-warmups.test.js@@ -0,0 +1,86 @@+// "Count warm-ups in volume" (#719): off is the app's own rule, work sets only; on, every number+// that says "volume" counts the done warm-ups too. The saved `vol` never changes, so the switch+// can go back and forth without touching history. Records and progression never read warm-ups.+import { describe, expect, it } from 'vitest'+import { workoutVolume, sessionVolume, countsWarmups } from './history.js'+import { totalsOf, reportData } from './report.js'+import { exerciseHistory } from './exercise-history.js'+import { insightsFor, sessionInsights } from './coach-insights.js'+import { workoutCardModel } from './workout-card.js'+import { workoutText } from './workout-text.js'++const BENCH = '0025'+const warm = (w, r, done = true) => ({ w, r, done, phase: 'warmup', warmup: true })+const work = (w, r, done = true) => ({ w, r, done })+// 2 done warm-ups (20×10 + 40×5 = 400), 1 skipped (60×3), 2 work sets (60×5 ×2 = 600).+const session = (d, extra = {}) => ({+ id: d, d, name: 'Push', start: Date.parse(d + 'T10:00:00'), end: Date.parse(d + 'T11:00:00'),+ entries: [{ id: BENCH, target: { sets: 2, reps: 5 }, sets: [warm(20, 10), warm(40, 5), warm(60, 3, false), work(60, 5), work(60, 5)] }],+ vol: 600, prs: [], ...extra,+})+const profile = (on, workouts = [session('2026-10-01'), session('2026-10-08')]) =>+ ({ unit: 'kg', volumeWarmups: on, workouts, bodyweight: [], routines: [], exWeights: {} })++describe('workoutVolume and the warm-up switch', () => {+ it('leaves warm-ups out unless asked, and never counts one that was not done', () => {+ const w = session('2026-10-01')+ expect(workoutVolume(w)).toBe(600)+ expect(workoutVolume(w, { warmups: true })).toBe(1000)+ })++ it('reads the profile: off unless switched on', () => {+ expect(countsWarmups({})).toBe(false)+ expect(countsWarmups({ volumeWarmups: true })).toBe(true)+ expect(sessionVolume(session('2026-10-01'), profile(false))).toBe(600)+ expect(sessionVolume(session('2026-10-01'), profile(true))).toBe(1000)+ })++ it('a legacy record without entries keeps its cached number either way', () => {+ expect(sessionVolume({ vol: 1234 }, profile(true))).toBe(1234)+ expect(sessionVolume({}, profile(true))).toBe(0)+ })++ it('a per-side warm-up counts each side, as a work set does', () => {+ const w = { entries: [{ id: BENCH, sets: [{ ...warm(0, 0), sides: { L: { w: 10, r: 5, done: true }, R: { w: 12, r: 5, done: true } } }] }] }+ expect(workoutVolume(w, { warmups: true })).toBe(110)+ expect(workoutVolume(w)).toBe(0)+ })+})++describe('every reader follows it', () => {+ it('the performance report', () => {+ const S = profile(true)+ expect(totalsOf(S.workouts).volume).toBe(1200)+ expect(totalsOf(S.workouts, [], S).volume).toBe(2000)+ const R = reportData(S, { range: 'custom', from: '2026-09-28', to: '2026-10-10', today: '2026-10-10' })+ expect(R.totals.volume).toBe(2000)+ expect(R.buckets.buckets.reduce((n, b) => n + b.volume, 0)).toBe(2000)+ expect(R.calendar.reduce((n, c) => n + c.volume, 0)).toBe(2000)+ expect(reportData(profile(false), { range: 'custom', from: '2026-09-28', to: '2026-10-10', today: '2026-10-10' }).totals.volume).toBe(1200)+ })++ it('the exercise history: the session volume, never the best or the sets', () => {+ const on = exerciseHistory(profile(true), BENCH)+ const off = exerciseHistory(profile(false), BENCH)+ expect(off.sessions[0].volume).toBe(600)+ expect(on.sessions[0].volume).toBe(1000)+ expect(on.best).toBe(off.best)+ expect(on.sessions[0].sets).toEqual(off.sessions[0].sets)+ })++ it('the coach quotes the number the app shows', () => {+ expect(insightsFor(profile(false)).volume).toBe(1200)+ expect(insightsFor(profile(true)).volume).toBe(2000)+ const S = profile(true)+ expect(sessionInsights(S, S.workouts[1]).now.volume).toBe(1000)+ })++ it('the share card and Copy as text', () => {+ const w = session('2026-10-01')+ const vol = m => m.stats.find(s => s.label === 'Volume').value+ expect(vol(workoutCardModel(w, { unit: 'kg', nameOf: () => 'Bench' }))).toBe('600 kg')+ expect(vol(workoutCardModel(w, { unit: 'kg', nameOf: () => 'Bench', warmups: true }))).toBe('1,000 kg')+ expect(workoutText(w, { unit: 'kg', nameOf: () => 'Bench' })).toContain('600 kg')+ expect(workoutText(w, { unit: 'kg', nameOf: () => 'Bench', warmups: true })).toContain('1,000 kg')+ })+})diff --git a/frontend/src/lib/workout-card.js b/frontend/src/lib/workout-card.jsindex 9206fb86a..bb861a3fd 100644--- a/frontend/src/lib/workout-card.js+++ b/frontend/src/lib/workout-card.js@@ -29,9 +29,10 @@ const MAP_MAX_HEIGHT = 560* left out of both, the way they are left out of records and progression everywhere else. A* per-side set counts once per side, as the workout screen counts it. `levels` is the finish* summary's muscle map for this one session (levelsOf over loadOfWorkouts), null when no set- * reached a muscle the map can show — a card of only cardio has nothing to shade.+ * reached a muscle the map can show — a card of only cardio has nothing to shade. `warmups` is the+ * profile's "Count warm-ups in volume" (#719): the volume counts them then, the sets still do not.*/-export function workoutCardModel(w, { unit, nameOf }) {+export function workoutCardModel(w, { unit, nameOf, warmups = false }) {const entries = w.entries || []const sets = entries.reduce((n, e) => n + (e.sets || []).reduce((m, s) => m + (isWarmupRow(s) ? 0 : doneUnits(s)), 0), 0)// New bests in the order the sheet lists the exercises, each named once — a combined session@@ -54,7 +55,7 @@ export function workoutCardModel(w, { unit, nameOf }) {stats: [...(ms >= 60000 ? [{ label: t('Duration'), value: fmtDur(ms) }] : []),{ label: t('Sets'), value: fmtNum(sets) },- { label: t('Volume'), value: fmtVol(w.vol ?? workoutVolume(w), unit) },+ { label: t('Volume'), value: fmtVol(warmups ? workoutVolume(w, { warmups }) : (w.vol ?? workoutVolume(w)), unit) },],records: records.map(r => r.name),levels: MUSCLES.some(m => levels[m] > 0) ? levels : null,diff --git a/frontend/src/lib/workout-text.js b/frontend/src/lib/workout-text.jsindex cf9f46958..20ed1c061 100644--- a/frontend/src/lib/workout-text.js+++ b/frontend/src/lib/workout-text.js@@ -14,10 +14,11 @@ import { t, exerciseNameClass } from './i18n-core.js'* then each exercise (a superset's under one "Superset" line, its members together), then the* session note.*/-export function workoutText(w, { unit, nameOf, speedUnit }) {+export function workoutText(w, { unit, nameOf, speedUnit, warmups = false }) {const facts = [...durPart((w.end || 0) - (w.start || 0)),- fmtVol(w.vol ?? workoutVolume(w), unit),+ // `warmups`: the profile counts warm-ups in volume (#719); the set list below stays work sets.+ fmtVol(warmups ? workoutVolume(w, { warmups }) : (w.vol ?? workoutVolume(w)), unit),...(w.bw ? [t('Body weight') + ' ' + fmtNum(w.bw) + ' ' + unit] : []),]const blocks = [[[w.name, fmtDate(w.d, true, true)].filter(Boolean).join(' · '), facts.join(' · ')].join('\n')]diff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.jsindex e6b2da3f8..db0612acc 100644--- a/frontend/src/locales/ar.js+++ b/frontend/src/locales/ar.js@@ -159,6 +159,8 @@ export default {'Workout complete!': 'اكتمل التمرين!','Duration': 'المدة','Volume': 'حجم التدريب',+ 'Count warm-ups in volume': 'احتساب الإحماء في حجم التدريب',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': 'مفيد عند المقارنة مع تطبيق آخر. الأرقام القياسية تتجاهل الإحماء في كل الأحوال.','PRs': 'الأرقام القياسية','New PR:': 'رقم قياسي جديد:','Nice!': 'رائع!',diff --git a/frontend/src/locales/bn.js b/frontend/src/locales/bn.jsindex 75dcb2e62..5aa2fa736 100644--- a/frontend/src/locales/bn.js+++ b/frontend/src/locales/bn.js@@ -186,6 +186,8 @@ export default {'Workout complete!': 'ওয়ার্কআউট সম্পন্ন!','Duration': 'সময়কাল','Volume': 'ভলিউম',+ 'Count warm-ups in volume': 'ভলিউমে ওয়ার্ম-আপ গুনুন',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': 'অন্য অ্যাপের সাথে তুলনা করতে কাজে লাগে। রেকর্ড সব সময়ই ওয়ার্ম-আপ বাদ দেয়।','PRs': 'রেকর্ড','New PR:': 'নতুন রেকর্ড:','Nice!': 'দারুণ!',diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.jsindex 42a233652..568e1ad7b 100644--- a/frontend/src/locales/de.js+++ b/frontend/src/locales/de.js@@ -162,6 +162,8 @@ export default {'Workout complete!': 'Training abgeschlossen!','Duration': 'Dauer','Volume': 'Volumen',+ 'Count warm-ups in volume': 'Aufwärmsätze ins Volumen zählen',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': 'Praktisch, wenn du mit einer anderen App vergleichst. Rekorde ignorieren Aufwärmsätze so oder so.','PRs': 'Rekorde','New PR:': 'Neuer Rekord:','Nice!': 'Stark!',diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.jsindex 014cfb295..836a99d72 100644--- a/frontend/src/locales/es.js+++ b/frontend/src/locales/es.js@@ -155,6 +155,8 @@ export default {'Workout complete!': '¡Entrenamiento completado!','Duration': 'Duración','Volume': 'Volumen',+ 'Count warm-ups in volume': 'Contar el calentamiento en el volumen',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': 'Útil si comparas con otra app. Los récords ignoran el calentamiento de todos modos.','PRs': 'Récords','New PR:': 'Nuevo récord:','Nice!': '¡Genial!',diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.jsindex db5121d14..502742fbc 100644--- a/frontend/src/locales/fr.js+++ b/frontend/src/locales/fr.js@@ -155,6 +155,8 @@ export default {'Workout complete!': 'Séance terminée !','Duration': 'Durée','Volume': 'Volume',+ 'Count warm-ups in volume': 'Compter les échauffements dans le volume',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': 'Pratique pour comparer avec une autre appli. Les records ignorent les échauffements dans tous les cas.','PRs': 'Records','New PR:': 'Nouveau record :','Nice!': 'Bien joué !',diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.jsindex a6a9c0d2c..45ba5f90a 100644--- a/frontend/src/locales/hi.js+++ b/frontend/src/locales/hi.js@@ -155,6 +155,8 @@ export default {'Workout complete!': 'वर्कआउट पूरा!','Duration': 'अवधि','Volume': 'वॉल्यूम',+ 'Count warm-ups in volume': 'वॉल्यूम में वार्म-अप गिनें',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': 'किसी दूसरे ऐप से तुलना करते समय काम आता है। रिकॉर्ड वार्म-अप को हर हाल में नज़रअंदाज़ करते हैं।','PRs': 'रिकॉर्ड','New PR:': 'नया रिकॉर्ड:','Nice!': 'बहुत बढ़िया!',diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.jsindex 9a8fb9648..f36a0cdd3 100644--- a/frontend/src/locales/hu.js+++ b/frontend/src/locales/hu.js@@ -153,6 +153,8 @@ export default {'Workout complete!': 'Edzés kész!','Duration': 'Időtartam','Volume': 'Volumen',+ 'Count warm-ups in volume': 'Bemelegítés beszámítása a volumenbe',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': 'Jól jön, ha egy másik appal hasonlítasz össze. A rekordok így is, úgy is figyelmen kívül hagyják a bemelegítést.','PRs': 'Rekordok','New PR:': 'Új rekord:','Nice!': 'Szuper!',diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.jsindex c80c31084..d9a250246 100644--- a/frontend/src/locales/it.js+++ b/frontend/src/locales/it.js@@ -155,6 +155,8 @@ export default {'Workout complete!': 'Allenamento completato!','Duration': 'Durata','Volume': 'Volume',+ 'Count warm-ups in volume': 'Conta il riscaldamento nel volume',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': "Utile se fai il confronto con un'altra app. I record ignorano comunque il riscaldamento.",'PRs': 'Record','New PR:': 'Nuovo record:','Nice!': 'Grande!',diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.jsindex 322461c47..5e12cdd76 100644--- a/frontend/src/locales/ko.js+++ b/frontend/src/locales/ko.js@@ -155,6 +155,8 @@ export default {'Workout complete!': '운동 완료!','Duration': '시간','Volume': '볼륨',+ 'Count warm-ups in volume': '워밍업을 볼륨에 포함',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': '다른 앱과 비교할 때 유용해요. 기록에는 어느 쪽이든 워밍업이 반영되지 않아요.','PRs': '신기록','New PR:': '신기록:','Nice!': '좋아요!',diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.jsindex 80f2fe7cd..6ee3eacb1 100644--- a/frontend/src/locales/pl.js+++ b/frontend/src/locales/pl.js@@ -155,6 +155,8 @@ export default {'Workout complete!': 'Trening ukończony!','Duration': 'Czas','Volume': 'Objętość',+ 'Count warm-ups in volume': 'Wliczaj rozgrzewkę do objętości',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': 'Przydaje się przy porównaniu z inną aplikacją. Rekordy i tak pomijają rozgrzewkę.','PRs': 'Rekordy','New PR:': 'Nowy rekord:','Nice!': 'Świetnie!',diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.jsindex 88d31aa53..c0c62ffb0 100644--- a/frontend/src/locales/pt-BR.js+++ b/frontend/src/locales/pt-BR.js@@ -4,6 +4,7 @@import pt from './pt.js'export const PT_BR_OVERRIDES = {+ 'Handy when you compare with another app. Records ignore warm-ups either way.': 'Ajuda quando você compara com outro app. Os recordes ignoram o aquecimento de qualquer jeito.','{0} set brings an {1} with it. Switch on Effort per set in Settings to see it.': '{0} série traz um {1} junto. Ative “Esforço por série” nas Configurações para ver.','Add to this set': 'Adicionar a esta série','Copy this exercise’s warm-up sets, and the rest and note from its Exercise settings, into the routine. A note added for today stays with this workout. Your workout history is kept.': 'Copia para a rotina as séries de aquecimento deste exercício, e o descanso e a anotação das Configurações do exercício dele. Uma anotação adicionada para hoje fica com este treino. Seu histórico de treinos é mantido.',diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.jsindex c9c17713b..d1ec393b1 100644--- a/frontend/src/locales/pt.js+++ b/frontend/src/locales/pt.js@@ -155,6 +155,8 @@ export default {'Workout complete!': 'Treino concluído!','Duration': 'Duração','Volume': 'Volume',+ 'Count warm-ups in volume': 'Contar aquecimentos no volume',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': 'Dá jeito quando comparas com outra app. Os recordes ignoram os aquecimentos de qualquer forma.','PRs': 'Recordes','New PR:': 'Novo recorde:','Nice!': 'Boa!',diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.jsindex 557753bba..b9483bd6e 100644--- a/frontend/src/locales/ru.js+++ b/frontend/src/locales/ru.js@@ -151,6 +151,8 @@ export default {'Workout complete!': 'Тренировка завершена!','Duration': 'Время','Volume': 'Объём',+ 'Count warm-ups in volume': 'Учитывать разминку в объёме',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': 'Удобно, если сравниваешь с другим приложением. Рекорды в любом случае не учитывают разминку.','PRs': 'Рекорды','New PR:': 'Новый рекорд:','Nice!': 'Отлично!',diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.jsindex 177261246..cd4e32369 100644--- a/frontend/src/locales/th.js+++ b/frontend/src/locales/th.js@@ -153,6 +153,8 @@ export default {'Workout complete!': 'ออกกำลังกายเสร็จสิ้น!','Duration': 'ระยะเวลา','Volume': 'ปริมาณงาน',+ 'Count warm-ups in volume': 'นับเซ็ตวอร์มอัพในปริมาณงาน',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': 'สะดวกเวลาเทียบกับแอปอื่น สถิติสูงสุดไม่นับวอร์มอัพอยู่แล้วไม่ว่าแบบไหน','PRs': 'สถิติใหม่','New PR:': 'สถิติใหม่:','Nice!': 'เยี่ยม!',diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.jsindex fd314d42a..ba2ddf54d 100644--- a/frontend/src/locales/tr.js+++ b/frontend/src/locales/tr.js@@ -155,6 +155,8 @@ export default {'Workout complete!': 'Antrenman tamamlandı!','Duration': 'Süre','Volume': 'Hacim',+ 'Count warm-ups in volume': 'Isınma setlerini hacme kat',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': 'Başka bir uygulamayla karşılaştırırken işe yarar. Rekorlar ısınmayı her durumda saymaz.','PRs': 'Rekorlar','New PR:': 'Yeni rekor:','Nice!': 'Süper!',diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.jsindex 055f089dd..d7a839e9f 100644--- a/frontend/src/locales/uk.js+++ b/frontend/src/locales/uk.js@@ -137,6 +137,8 @@ export default {'Workout complete!': 'Тренування завершено!','Duration': 'Час','Volume': 'Обсяг',+ 'Count warm-ups in volume': 'Враховувати розминку в обсязі',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': 'Зручно, коли порівнюєш з іншим застосунком. Рекорди в будь-якому разі не враховують розминку.','PRs': 'Рекорди','New PR:': 'Новий рекорд:','Nice!': 'Чудово!',diff --git a/frontend/src/locales/zh-TW.js b/frontend/src/locales/zh-TW.jsindex 60d7ab028..9e946bd81 100644--- a/frontend/src/locales/zh-TW.js+++ b/frontend/src/locales/zh-TW.js@@ -151,6 +151,8 @@ export default {'Workout complete!': '訓練完成!','Duration': '時間','Volume': '總訓練量',+ 'Count warm-ups in volume': '熱身組計入總訓練量',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': '和其他 App 比較時很方便。紀錄無論如何都不算熱身組。','PRs': '個人紀錄','New PR:': '突破個人紀錄:','Nice!': '太棒了!',diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.jsindex 8cb4b6398..eed731fa9 100644--- a/frontend/src/locales/zh.js+++ b/frontend/src/locales/zh.js@@ -155,6 +155,8 @@ export default {'Workout complete!': '训练完成!','Duration': '时长','Volume': '总量',+ 'Count warm-ups in volume': '热身组计入总量',+ 'Handy when you compare with another app. Records ignore warm-ups either way.': '和其他应用对比时很方便。纪录无论如何都不算热身组。','PRs': '纪录','New PR:': '新纪录:','Nice!': '太棒了!',diff --git a/frontend/src/sheets.jsx b/frontend/src/sheets.jsxindex 45d214a7a..6e92ed056 100644--- a/frontend/src/sheets.jsx+++ b/frontend/src/sheets.jsx@@ -4,7 +4,7 @@ import { useUI } from './store/useUI.js'import { EXDB, EXIDX, BODYPARTS, isCardio, isBodyweightEq, allExercises, equipmentOf, byCategory, smOf, searchExercises, similarExercises, exOr, isAssisted, betterWeight, beatsWeight, isCustomEx } from './lib/exercises.js'import { 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, pickedExerciseConfig, cleanupSg, modeOf, effortOf, EFFORT, capEffort, stepEffort, isBw, isPerSide, sideReps, workSetsDone, applyIntensifierPlan, MAX_PLANNED_WARMUPS, NOTE_MAX } from './lib/history.js'+import { lastEntryFor, bestWeightFor, bestWeightForEntry, buildSets, effectiveRoutineIds, workoutDay, workoutVolume, sessionVolume, countsWarmups, setsDone, setsDoneActive, setUnitsTotal, lastBW, sessionSections, setLabel, defaultConfig, pickedExerciseConfig, cleanupSg, modeOf, effortOf, EFFORT, capEffort, stepEffort, isBw, isPerSide, sideReps, workSetsDone, applyIntensifierPlan, MAX_PLANNED_WARMUPS, NOTE_MAX } from './lib/history.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'@@ -1103,7 +1103,7 @@ export const exerciseDetailSheet = ex => ui().openSheet(close => <ExerciseDetailfunction ExerciseHistory({ exId }) {const st = useStore(s => s.S)const ex = exOr(exId)- const h = useMemo(() => exerciseHistory(st, exId), [st.workouts, exId])+ const h = useMemo(() => exerciseHistory(st, exId), [st.workouts, exId, st.volumeWarmups])const [curve, setCurve] = useState('top')const onE1 = curve === 'e1rm' && h.e1rmPoints.length > 0const unit = h.metric === 'weight' ? st.unit : h.metric === 'reps' ? t('reps') : h.metric === 'sec' ? 's' : t('min')@@ -2682,7 +2682,7 @@ function WorkoutDetail({ w, close }) {// Copied with the note as it stands in the box, which may not be saved yet.const copyAsText = async () => {const rec = { ...(st.workouts.find(x => sameWorkout(x, w)) || w), note: note.trim() }- toast(await copyText(workoutText(rec, { unit: st.unit, nameOf, speedUnit: speedUnitOf(st) })) ? t('Copied') : t('Could not copy'))+ toast(await copyText(workoutText(rec, { unit: st.unit, nameOf, speedUnit: speedUnitOf(st), warmups: countsWarmups(st) })) ? t('Copied') : t('Could not copy'))}// A Garmin .fit activity (#447) of the saved record, for Garmin Connect's Import Data.const exportFit = () => {@@ -2709,12 +2709,12 @@ function WorkoutDetail({ w, close }) {const grouped = groups.length > 1 || (groups[0] && groups[0].rid && (w.routineIds || []).length > 1)return <><h3>{w.name}</h3>- <div className="muted small" style={{ marginBottom: 12 }}>{[fmtDate(w.d, true), ...durPart(w.end - w.start), fmtVol(w.vol, st.unit), ...(w.bw ? [fmtNum(w.bw) + ' ' + st.unit] : [])].join(' · ')}</div>+ <div className="muted small" style={{ marginBottom: 12 }}>{[fmtDate(w.d, true), ...durPart(w.end - w.start), fmtVol(sessionVolume(w, st), st.unit), ...(w.bw ? [fmtNum(w.bw) + ' ' + st.unit] : [])].join(' · ')}</div>{grouped ? groups.map(g => {const r = g.rid ? st.routines.find(x => x.id === g.rid) : nullconst items = g.items.map(i => w.entries[i])const setN = items.reduce((n, e) => n + e.sets.filter(s => s.done && !isWarmupRow(s)).length, 0)- const vol = workoutVolume({ entries: items })+ const vol = workoutVolume({ entries: items }, { warmups: countsWarmups(st) })return <div key={g.rid || '__none'}><div className="row between" style={{ margin: '2px 0 8px', paddingBottom: 6, borderBottom: '1px solid var(--sep)' }}><div className="row" style={{ gap: 7, fontWeight: 600 }}>@@ -2795,7 +2795,8 @@ function ShareWorkoutImage({ w, nameOf, close }) {const st = useStore(s => s.S)const update = useStore(s => s.update)const withMap = st.shareMap !== false- const model = useMemo(() => workoutCardModel(w, { unit: st.unit, nameOf }), [w, st.unit])+ const warmups = countsWarmups(st)+ const model = useMemo(() => workoutCardModel(w, { unit: st.unit, nameOf, warmups }), [w, st.unit, warmups])// The last picture stays up while the next one is drawn, so the toggle never blanks the sheet.const [img, setImg] = useState(null)const [busy, setBusy] = useState(false)@@ -2899,7 +2900,7 @@ function Calendar({ start, close }) {const startOffset = weekDayOffset(new Date(y, mo, 1).getDay(), ws)const daysIn = new Date(y, mo + 1, 0).getDate()const monthWs = st.workouts.filter(w => workoutDay(w)?.startsWith(y + '-' + String(mo + 1).padStart(2, '0')))- const monthVol = monthWs.reduce((a, w) => a + (w.vol || 0), 0)+ const monthVol = monthWs.reduce((a, w) => a + sessionVolume(w, st), 0)const monthMs = monthWs.reduce((a, w) => a + Math.max(0, (w.end || w.start) - w.start), 0)const cells = []for (let i = 0; i < startOffset; i++) cells.push(<div key={'e' + i} />)@@ -2946,7 +2947,7 @@ export function WorkoutRow({ w, onClick }) {return <div className="item" {...tappable(onClick)}><span className="lrow-i" style={{ width: 34, height: 34, borderRadius: 8, fontSize: 19 }}><Icon name={glyph} /></span><div className="grow"><div className="tt">{w.name}</div>- <div className="ss">{[fmtDate(w.d, true), ...durPart(w.end - w.start), tn('{0} set', '{0} sets', setsDone(w)), fmtVol(w.vol, st.unit)].join(' · ')}</div></div>+ <div className="ss">{[fmtDate(w.d, true), ...durPart(w.end - w.start), tn('{0} set', '{0} sets', setsDone(w)), fmtVol(sessionVolume(w, st), st.unit)].join(' · ')}</div></div>{mediaN > 0 && <span className="wrow-media" title={tn('{0} photo or video', '{0} photos or videos', mediaN)} aria-label={tn('{0} photo or video', '{0} photos or videos', mediaN)}><Icon name="image" />{mediaN}</span>}{w.prs && w.prs.length > 0 && <span className="pr"><Icon name="trophy" />{w.prs.length} PR</span>}<Icon name="chevronRight" className="chev" />@@ -3538,7 +3539,7 @@ function FinishSummary({ w, prs, e1prs = [], additions = [], close }) {<h3 style={{ margin: '8px 0' }}>{t('Workout complete!')}</h3><div className="tiles fin" style={{ textAlign: 'start' }}><div className="tile"><div className="l">{t('Duration')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{fmtDur(w.end - w.start)}</div></div>- <div className="tile"><div className="l">{t('Volume')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{fmtVol(w.vol, st.unit)}</div></div>+ <div className="tile"><div className="l">{t('Volume')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{fmtVol(sessionVolume(w, st), st.unit)}</div></div><div className="tile wide"><div className="l">{t('Sets')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{setsWorkCount(setsDone(w), workSetsDone(w))}</div></div><div className="tile narrow"><div className="l">{t('PRs')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{prs.length || '–'}</div></div></div>diff --git a/frontend/src/store/useStore.js b/frontend/src/store/useStore.jsindex 9a797c587..ba54aa58a 100644--- a/frontend/src/store/useStore.js+++ b/frontend/src/store/useStore.js@@ -108,6 +108,8 @@ export const DEF = {exWeights: {}, workouts: [], active: null, customEx: [], gifSize: 'full',// Stats activity heatmap metric. Profiles without this key continue to open on time.heatmapMetric: 'time',+ // Settings → Units → "Count warm-ups in volume" (#719): off keeps volume to work sets.+ volumeWarmups: false,// How the active workout is laid out — 'cards' (one exercise at a time with Prev/Next),// 'list' (every exercise stacked and scrollable) or 'compact' (that stack stripped to just// names and set rows — no media, tags, notes, last-time or progression line). Purelydiff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsxindex f3857effc..45ba7147a 100644--- a/frontend/src/views/Settings.jsx+++ b/frontend/src/views/Settings.jsx@@ -779,6 +779,14 @@ export default function Settings({ page = null, find = null, via = null, entryKe{ value: 'lander', label: 'Lander' },{ value: 'weighted', label: t('Blend of all'), subtitle: t('Averages seven formulas and reads your RIR when you log it.') },]} />+ {/* Gross volume for people comparing with other apps (#719). Off is the app's own rule,+ work sets only; on, every screen that shows a volume counts done warm-ups too+ (lib/history.js sessionVolume). Records and progression never read warm-ups. */}+ <Row icon="sunrise" iconTint="var(--teal)" title={t('Count warm-ups in volume')}+ subtitle={t('Handy when you compare with another app. Records ignore warm-ups either way.')}>+ <Switch aria-label={t('Count warm-ups in volume')} checked={S.volumeWarmups === true}+ onChange={v => update(s => { s.volumeWarmups = v })} />+ </Row></Section></>,diff --git a/frontend/src/views/Settings.volume-warmups.test.jsx b/frontend/src/views/Settings.volume-warmups.test.jsxnew file mode 100644index 000000000..04c6e0969--- /dev/null+++ b/frontend/src/views/Settings.volume-warmups.test.jsx@@ -0,0 +1,89 @@+// @vitest-environment happy-dom+// Settings → Units → "Count warm-ups in volume" (#719): off until switched on, and the switch+// stores the choice and nothing else (saved workouts keep their work-set volume).+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'++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(),+}))++// The Settings view reads the build-time version constant at render time.+globalThis.__APP_VERSION__ ??= 'test'++let host, root+beforeEach(() => {+ 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 = () => act(() => root.render(<Settings page="units" />))+const toggle = () => host.querySelector('[aria-label="Count warm-ups in volume"]')++describe('Settings: count warm-ups in volume', () => {+ it('is off for a profile that never chose', () => {+ mount()+ expect(toggle()).not.toBeNull()+ expect(toggle().getAttribute('aria-checked')).toBe('false')+ })++ it('stores the choice and leaves the workouts alone', () => {+ mocks.S.workouts = [{ id: 'a', d: '2026-10-01', vol: 600, entries: [{ id: '0025', sets: [{ w: 20, r: 10, done: true, warmup: true, phase: 'warmup' }, { w: 60, r: 10, done: true }] }] }]+ const before = structuredClone(mocks.S)+ mount()+ act(() => { toggle().click() })+ expect(mocks.S.volumeWarmups).toBe(true)+ expect({ ...mocks.S, volumeWarmups: undefined }).toEqual({ ...before, volumeWarmups: undefined })+ mount()+ act(() => { toggle().click() })+ expect(mocks.S.volumeWarmups).toBe(false)+ })+})diff --git a/frontend/src/views/settings-pages.js b/frontend/src/views/settings-pages.jsindex c2ac926e2..54bc96d98 100644--- a/frontend/src/views/settings-pages.js+++ b/frontend/src/views/settings-pages.js@@ -108,6 +108,7 @@ export const SEARCH = [{ page: 'units', title: 'Weight decimals', icon: 'ruler', tint: 'var(--teal)', kw: 'decimals precision microplates rounding' },{ page: 'units', title: 'Speed unit', icon: 'figureRun', tint: 'var(--teal)', kw: 'speed mph kmh km/h miles cardio' },{ page: 'units', title: '1RM formula', icon: 'chart', tint: 'var(--teal)', kw: '1rm one rep max epley brzycki lombardi formula estimate' },+ { page: 'units', title: 'Count warm-ups in volume', icon: 'sunrise', tint: 'var(--teal)', kw: 'warm-up warmup volume tonnage total gross work sets' },// 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' },