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.

Stats: an untrained muscle picked on the map offers its exercises (#553)

Duarte Santose705682c0598
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 438f6dadb..a659c4361 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,6 +21,9 @@ seconds at most) instead of nagging you anyway.
rotation and the routine list) and today's session on Home now carry a tiny body, front and back,
with the muscles it works lit up. No more opening Leg Day to remember it is, in fact, legs.
+- **Muscle balance**: tap a muscle you haven't trained right on the map and its row offers the
+ exercises for it, the same way the "Not trained" chips do (#553).
+
**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 that
counts), like adding another device does. A copied browser session can no longer mint a phone
diff --git a/frontend/src/index.css b/frontend/src/index.css
index 4cd44fc6c..ad8c61507 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -1749,6 +1749,8 @@ body.no-tabbar #timer.working{box-shadow:inset 0 var(--hair) 0 var(--acc),0 -10p
.mchip{font-size:12px;padding:4px 9px;border-radius:99px;background:var(--surface-2);color:var(--label-2)}
.mchip.miss{background:color-mix(in srgb,var(--orange) 16%,transparent);color:var(--orange)}
button.mchip{border:none;font:inherit;font-size:12px;cursor:pointer}
+/* "Exercises ›" on an untrained muscle picked on the map (#553), at the end of its row. */
+.mchip.mfind{flex:none;display:inline-flex;align-items:center;gap:2px;padding-inline-end:6px}
/* --- stat tiles --- */
.tiles{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
diff --git a/frontend/src/views/Stats.jsx b/frontend/src/views/Stats.jsx
index 223e48a90..2716da4f6 100644
--- a/frontend/src/views/Stats.jsx
+++ b/frontend/src/views/Stats.jsx
@@ -181,6 +181,10 @@ function MuscleBalance({ S }) {
return t('Weeks since training: {0}', weeks)
}
const toggleSel = m => setSel(s => (s === m ? null : m))
+ // The exercises for a muscle (#553): the untrained chips, and an untrained muscle tapped on the map.
+ const openMuscle = m => nav('/muscles?m=' + encodeURIComponent(m), { state: { from: '/stats' } })
+ const findExercises = m => <button type="button" className="mchip miss mfind" data-find-exercises={m}
+ aria-label={t('Exercises for {0}', t(MUSCLE_NAME[m]))} onClick={() => openMuscle(m)}>{t('Exercises')}<Icon name="chevronRight" /></button>
// Selected-muscle detail for the Fatigue view: the same display value that
// shades the map, as a percentage, plus when it drops back through the bands.
const selFatigue = sel ? (fatigue[sel] || 0) : 0
@@ -229,6 +233,7 @@ function MuscleBalance({ S }) {
aria-label={`${t('Completed')} ${completedSets} · ${t('Planned')} ${plannedSets}`}>
{fmtNum(completed)}/{fmtNum(target)}{percentage == null ? '' : ` · ${percentage}%`}
</span>
+ {sel === muscle && !completed && findExercises(muscle)}
</div>
})
const completionSummary = <>
@@ -236,7 +241,7 @@ function MuscleBalance({ S }) {
<h4 className="sec" style={{ marginTop: 12 }}>{on ? t('No hard sets in this period') : t('Not trained in this period')}</h4>
{/* A tap opens the exercises for that muscle (#553). */}
<div className="mchips">{missed.map(m => <button type="button" key={m} className="mchip miss" data-muscle={m}
- aria-label={t('Exercises for {0}', t(MUSCLE_NAME[m]))} onClick={() => nav('/muscles?m=' + encodeURIComponent(m), { state: { from: '/stats' } })}>{t(MUSCLE_NAME[m])}</button>)}</div>
+ aria-label={t('Exercises for {0}', t(MUSCLE_NAME[m]))} onClick={() => openMuscle(m)}>{t(MUSCLE_NAME[m])}</button>)}</div>
</>}
{!missed.length && worked.length > 0 &&
<div className="muted small" style={{ marginTop: 10 }}>{on
@@ -254,6 +259,7 @@ function MuscleBalance({ S }) {
{sel && <div className="mrow" data-muscle-volume={sel} style={{ borderTop: 'var(--hair) solid var(--sep)', marginTop: 4, paddingTop: 10 }}>
<span className="nm"><b>{t(MUSCLE_NAME[sel])}</b></span>
<span className="v">{sets(sel) ? t('{0} sets', sets(sel)) : on ? t('no hard sets') : t('not trained')}</span>
+ {!(load[sel] > 0) && findExercises(sel)}
</div>}
{!sel && completedMuscles.map(m => <div key={m} className="mrow" data-muscle-volume={m}>
<span className="nm">{t(MUSCLE_NAME[m])}</span>
diff --git a/frontend/src/views/Stats.weekly-volume.test.jsx b/frontend/src/views/Stats.weekly-volume.test.jsx
index 70e030956..05b0eb7a2 100644
--- a/frontend/src/views/Stats.weekly-volume.test.jsx
+++ b/frontend/src/views/Stats.weekly-volume.test.jsx
@@ -290,4 +290,38 @@ describe('Stats — weekly planned vs completed volume', () => {
expect(mocks.nav).toHaveBeenCalledWith('/muscles?m=' + chip.dataset.muscle, { state: { from: '/stats' } })
expect(MUSCLES).toContain(chip.dataset.muscle)
})
+
+ // #553: picking an untrained muscle on the map itself, not only its chip, leads to its exercises.
+ const find = () => host.querySelector('[data-find-exercises]')
+ const tapChest = () => act(() => host.querySelector('[data-body-map] button[aria-label="Chest"]').click())
+
+ it('an untrained muscle picked on the week map offers its exercises', () => {
+ mocks.nav = vi.fn()
+ mount()
+ expect(find()).toBeNull()
+ tapChest()
+ expect(row('chest')).toBeTruthy()
+ expect(find().dataset.findExercises).toBe('chest')
+ expect(find().getAttribute('aria-label')).toBe('Exercises for Chest')
+ act(() => find().click())
+ expect(mocks.nav).toHaveBeenCalledWith('/muscles?m=chest', { state: { from: '/stats' } })
+ })
+
+ it('an untrained muscle picked on the 30-day map offers its exercises, a trained one does not', () => {
+ mocks.nav = vi.fn()
+ mount()
+ act(() => [...host.querySelectorAll('button')].find(b => b.textContent === '30d').click())
+ tapChest()
+ expect(find().dataset.findExercises).toBe('chest')
+ act(() => find().click())
+ expect(mocks.nav).toHaveBeenCalledWith('/muscles?m=chest', { state: { from: '/stats' } })
+
+ act(() => root.unmount()); root = createRoot(host)
+ mocks.S = state({ workouts: [completed('2026-09-30', 'chest', 3)] })
+ mount()
+ act(() => [...host.querySelectorAll('button')].find(b => b.textContent === '30d').click())
+ tapChest()
+ expect(host.querySelector('[data-muscle-volume="chest"]')).toBeTruthy()
+ expect(find()).toBeNull()
+ })
})