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.

Follow-up to !140: exercise names in the rows are capitalised like every other list

Duarte Santosc1a67382bf8d
diff --git a/frontend/src/views/StructuralBalance.jsx b/frontend/src/views/StructuralBalance.jsx
index a7de7ea63..f4a700492 100644
--- a/frontend/src/views/StructuralBalance.jsx
+++ b/frontend/src/views/StructuralBalance.jsx
@@ -68,7 +68,7 @@ export default function StructuralBalance() {
<span className="nm" style={{ minWidth: 0, whiteSpace: 'normal', overflowWrap: 'anywhere' }}>
<span style={{ display: 'block' }}>{t(role.label)}</span>
<span className="small dim" style={{ display: 'block' }}>
- {name}{r.isOverridden ? ` · ${t('Custom')}` : ''}
+ <span className="capitalize" data-exercise-name>{name}</span>{r.isOverridden ? ` · ${t('Custom')}` : ''}
</span>
</span>
<span className="v" style={{ textAlign: 'right', flexShrink: 0 }}>
diff --git a/frontend/src/views/StructuralBalance.test.jsx b/frontend/src/views/StructuralBalance.test.jsx
index b87b3944b..7c381d4a5 100644
--- a/frontend/src/views/StructuralBalance.test.jsx
+++ b/frontend/src/views/StructuralBalance.test.jsx
@@ -98,6 +98,17 @@ describe('StructuralBalance view', () => {
}
})
+ // Catalogue names are lower case ("barbell full squat"); every other list capitalises them.
+ it('capitalises each row\'s exercise name like the other lists, and only the name', () => {
+ const host = render()
+ for (const row of host.querySelectorAll('[data-role-id]')) {
+ const name = row.querySelector('[data-exercise-name]')
+ expect(name.classList.contains('capitalize'), row.dataset.roleId).toBe(true)
+ expect(name.textContent.length).toBeGreaterThan(0)
+ }
+ expect(host.querySelector('[data-role-id="narrowBench"] [data-exercise-name]').textContent).toBe('barbell close-grip bench press')
+ })
+
it('the back chevron navigates to /stats', () => {
const host = render()
act(() => host.querySelector('.iconbtn').click())