Skip to content

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

fix(stats): label the fatigue percent so it reads as fatigue

Сергей Горбатенкоc296e7ef8b20
diff --git a/frontend/src/views/Stats.jsx b/frontend/src/views/Stats.jsx
index 95adeb76b..20e252f07 100644
--- a/frontend/src/views/Stats.jsx
+++ b/frontend/src/views/Stats.jsx
@@ -274,7 +274,9 @@ function MuscleBalance({ S }) {
{sel && <div style={{ borderTop: 'var(--hair) solid var(--sep)', marginTop: 4, paddingTop: 10 }}>
<div className="mrow">
<span className="nm"><b>{t(MUSCLE_NAME[sel])}</b></span>
- <span className="v">{Math.round(selFatigue * 100)}% · {fatigueLabel(selFatigue)}</span>
+ <span className="v" aria-label={`${t('Fatigue')}: ${Math.round(selFatigue * 100)}% · ${fatigueLabel(selFatigue)}`}>
+ {t('Fatigue')} {Math.round(selFatigue * 100)}% · {fatigueLabel(selFatigue)}
+ </span>
</div>
{selRecovery.toRecoveringMs != null && <div className="small dim">{t('Recovering {0}', fmtRecoveryIn(selRecovery.toRecoveringMs))}</div>}
{selRecovery.toReadyMs != null && <div className="small dim">{t('Ready {0}', fmtRecoveryIn(selRecovery.toReadyMs))}</div>}
diff --git a/frontend/src/views/Stats.recovery.test.jsx b/frontend/src/views/Stats.recovery.test.jsx
index 516d78008..8bb15f55a 100644
--- a/frontend/src/views/Stats.recovery.test.jsx
+++ b/frontend/src/views/Stats.recovery.test.jsx
@@ -286,6 +286,9 @@ describe('Stats muscle recovery view runtime', () => {
const value = lastMap().load.chest
expect(value).toBeGreaterThan(0.5)
expect(muscleCard().textContent).toContain(`${Math.round(value * 100)}%`)
+ // The percentage reads as fatigue, not as completion or recovery: the label
+ // names what is measured and the verdict interprets the band.
+ expect(muscleCard().textContent).toContain('Fatigue ' + Math.round(value * 100) + '%')
// Fatigued chest drops through both bands, so both forecasts render.
expect(muscleCard().textContent).toContain('Recovering in')
expect(muscleCard().textContent).toContain('Ready in')