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.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
Stats: the Exercises chip wraps to its own line on a narrow phone instead of hiding the muscle name (#553)
Duarte Santos5af2fa125c65
diff --git a/frontend/src/index.css b/frontend/src/index.cssindex 4cbef74cf..bbd455569 100644--- a/frontend/src/index.css+++ b/frontend/src/index.css@@ -1764,8 +1764,16 @@ 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}+/* "Exercises ›" on an untrained muscle picked on the map (#553), at the end of its row. On a+ narrow phone the row has no room for it (the name shrank to nothing at 320 and 360px, and the+ Russian chip poked out of the card), so it wraps to a line of its own, still at the end; the+ name keeps enough width to be read. The ::after stretches the tap area to 33px without making+ the chip look any bigger. */+.mchip.mfind{flex:none;display:inline-flex;align-items:center;gap:2px;padding-inline-end:6px;position:relative}+.mchip.mfind::after{content:"";position:absolute;inset:-5px 0}+.mrow.has-find{flex-wrap:wrap;row-gap:4px}+.mrow.has-find .nm{flex-basis:0;min-width:64px}+.mrow.has-find .mfind{margin-inline-start:auto}/* --- stat tiles --- */.tiles{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}diff --git a/frontend/src/views/Stats.cmp-css.test.js b/frontend/src/views/Stats.cmp-css.test.jsindex 8db221ccb..b022b9d32 100644--- a/frontend/src/views/Stats.cmp-css.test.js+++ b/frontend/src/views/Stats.cmp-css.test.js@@ -19,3 +19,14 @@ describe('Stats Week figures keep clear of the Coach .cmp rule', () => {expect(own).toMatch(/padding:0/)})})++// Checked in Chrome at 320 and 360px: with "Exercises ›" in a Week row the muscle name shrank to+// 0px, and the Russian chip poked 27px out of the card.+describe('Stats rows and the fatigue bar on a narrow phone', () => {+ const css = strip('src/index.css')+ it('a row with the Exercises chip wraps it rather than squeezing the name away', () => {+ expect(rule(css, '.mrow.has-find')).toMatch(/flex-wrap:wrap/)+ expect(rule(css, '.mrow.has-find .nm')).toMatch(/min-width:\d+px/)+ })+})+diff --git a/frontend/src/views/Stats.jsx b/frontend/src/views/Stats.jsxindex 0de0f272a..28df42f73 100644--- a/frontend/src/views/Stats.jsx+++ b/frontend/src/views/Stats.jsx@@ -226,14 +226,15 @@ function MuscleBalance({ S }) {const fill = target > 0 ? Math.round(Math.min(completed / target, 1) * 100) : completed > 0 ? 100 : 0const completedSets = t('{0} sets', fmtNum(completed))const plannedSets = t('{0} sets', fmtNum(target))- return <div className="mrow" data-muscle-volume={muscle} key={muscle}>+ const find = sel === muscle && !completed+ return <div className={find ? 'mrow has-find' : 'mrow'} data-muscle-volume={muscle} key={muscle}><span className="nm">{sel === muscle ? <b>{t(MUSCLE_NAME[muscle])}</b> : t(MUSCLE_NAME[muscle])}</span><span className="bar"><i style={{ width: fill + '%' }} /></span><span className="v cmp"aria-label={`${t('Completed')} ${completedSets} · ${t('Planned')} ${plannedSets}`}>{fmtNum(completed)}/{fmtNum(target)}{percentage == null ? '' : ` · ${percentage}%`}</span>- {sel === muscle && !completed && findExercises(muscle)}+ {find && findExercises(muscle)}</div>})const completionSummary = <>@@ -256,7 +257,7 @@ function MuscleBalance({ S }) {</Button></>const completedRows = <>- {sel && <div className="mrow" data-muscle-volume={sel} style={{ borderTop: 'var(--hair) solid var(--sep)', marginTop: 4, paddingTop: 10 }}>+ {sel && <div className={load[sel] > 0 ? 'mrow' : 'mrow has-find'} 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">{load[sel] > 0 ? t('{0} sets', sets(sel)) : on ? t('no hard sets') : t('not trained')}</span>{!(load[sel] > 0) && findExercises(sel)}diff --git a/frontend/src/views/Stats.weekly-volume.test.jsx b/frontend/src/views/Stats.weekly-volume.test.jsxindex d851f4ba6..602dffa1e 100644--- a/frontend/src/views/Stats.weekly-volume.test.jsx+++ b/frontend/src/views/Stats.weekly-volume.test.jsx@@ -303,6 +303,8 @@ describe('Stats — weekly planned vs completed volume', () => {expect(row('chest')).toBeTruthy()expect(find().dataset.findExercises).toBe('chest')expect(find().getAttribute('aria-label')).toBe('Exercises for Chest')+ // the row may wrap the chip onto a line of its own on a narrow phone (index.css .has-find)+ expect(row('chest').classList.contains('has-find')).toBe(true)act(() => find().click())expect(mocks.nav).toHaveBeenCalledWith('/muscles?m=chest', { state: { from: '/stats' } })})@@ -315,6 +317,7 @@ describe('Stats — weekly planned vs completed volume', () => {expect(find().dataset.findExercises).toBe('chest')// says so in words, not "0 sets"expect(host.querySelector('[data-muscle-volume="chest"] .v').textContent).toBe('not trained')+ expect(host.querySelector('[data-muscle-volume="chest"]').classList.contains('has-find')).toBe(true)act(() => find().click())expect(mocks.nav).toHaveBeenCalledWith('/muscles?m=chest', { state: { from: '/stats' } })