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: a row's buttons wrap rather than squeeze each other

Duarte Santos377b2be3647b
diff --git a/frontend/src/views/StructuralBalance.jsx b/frontend/src/views/StructuralBalance.jsx
index 15cd348f3..a55812045 100644
--- a/frontend/src/views/StructuralBalance.jsx
+++ b/frontend/src/views/StructuralBalance.jsx
@@ -79,7 +79,7 @@ export default function StructuralBalance() {
<span className="dim small" style={{ display: 'block' }}>{valueText}</span>
</span>
</div>
- <div style={{ display: 'flex', gap: 8 }}>
+ <div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
{r.needsBodyweight && <Button size="sm" variant="ghost" icon="plus" onClick={() => bwSheet()}>{t('Log body weight')}</Button>}
<Button size="sm" variant="ghost" icon="pencil" onClick={() => changeExercise(role)}>{t('Change exercise')}</Button>
{r.isOverridden && <Button size="sm" variant="ghost" onClick={() => clearOverride(role)}>{t('Use default exercise')}</Button>}
diff --git a/frontend/src/views/StructuralBalance.test.jsx b/frontend/src/views/StructuralBalance.test.jsx
index 992afac78..5fd239ddf 100644
--- a/frontend/src/views/StructuralBalance.test.jsx
+++ b/frontend/src/views/StructuralBalance.test.jsx
@@ -131,6 +131,9 @@ describe('StructuralBalance view', () => {
expect(rdl.textContent).toContain('Log your body weight to score this lift.')
expect(host.querySelector('[data-role-id="goodMorning"] [data-needs-bodyweight]')).toBe(null)
const log = [...rdl.querySelectorAll('button')].find(b => b.textContent.includes('Log body weight'))
+ // Two buttons side by side squeeze each other's labels onto two lines at 360 px (Hungarian):
+ // the row wraps them instead.
+ expect(log.parentElement.style.flexWrap).toBe('wrap')
act(() => log.click())
expect(useUI.getState().sheets.length).toBe(1)