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.

Library: the exercise count wraps on narrow phones instead of getting cut

Duarte Santosa03903b35825
diff --git a/frontend/src/index.css b/frontend/src/index.css
index 43ffd9639..3ad378ed6 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -239,6 +239,7 @@ button.conn:active{filter:brightness(1.12)}
text-overflow follows the text direction, so Arabic clips on its own end. */
.hdr.lib-hdr{flex-wrap:wrap;align-items:center;row-gap:0}
.hdr.lib-hdr>.sub.lib-count{flex:1 0 100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+@media (max-width:360px){.hdr.lib-hdr>.sub.lib-count{white-space:normal;overflow:visible;text-overflow:clip}}
.iconbtn{
width:36px;height:36px;border-radius:50%;flex:none;
diff --git a/frontend/src/views/Library.test.jsx b/frontend/src/views/Library.test.jsx
index 3a9d84519..fe7838a04 100644
--- a/frontend/src/views/Library.test.jsx
+++ b/frontend/src/views/Library.test.jsx
@@ -142,7 +142,7 @@ describe('Library header count', () => {
expect(one).not.toBe(five.replace('5', '1'))
})
- it('keeps the subtitle on one line, clipping with an ellipsis rather than wrapping', () => {
+ it('keeps the subtitle on one line on wider screens, clipping with an ellipsis', () => {
expect(sub(render())).toBeTruthy()
const rule = cssSource.match(/^\.hdr\.lib-hdr>\.sub\.lib-count\{([^}]*)\}/m)?.[1] || ''
expect(rule).toContain('white-space:nowrap')
@@ -151,4 +151,10 @@ describe('Library header count', () => {
expect(rule).toContain('flex:1 0 100%')
expect(cssSource).toMatch(/^\.hdr\.lib-hdr\{[^}]*flex-wrap:wrap/m)
})
+
+ it('lets the subtitle wrap on narrow phones so nothing is cut at 320 px', () => {
+ const narrow = cssSource.match(/@media \(max-width:360px\)\{\.hdr\.lib-hdr>\.sub\.lib-count\{([^}]*)\}\}/)?.[1] || ''
+ expect(narrow).toContain('white-space:normal')
+ expect(narrow).toContain('overflow:visible')
+ })
})