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: fatigue zone names are never cut off on a small phone (#662)

Duarte Santosd56469235e61
diff --git a/frontend/src/index.css b/frontend/src/index.css
index bbd455569..203b8a4b3 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -1753,7 +1753,11 @@ body.no-tabbar #timer.working{box-shadow:inset 0 var(--hair) 0 var(--acc),0 -10p
[dir="rtl"] .fbarwrap .fval{transform:translateX(50%)}
.fends{display:flex;justify-content:space-between;font-size:10px;color:var(--label-3);margin-top:3px}
.fzones{display:flex;font-size:10px;color:var(--label-3);line-height:1.2}
-.fzones .z{text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+/* A zone is a quarter of the bar, 64px on a 320px phone: "Восстанавливается" or "En
+ recuperación" don't fit and were cut to "Восстанав…". A name may spill past its zone instead,
+ centred on it, and Ready starts at the bar's start so the middle one has room on both sides. */
+.fzones .z{display:flex;justify-content:center;white-space:nowrap}
+.fzones .z.ready{justify-content:flex-start}
.fzones .z.ready{width:25%}
.fzones .z.recovering{width:25%}
.fzones .z.fatigued{width:50%}
diff --git a/frontend/src/views/Stats.cmp-css.test.js b/frontend/src/views/Stats.cmp-css.test.js
index b022b9d32..ea7c15142 100644
--- a/frontend/src/views/Stats.cmp-css.test.js
+++ b/frontend/src/views/Stats.cmp-css.test.js
@@ -21,12 +21,18 @@ describe('Stats Week figures keep clear of the Coach .cmp rule', () => {
})
// 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.
+// 0px, and the Russian chip poked 27px out of the card. Russian, Spanish, French, Polish and four
+// more had the middle fatigue zone's name cut to an ellipsis on a 320px phone.
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/)
})
+ it('the fatigue zone names are never clipped', () => {
+ const z = rule(css, '.fzones .z')
+ expect(z).toBeTruthy()
+ expect(z).not.toMatch(/overflow:hidden|text-overflow/)
+ })
})