confirmed UI tweaks: fatigued highlighted (red/amber), strongest gold, strength scale labels, exercise list by current strength, 90d volume on strength rows
This commit is contained in:
1 parent
eeee4b461c
commit
9af028bde3
14 files changed
+69
-18
No files matched your search
@@ -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
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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': 'सप्ताह',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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': '이번 주',
|
||||
|
||||
@@ -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ń',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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': 'Неделя',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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': '本周',
|
||||
|
||||
@@ -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 <div className="hm-legend" aria-label={t('Fatigue')}>
|
||||
<span>{t('Fatigued')}</span><div className="hm-c l0" />
|
||||
return <div className="hm-legend hm-fatigue" aria-label={t('Fatigue')}>
|
||||
<span>{t('Fatigued')}</span><div className="hm-c l4" />
|
||||
<span>{t('Recovering')}</span><div className="hm-c l2" />
|
||||
<span>{t('Ready')}</span><div className="hm-c l4" />
|
||||
<span>{t('Ready')}</span><div className="hm-c l0" />
|
||||
</div>
|
||||
}
|
||||
|
||||
function StrengthLegend() {
|
||||
return <div className="hm-legend" aria-label={t('Strength')}>
|
||||
<span>1</span><div className="hm-c l4" /><div className="hm-c l3" /><div className="hm-c l2" />
|
||||
<div className="hm-c l1" /><div className="hm-c l0" /><span>{fmtNum(STRENGTH_FLOOR)}</span>
|
||||
return <div className="hm-legend hm-strength" aria-label={t('Strength')}>
|
||||
<span>1 <span className="dim">{t('full')}</span></span><div className="hm-c l4" /><div className="hm-c l3" /><div className="hm-c l2" />
|
||||
<div className="hm-c l1" /><div className="hm-c l0" /><span>{fmtNum(STRENGTH_FLOOR)} <span className="dim">{t('floor')}</span></span>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -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 }) {
|
||||
</> : <div className="muted small">{t('No workouts in this period yet.')}</div>}
|
||||
</> : view === 'fatigue' ? <>
|
||||
<h2>{t('Fatigue')}</h2>
|
||||
<BodyMap className="tappable" load={fatigue} thresholds={FATIGUE_LEVELS} body={S.body} selected={sel} onMuscle={toggleSel} />
|
||||
<BodyMap className="tappable hm-fatigue" load={fatigue} thresholds={FATIGUE_LEVELS} body={S.body} selected={sel} onMuscle={toggleSel} />
|
||||
<FatigueLegend />
|
||||
<div className="muted small" style={{ marginTop: 10 }}>{t('Fatigue shows how recently each muscle was trained. High means rest.')}</div>
|
||||
{sel && <div className="mrow" style={{ borderTop: 'var(--hair) solid var(--sep)', marginTop: 4, paddingTop: 10 }}>
|
||||
@@ -169,13 +171,13 @@ function MuscleBalance({ S }) {
|
||||
</div>}
|
||||
</> : <>
|
||||
<h2>{t('Strength')}</h2>
|
||||
<BodyMap className="tappable" load={strength} thresholds={STRENGTH_LEVELS} body={S.body} selected={sel} onMuscle={toggleSel} />
|
||||
<BodyMap className="tappable hm-strength" load={strength} thresholds={STRENGTH_LEVELS} body={S.body} selected={sel} onMuscle={toggleSel} />
|
||||
<StrengthLegend />
|
||||
<div className="muted small" style={{ marginTop: 10 }}>{t('Strength shows retained muscle strength. Train again to reset it.')}</div>
|
||||
{detrained.map(slug => <div key={slug} className="mrow">
|
||||
<span className="nm">{t(MUSCLE_NAME[slug])}</span>
|
||||
<span className="bar"><i style={{ width: Math.round(strength[slug] * 100) + '%' }} /></span>
|
||||
<span className="v">{strengthHint(slug)}</span>
|
||||
<span className="v">{t('{0} sets', vol90[slug] || 0)}</span>
|
||||
</div>)}
|
||||
</>}
|
||||
</div>
|
||||
@@ -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 ? <>
|
||||
<div className="sect-b" style={{ marginBottom: 10 }}>
|
||||
<SelectRow title={t('Exercise')} sheetTitle={t('Exercise progress')} value={curEx} onChange={setExId}
|
||||
options={exHist.map(id => ({ 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 : '') }))} />
|
||||
|
||||
</div>
|
||||
{exOpts.length > 1 && <Segmented className="seg-range" value={onEff ? 'effort' : onE1 ? 'e1rm' : 'top'} onChange={setExMetric} options={exOpts} />}
|
||||
<div className="chart">
|
||||
|
||||
@@ -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()])
|
||||
|
||||
Reference in new issue
Block a user