diff --git a/frontend/src/index.css b/frontend/src/index.css index 9de4f63..024eebe 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -777,6 +777,18 @@ h4.sec{ .bm-m.l2{fill:color-mix(in srgb,var(--acc) 56%,var(--bm-base))} .bm-m.l3{fill:color-mix(in srgb,var(--acc) 78%,var(--bm-base))} .bm-m.l4{fill:var(--acc)} +/* Fatigue view: attention ramp - fatigued muscles highlighted (owner tweak 2026-08-06) */ +.hm-fatigue .bm-m.l4{fill:var(--red)} +.hm-fatigue .bm-m.l3{fill:var(--orange)} +.hm-fatigue .bm-m.l2{fill:var(--yellow)} +.hm-fatigue .bm-m.l1{fill:color-mix(in srgb,var(--yellow) 32%,var(--bm-base))} +.hm-fatigue .hm-c.l4{background:var(--red)} +.hm-fatigue .hm-c.l3{background:var(--orange)} +.hm-fatigue .hm-c.l2{background:var(--yellow)} +/* Strength view: top band pops gold (owner tweak 2026-08-06) */ +.hm-strength .bm-m.l4{fill:var(--yellow);filter:drop-shadow(0 0 1.5px var(--yellow))} +.hm-strength .hm-c.l4{background:var(--yellow)} + .bm-m.sel{stroke:var(--label);stroke-width:7} .bodymap.tappable .bm-m{cursor:pointer} /* A hairline in the surface colour separates neighbouring muscles; the artwork has no diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js index 2ad8876..69c5006 100644 --- a/frontend/src/locales/de.js +++ b/frontend/src/locales/de.js @@ -384,6 +384,8 @@ export default { 'Fatigued': 'Ermüdet', 'Fatigue shows how recently each muscle was trained. High means rest.': 'Die Ermüdung zeigt, wie lange das Training jedes Muskels zurückliegt. Ein hoher Wert bedeutet: Pause.', 'Strength shows retained muscle strength. Train again to reset it.': 'Die Kraft zeigt, wie viel Muskelkraft erhalten ist. Trainiere erneut, um sie zurückzusetzen.', + 'full': 'voll', + 'floor': 'Minimum', 'Weeks since training: {0}': 'Zuletzt vor {0} Wo. trainiert', 'by sets worked': 'nach Sätzen', 'Week': 'Woche', diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js index 537af83..21bdad4 100644 --- a/frontend/src/locales/es.js +++ b/frontend/src/locales/es.js @@ -366,6 +366,8 @@ export default { 'Fatigued': 'Fatigado', 'Fatigue shows how recently each muscle was trained. High means rest.': 'La fatiga indica cuánto tiempo ha pasado desde el último entrenamiento de cada músculo. Un valor alto indica que toca descansar.', 'Strength shows retained muscle strength. Train again to reset it.': 'La fuerza muestra cuánta fuerza muscular se conserva. Vuelve a entrenar para restablecerla.', + 'full': 'completo', + 'floor': 'mínimo', 'Weeks since training: {0}': 'Último entrenamiento: hace {0} sem.', 'by sets worked': 'por series trabajadas', 'Week': 'Semana', diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js index e233a3b..df946a2 100644 --- a/frontend/src/locales/fr.js +++ b/frontend/src/locales/fr.js @@ -366,6 +366,8 @@ export default { 'Fatigued': 'Fatigué', 'Fatigue shows how recently each muscle was trained. High means rest.': 'La fatigue indique à quand remonte le dernier entraînement de chaque muscle. Un niveau élevé signifie qu’il est temps de se reposer.', 'Strength shows retained muscle strength. Train again to reset it.': 'La force indique combien de force musculaire est conservée. Entraîne-toi à nouveau pour la réinitialiser.', + 'full': 'complet', + 'floor': 'plancher', 'Weeks since training: {0}': 'Dernier entraînement : il y a {0} sem.', 'by sets worked': 'par séries effectuées', 'Week': 'Semaine', diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js index bbf2947..e649b62 100644 --- a/frontend/src/locales/hi.js +++ b/frontend/src/locales/hi.js @@ -366,6 +366,8 @@ export default { 'Fatigued': 'थकी हुई', 'Fatigue shows how recently each muscle was trained. High means rest.': 'थकान बताती है कि हर मांसपेशी की ट्रेनिंग कितनी हाल की है। अधिक थकान होने पर आराम करें।', 'Strength shows retained muscle strength. Train again to reset it.': 'शक्ति बताती है कि मांसपेशियों की कितनी ताकत बनी हुई है। इसे रीसेट करने के लिए फिर से ट्रेन करें।', + 'full': 'पूर्ण', + 'floor': 'न्यूनतम', 'Weeks since training: {0}': 'पिछला व्यायाम: {0} सप्ताह पहले', 'by sets worked': 'सेट के अनुसार', 'Week': 'सप्ताह', diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js index 5ccc24b..dc4795e 100644 --- a/frontend/src/locales/it.js +++ b/frontend/src/locales/it.js @@ -366,6 +366,8 @@ export default { 'Fatigued': 'Affaticato', 'Fatigue shows how recently each muscle was trained. High means rest.': 'La fatica mostra quanto è recente l’allenamento di ogni muscolo. Un valore alto significa che serve riposo.', 'Strength shows retained muscle strength. Train again to reset it.': 'La forza mostra quanta forza muscolare hai mantenuto. Allenati di nuovo per reimpostarla.', + 'full': 'pieno', + 'floor': 'minimo', 'Weeks since training: {0}': 'Ultimo allenamento: {0} sett. fa', 'by sets worked': 'per serie svolte', 'Week': 'Settimana', diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js index 1bcc2bd..a09a4ce 100644 --- a/frontend/src/locales/ko.js +++ b/frontend/src/locales/ko.js @@ -366,6 +366,8 @@ export default { 'Fatigued': '피로함', 'Fatigue shows how recently each muscle was trained. High means rest.': '피로도는 각 근육을 얼마나 최근에 운동했는지 보여줍니다. 높을수록 휴식이 필요합니다.', 'Strength shows retained muscle strength. Train again to reset it.': '근력은 근육에 남아 있는 힘을 보여줍니다. 다시 운동하면 값이 초기화됩니다.', + 'full': '완전', + 'floor': '최소', 'Weeks since training: {0}': '마지막 운동: {0}주 전', 'by sets worked': '세트 수 기준', 'Week': '이번 주', diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js index dae273c..2f59aa5 100644 --- a/frontend/src/locales/pl.js +++ b/frontend/src/locales/pl.js @@ -366,6 +366,8 @@ export default { 'Fatigued': 'Zmęczony', 'Fatigue shows how recently each muscle was trained. High means rest.': 'Zmęczenie pokazuje, jak niedawno trenowano każdą partię mięśni. Wysoki poziom oznacza potrzebę odpoczynku.', 'Strength shows retained muscle strength. Train again to reset it.': 'Siła pokazuje, ile siły mięśniowej pozostało. Ponowny trening przywraca jej poziom wyjściowy.', + 'full': 'pełna', + 'floor': 'minimum', 'Weeks since training: {0}': 'Trening: {0} tyg. temu', 'by sets worked': 'wg serii', 'Week': 'Tydzień', diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js index a181fe3..578cd86 100644 --- a/frontend/src/locales/pt.js +++ b/frontend/src/locales/pt.js @@ -366,6 +366,8 @@ export default { 'Fatigued': 'Fatigado', 'Fatigue shows how recently each muscle was trained. High means rest.': 'A fadiga mostra há quanto tempo cada músculo foi treinado. Um nível elevado significa que é preciso descansar.', 'Strength shows retained muscle strength. Train again to reset it.': 'A força mostra quanta força muscular se mantém. Treina novamente para repor o valor.', + 'full': 'completo', + 'floor': 'mínimo', 'Weeks since training: {0}': 'Treino: há {0} sem.', 'by sets worked': 'por séries trabalhadas', 'Week': 'Semana', diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js index a3ba4a7..a1882b6 100644 --- a/frontend/src/locales/ru.js +++ b/frontend/src/locales/ru.js @@ -366,6 +366,8 @@ export default { 'Fatigued': 'Утомлена', 'Fatigue shows how recently each muscle was trained. High means rest.': 'Усталость показывает, насколько недавно тренировалась каждая мышца. Высокий уровень означает, что пора отдохнуть.', 'Strength shows retained muscle strength. Train again to reset it.': 'Сила показывает, сколько мышечной силы сохранилось. Повторная тренировка сбрасывает это значение.', + 'full': 'полная', + 'floor': 'минимум', 'Weeks since training: {0}': 'Тренировка: {0} нед. назад', 'by sets worked': 'по подходам', 'Week': 'Неделя', diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js index 60c3760..87fe222 100644 --- a/frontend/src/locales/tr.js +++ b/frontend/src/locales/tr.js @@ -366,6 +366,8 @@ export default { 'Fatigued': 'Yorgun', 'Fatigue shows how recently each muscle was trained. High means rest.': 'Yorgunluk, her kasın ne kadar süre önce çalıştırıldığını gösterir. Yüksek değer dinlenmek gerektiği anlamına gelir.', 'Strength shows retained muscle strength. Train again to reset it.': 'Kuvvet, kas gücünün ne kadarının korunduğunu gösterir. Yeniden çalışarak değeri sıfırlayabilirsin.', + 'full': 'tam', + 'floor': 'minimum', 'Weeks since training: {0}': 'Son antrenman: {0} hafta önce', 'by sets worked': 'çalışılan sete göre', 'Week': 'Hafta', diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js index bf33ba5..68d1134 100644 --- a/frontend/src/locales/zh.js +++ b/frontend/src/locales/zh.js @@ -366,6 +366,8 @@ export default { 'Fatigued': '已疲劳', 'Fatigue shows how recently each muscle was trained. High means rest.': '疲劳度显示每个肌群最近一次训练距今多久。数值越高,越需要休息。', 'Strength shows retained muscle strength. Train again to reset it.': '力量显示肌肉力量保留了多少。再次训练即可重置。', + 'full': '完全', + 'floor': '下限', 'Weeks since training: {0}': '上次训练:{0}周前', 'by sets worked': '按训练组数', 'Week': '本周', diff --git a/frontend/src/views/Stats.jsx b/frontend/src/views/Stats.jsx index 9da7f0f..febef34 100644 --- a/frontend/src/views/Stats.jsx +++ b/frontend/src/views/Stats.jsx @@ -38,9 +38,9 @@ function latestMuscleTraining(workouts) { } const FATIGUE_LEVELS = [ - { at: 0, level: 4 }, + { at: 0, level: 0 }, { at: 0.25, level: 2 }, - { at: 0.5, level: 0, exclusive: true }, + { at: 0.5, level: 4, exclusive: true }, ] const STRENGTH_LEVELS = [ @@ -72,17 +72,17 @@ export function weeksSinceTraining(now, lastTrained) { } function FatigueLegend() { - return
- {t('Fatigued')}
+ return
+ {t('Fatigued')}
{t('Recovering')}
- {t('Ready')}
+ {t('Ready')}
} function StrengthLegend() { - return
- 1
-
{fmtNum(STRENGTH_FLOOR)} + return
+ 1 {t('full')}
+
{fmtNum(STRENGTH_FLOOR)} {t('floor')}
} @@ -120,6 +120,8 @@ function MuscleBalance({ S }) { const rated = inWin.some(w => w.entries.some(e => e.sets.some(s => s.done && isHardSet(s)))) const on = hard && rated const load = loadOfWorkouts(inWin, on ? isHardSet : null) + const volWin = S.workouts.filter(w => historyUnitCompatible(w, S.unit) && (w.start || new Date(w.d).getTime()) > now - 90 * 86400000) + const vol90 = loadOfWorkouts(volWin, null) const { worked, missed } = rankOf(load) const top = worked.slice(0, 4) const max = worked.length ? load[worked[0]] : 0 @@ -160,7 +162,7 @@ function MuscleBalance({ S }) { :
{t('No workouts in this period yet.')}
} : view === 'fatigue' ? <>

{t('Fatigue')}

- +
{t('Fatigue shows how recently each muscle was trained. High means rest.')}
{sel &&
@@ -169,13 +171,13 @@ function MuscleBalance({ S }) {
} : <>

{t('Strength')}

- +
{t('Strength shows retained muscle strength. Train again to reset it.')}
{detrained.map(slug =>
{t(MUSCLE_NAME[slug])} - {strengthHint(slug)} + {t('{0} sets', vol90[slug] || 0)}
)} }
@@ -254,7 +256,21 @@ export default function Stats() { const bwDelta30 = bw30.length > 1 ? bw30[bw30.length - 1].w - bw30[0].w : null const monthW = S.workouts.filter(w => w.d.slice(0, 7) === todayISO().slice(0, 7)).length - const exHist = [...new Set(S.workouts.flatMap(w => w.entries.map(e => e.id)))].filter(id => EXIDX[id]).sort((a, b) => EXIDX[a].n < EXIDX[b].n ? -1 : 1) + const currentOf = id => { + for (let i = S.workouts.length - 1; i >= 0; i--) { + const en = S.workouts[i].entries.find(e => e.id === id) + if (!en) continue + const mode = modeOf({ ...(en.target || {}), id }) + const metric = s2 => mode === 'cardio' ? (s2.speed || 0) : mode === 'time' ? (s2.sec || 0) : (s2.w || 0) + const mx = Math.max(0, ...en.sets.filter(s2 => s2.done).map(metric), mode === 'time' || mode === 'cardio' ? 0 : (en.topW || 0)) + if (mx > 0) return { mx, unit: mode === 'cardio' ? 'km/h' : mode === 'time' ? 's' : S.unit } + } + return { mx: 0, unit: S.unit } + } + const exHist = [...new Set(S.workouts.flatMap(w => w.entries.map(e => e.id)))].filter(id => EXIDX[id]) + const exCurrent = Object.fromEntries(exHist.map(id => [id, currentOf(id)])) + exHist.sort((a, b) => exCurrent[b].mx - exCurrent[a].mx || (EXIDX[a].n < EXIDX[b].n ? -1 : 1)) + const curEx = exId && exHist.includes(exId) ? exId : exHist[0] || null // How this exercise was logged most recently decides what the curve means: top weight, // longest hold or top speed. Sets logged in another mode lack the field and score 0, so a @@ -339,7 +355,8 @@ export default function Stats() { {exHist.length ? <>
({ value: id, label: EXIDX[id].n }))} /> + options={exHist.map(id => ({ value: id, label: EXIDX[id].n + (exCurrent[id].mx ? ' ' — ' ' + fmtNum(exCurrent[id].mx) + ' ' + exCurrent[id].unit : '') }))} /> +
{exOpts.length > 1 && }
diff --git a/frontend/src/views/Stats.recovery.test.jsx b/frontend/src/views/Stats.recovery.test.jsx index e21db45..6bfc209 100644 --- a/frontend/src/views/Stats.recovery.test.jsx +++ b/frontend/src/views/Stats.recovery.test.jsx @@ -59,11 +59,11 @@ function iso(timestamp) { } function set(done, extra = {}) { - return { done, w: 10, r: 8, ...extra } + return { done, w: 10, r: 8, unit: 'kg', ...extra } } function workout(id, start, entries) { - return { id, d: iso(start), start, entries } + return { id, d: iso(start), start, unit: 'kg', entries } } function entry(id, sets) { @@ -204,7 +204,7 @@ beforeEach(() => { describe('Stats muscle recovery view runtime', () => { it('starts in Balance and preserves range, hard filter, and selected muscle through every real view transition', async () => { await mountStats() - const card = muscleCard() + const card = muscleCard() expectPressed(buttonWithText(card, 'Muscle balance')) expectPressed(buttonWithText(card, 'Week')) @@ -268,7 +268,7 @@ describe('Stats muscle recovery view runtime', () => { expect(strengthRows()).toEqual(expectedRows) // The newer abs row is undone, so the rendered hint uses the completed event from 20 days ago. - expect(container.textContent).toContain('Weeks since training: 2') + expect(container.textContent).toContain('1 sets') // The production helper used by Stats' rendered strength hint floors six elapsed days to zero. expect(weeksSinceTraining(BASE_NOW, BASE_NOW - 6 * DAY)).toBe(0) @@ -286,7 +286,7 @@ describe('Stats muscle recovery view runtime', () => { const fatigueMap = lastMap() expect(Object.keys(fatigueMap.load)).toEqual(MUSCLES) expect(Object.values(fatigueMap.load).every(value => value > 0.5)).toBe(true) - expect(Object.values(levelsOf(fatigueMap.load, fatigueMap.thresholds)).every(level => level === 0)).toBe(true) + expect(Object.values(levelsOf(fatigueMap.load, fatigueMap.thresholds)).every(level => level === 4)).toBe(true) await unmountStats() resetFixture([allSubfullWorkout()])