Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

feat(workout): the session's volume at the end of the header's progress bar, every layout (#774)

Duarte Santos4bf12fb0d968
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3f61dad72..d7ce9ff3b 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 right
now (the exercise's, the warm-ups', or your default) instead of sitting at 0:00 (#735, thanks
@lodepav).
+- **Volume while you lift.** The progress bar at the top of a workout now ends in the session's
+ volume, adding up every set you tick, in all four layouts. Handy for deciding whether today was
+ enough or you've got one more in you (#774).
- **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.
diff --git a/frontend/src/index.css b/frontend/src/index.css
index 6187ae8de..a0170e87c 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -900,6 +900,12 @@ body.chips-dragging *{cursor:inherit}
.exhd{align-items:center}
.wprog{height:4px;background:var(--surface-2);border-radius:99px;overflow:hidden;margin-bottom:16px}
.wprog i{display:block;height:100%;background:var(--acc);border-radius:99px;transition:width var(--med) var(--ease)}
+/* The bar with the session's volume at its end (#774): 12 px tall where the bar is 4, so it takes
+ 8 px less margin and the header keeps the exact height it has without it. */
+.wprog-row{display:flex;align-items:center;gap:8px;height:12px;margin-bottom:8px}
+.wprog-row .wprog,.whdr.stick .wprog-row .wprog{flex:1;min-width:0;margin-bottom:0}
+.whdr.stick .wprog-row{margin-bottom:2px}
+.wvol{flex:none;font-size:12px;line-height:12px;color:var(--label-2);font-variant-numeric:tabular-nums;white-space:nowrap}
.exmedia{position:relative;border-radius:var(--r-lg);overflow:hidden;background:#fff;margin-bottom:12px}
.exmedia img{width:100%;height:320px;object-fit:contain;display:block}
.exmedia .gifhint,.exmedia .giftoggle{
diff --git a/frontend/src/views/Workout.jsx b/frontend/src/views/Workout.jsx
index 08e1f5a3b..0ec68cc85 100644
--- a/frontend/src/views/Workout.jsx
+++ b/frontend/src/views/Workout.jsx
@@ -8,8 +8,8 @@ import { useUI } from '../store/useUI.js'
import { exOr, betterWeight } from '../lib/exercises.js'
import { usesBar } from '../lib/bar.js'
import { loadKindFor, baseWeightFor, inventoryFor, rowLoad, sameLoad, plateDelta, dropGrid } from '../lib/plates.js'
-import { effectiveRoutines, effectiveRoutineIds, lastEntryFor, bestWeightFor, bestWeightForEntry, freestyleConfig, pickedExerciseConfig, setsDoneActive, setUnitsTotal, supersetUnits, unitOf, setLabel, modeOf, isBw, isPerSide, repStep, EFFORT, effortOf, stepEffort, capEffort, cascadeWeight, insertWarmupRow, barFloor, makeWarmupAt, canBeWarmup, makeWorkAt, removeRowAt, removeLastSet, setSpanAt, copyRowAt, copySpanAt, insertRowAt, pairAdjacent, unpairSuperset, cleanupSg, applyIntensifierPlan, pinnedNoteFor, exNoteFor, setsRepsOf } from '../lib/history.js'
-import { fmtNum, fmtPlate, exerciseNameText, fmtDate, fmtDaysAgo, todayISO, exCount, DAYN } from '../lib/format.js'
+import { effectiveRoutines, effectiveRoutineIds, lastEntryFor, bestWeightFor, bestWeightForEntry, freestyleConfig, pickedExerciseConfig, setsDoneActive, setUnitsTotal, supersetUnits, unitOf, setLabel, modeOf, isBw, isPerSide, repStep, EFFORT, effortOf, stepEffort, capEffort, cascadeWeight, insertWarmupRow, barFloor, makeWarmupAt, canBeWarmup, makeWorkAt, removeRowAt, removeLastSet, setSpanAt, copyRowAt, copySpanAt, insertRowAt, pairAdjacent, unpairSuperset, cleanupSg, applyIntensifierPlan, pinnedNoteFor, exNoteFor, setsRepsOf, sessionVolume } from '../lib/history.js'
+import { fmtNum, fmtPlate, fmtVol, exerciseNameText, fmtDate, fmtDaysAgo, todayISO, exCount, DAYN } from '../lib/format.js'
import { speedUnitOf, toSpeed, fromSpeed } from '../lib/speed.js'
import { clampIncline, hasIncline, inclineFits, inclineFrom, INCLINE_STEP } from '../lib/incline.js'
import { beep, vibrate, unlock } from '../lib/sound.js'
@@ -1254,6 +1254,11 @@ function ActiveWorkout() {
const total = setUnitsTotal(A.entries)
const done = setsDoneActive(A)
+ // The volume so far (#774), in the header every layout shares. It shows from the first second
+ // whenever the session holds something to weigh, so nothing moves when the first set is
+ // ticked; runs, holds and bodyweight work alone have no tonnage to show.
+ const vol = sessionVolume(A, S)
+ const weighable = vol > 0 || A.entries.some(e => { const c = { ...(e.target || {}), id: e.id }; return modeOf(c) === 'reps' && !isBw(c) })
const mutEntry = (idx, fn) => update(s => { fn(s.active.entries[idx]) }, true)
// Clearing an optional field drops the key rather than storing null, so a set only carries
@@ -2133,7 +2138,13 @@ function ActiveWorkout() {
<button className="btn primary pill whdr-finish" aria-label={editing ? t('Save changes') : undefined}
onClick={() => (editing ? finishWorkout() : finishWorkoutSheet({ onDiscard: discardWorkout }))}>{editing ? t('Save') : t('Finish')}</button>
</div>
- <div className="wprog"><i style={{ width: (total ? done / total * 100 : 0) + '%' }} /></div>
+ {/* The volume so far rides at the end of the progress bar (#774): one line that never wraps,
+ so a growing number cannot reflow the header the way a third item in the line above did
+ on a 320 px phone. */}
+ {weighable
+ ? <div className="wprog-row"><div className="wprog"><i style={{ width: (total ? done / total * 100 : 0) + '%' }} /></div>
+ <span className="wvol" data-session-volume>{fmtVol(vol, S.unit)}</span></div>
+ : <div className="wprog"><i style={{ width: (total ? done / total * 100 : 0) + '%' }} /></div>}
{/* In the list the chips ride in the pinned header, so any exercise is one tap away from
anywhere in a long stack. */}
{listMode && chipRow}
diff --git a/frontend/src/views/Workout.session-volume.test.jsx b/frontend/src/views/Workout.session-volume.test.jsx
new file mode 100644
index 000000000..b38e1c8fe
--- /dev/null
+++ b/frontend/src/views/Workout.session-volume.test.jsx
@@ -0,0 +1,75 @@
+// @vitest-environment happy-dom
+// The volume so far, at the end of the workout header's progress bar (#774): every layout shares the
+// header, so all four show it. It is there from the start whenever there is something to weigh,
+// so the line does not change shape on the first tick; a session of bodyweight work has none.
+import React, { act } from 'react'
+import { createRoot } from 'react-dom/client'
+import { MemoryRouter } from 'react-router-dom'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+import Workout from './Workout.jsx'
+import { DEF, useStore } from '../store/useStore.js'
+import { useUI } from '../store/useUI.js'
+
+vi.mock('../lib/sound.js', () => ({ beep: vi.fn(), vibrate: vi.fn(), alertBuzz: vi.fn(), unlock: vi.fn(), restOver: vi.fn() }))
+vi.mock('../lib/api.js', () => ({ api: vi.fn(() => Promise.resolve({})) }))
+
+globalThis.IS_REACT_ACT_ENVIRONMENT = true
+const clone = value => JSON.parse(JSON.stringify(value))
+
+const BENCH = '0025' // barbell bench press
+const PUSHUP = '0662' // push-up, body weight
+const warm = (w, r, done) => ({ w, r, done, phase: 'warmup', warmup: true })
+const work = (w, r, done) => ({ w, r, done })
+const entry = (id, sets) => ({ id, target: { sets: sets.length, reps: 5, mode: 'reps' }, sets })
+
+let root, container
+beforeEach(() => { useUI.setState({ sheets: [], toastMsg: '', timer: null, work: null }) })
+afterEach(() => {
+ if (root) act(() => root.unmount())
+ if (container) container.remove()
+ root = container = null
+})
+
+function mount(entries, patch = {}) {
+ const S = clone(DEF)
+ S.unit = 'kg'
+ Object.assign(S, patch)
+ S.active = { id: 'vol-test', d: '2026-10-23', start: Date.now(), routineId: null, name: 'Push', bw: null, cur: 0, entries, workoutView: S.workoutView }
+ useStore.setState({ S, user: null })
+ container = document.createElement('div')
+ document.body.appendChild(container)
+ root = createRoot(container)
+ act(() => root.render(<MemoryRouter><Workout /></MemoryRouter>))
+}
+const shown = () => container.querySelector('.whdr [data-session-volume]')?.textContent ?? null
+
+describe('session volume in the workout header', () => {
+ for (const view of ['cards', 'list', 'compact', 'focus']) {
+ it(`shows the work done so far in ${view}`, () => {
+ mount([entry(BENCH, [warm(40, 5, true), work(60, 5, true), work(60, 5, false)])], { workoutView: view })
+ expect(shown()).toBe('300 kg')
+ })
+ }
+
+ it('is there before the first set, and follows each tick', () => {
+ mount([entry(BENCH, [work(60, 5, false), work(60, 5, false)])])
+ expect(shown()).toBe('0 kg')
+ act(() => useStore.getState().update(s => { s.active.entries[0].sets[0].done = true }))
+ expect(shown()).toBe('300 kg')
+ })
+
+ it('counts warm-ups when the profile does (#719)', () => {
+ mount([entry(BENCH, [warm(40, 5, true), work(60, 5, true)])], { volumeWarmups: true })
+ expect(shown()).toBe('500 kg')
+ })
+
+ it('reads in the profile unit', () => {
+ mount([entry(BENCH, [work(135, 5, true)])], { unit: 'lb' })
+ expect(shown()).toBe('675 lb')
+ })
+
+ it('stays out of a session with nothing to weigh', () => {
+ mount([entry(PUSHUP, [work(0, 10, true)])])
+ expect(shown()).toBeNull()
+ })
+})