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.

Workout header: the set count wraps instead of being cut off in ru/uk

Duarte Santos530055d84f6f
diff --git a/frontend/src/index.css b/frontend/src/index.css
index 2987134fb..dbfb08eec 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -806,7 +806,9 @@ body.chips-dragging *{cursor:inherit}
.hdr.whdr-bar{align-items:center;gap:8px;margin:4px 0 12px}
.whdr-mid{flex:1;min-width:0;text-align:center}
.whdr-name{font-weight:600;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
-.whdr-mid .sub{font-size:13px;margin-top:1px;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
+/* The clock and set count may take a second line: in ru/uk the count is the long half and a
+ one-line ellipsis cut exactly the 0/19 the line is there for. */
+.whdr-mid .sub{font-size:13px;margin-top:1px;font-variant-numeric:tabular-nums;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;overflow-wrap:anywhere;text-wrap:balance}
.btn.pill.whdr-finish{width:auto;flex:none;padding:8px 16px;border-radius:99px;font-size:15px;max-width:40%}
/* Animations set to Small: the picture beside the exercise name, with an expand badge. */
.wthumb{position:relative;flex:none;width:48px;height:48px;border-radius:10px;overflow:hidden;padding:0}
diff --git a/frontend/src/workout-header-wrap.test.js b/frontend/src/workout-header-wrap.test.js
new file mode 100644
index 000000000..ce085ad10
--- /dev/null
+++ b/frontend/src/workout-header-wrap.test.js
@@ -0,0 +1,17 @@
+// The workout header's clock and set count ("0:02 · 0/19 подходов") sits next to the Finish pill.
+// In ru/uk at phone width a one-line ellipsis cut exactly the 0/19; the line may wrap to two now.
+import { describe, expect, it } from 'vitest'
+import { readFileSync } from 'node:fs'
+import { resolve } from 'node:path'
+
+const css = readFileSync(resolve(process.cwd(), 'src/index.css'), 'utf8').replace(/\/\*[\s\S]*?\*\//g, '')
+
+describe('the workout header subtitle', () => {
+ it('wraps to a second line instead of cutting the set count', () => {
+ const rule = css.match(/\.whdr-mid \.sub\{([^}]*)\}/)?.[1] || ''
+ expect(rule).not.toBe('')
+ expect(rule).not.toMatch(/nowrap/)
+ expect(rule).not.toMatch(/text-overflow:ellipsis/)
+ expect(rule).toMatch(/line-clamp:2/)
+ })
+})