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.

Settings: the screen-stays-on line sits under Keep screen awake, not under the animations

Duarte Santos6b74c7a2ac85
diff --git a/frontend/src/components/WorkoutSettingsSheet.jsx b/frontend/src/components/WorkoutSettingsSheet.jsx
index 6bb40e55b..1bad212e1 100644
--- a/frontend/src/components/WorkoutSettingsSheet.jsx
+++ b/frontend/src/components/WorkoutSettingsSheet.jsx
@@ -50,7 +50,7 @@ export function WorkoutSettings({ close }) {
<Switch checked={!!S.timerFlash} onChange={v => update(s => { s.timerFlash = v })} />
</Row>
{(wakeOK || !MOBILE) && <Row icon="phoneScreen" iconTint="var(--yellow)" title={t('Keep screen awake')}
- subtitle={wakeOK ? null : t('Not supported in this browser.')}>
+ subtitle={wakeOK ? t('The screen stays on while a workout is running, so you don’t have to unlock your phone between sets.') : t('Not supported in this browser.')}>
<Switch checked={wakeOK && S.keepAwake !== false} disabled={!wakeOK} onChange={v => update(s => { s.keepAwake = v })} />
</Row>}
</Section>
diff --git a/frontend/src/components/WorkoutSettingsSheet.test.jsx b/frontend/src/components/WorkoutSettingsSheet.test.jsx
index 3d326be5d..a85939e56 100644
--- a/frontend/src/components/WorkoutSettingsSheet.test.jsx
+++ b/frontend/src/components/WorkoutSettingsSheet.test.jsx
@@ -53,6 +53,8 @@ describe('the in-workout settings sheet', () => {
'Layout', 'Effort per set', 'Exercise animations', 'All settings',
])
expect(row('Rest timer').querySelector('.lrow-v').textContent).toBe('1:30')
+ expect(row('Keep screen awake').querySelector('.lrow-s').textContent).toMatch(/^The screen stays on/)
+ expect(row('Exercise animations').querySelector('.lrow-s')).toBeNull()
})
it('writes the same fields as Settings', () => {
diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsx
index 762b6e438..6aabc4572 100644
--- a/frontend/src/views/Settings.jsx
+++ b/frontend/src/views/Settings.jsx
@@ -468,7 +468,7 @@ export default function Settings({ page = null, find = null, via = null }) {
value={layout} onChange={v => update(s => { s.workoutView = v })} />
</Row>
</Section>
- <Section title={t('Before and during')} footer={wakeOK ? t('The screen stays on while a workout is running, so you don’t have to unlock your phone between sets.') : null}>
+ <Section title={t('Before and during')}>
{/* The quick weigh-in that opens on Start (sheets.jsx startFlow, issue #137); off skips
straight to the session. Home and Stats still log weight by hand. */}
<Row icon="scale" iconTint="var(--green)" title={t('Weigh in before workouts')}
@@ -477,7 +477,7 @@ export default function Settings({ page = null, find = null, via = null }) {
</Row>
{(wakeOK || !MOBILE) && (
<Row icon="phoneScreen" iconTint="var(--yellow)" title={t('Keep screen awake')}
- subtitle={wakeOK ? null : t('Not supported in this browser.')}>
+ subtitle={wakeOK ? t('The screen stays on while a workout is running, so you don’t have to unlock your phone between sets.') : t('Not supported in this browser.')}>
<Switch checked={wakeOK && S.keepAwake !== false} disabled={!wakeOK}
onChange={v => update(s => { s.keepAwake = v })} />
</Row>
diff --git a/frontend/src/views/settings-pages.test.jsx b/frontend/src/views/settings-pages.test.jsx
index d0c2d7fd9..3074a24ed 100644
--- a/frontend/src/views/settings-pages.test.jsx
+++ b/frontend/src/views/settings-pages.test.jsx
@@ -255,6 +255,11 @@ describe('the pages', () => {
expect([...host.querySelectorAll('.sect-t')].map(e => e.textContent)).toEqual(['Rest', 'Logging', 'Before and during'])
expect(titles()).toEqual(['Rest timer', 'Rest-pause rest', 'Effort per set', 'Shown under each exercise', 'Layout',
'Weigh in before workouts', 'Keep screen awake', 'Exercise animations', 'Fine-tuning'])
+ // QA 10-05: the "screen stays on" line is the awake row's own subtitle, not a section footer
+ // that read as if it explained the animations above it.
+ expect(rowTitled('Keep screen awake').querySelector('.lrow-s').textContent).toMatch(/^The screen stays on/)
+ expect(rowTitled('Exercise animations').querySelector('.lrow-s')).toBeNull()
+ expect([...host.querySelectorAll('.sect-f')].some(f => /screen stays on/.test(f.textContent))).toBe(false)
mount('advanced')
expect(titles()).toEqual(['Planned sessions start from', 'Keep timing after target', 'Weight and reps buttons',
'Drop and burst shortcuts on every set', 'Superset buttons in the exercise header', 'Move, swap and remove buttons below the exercise'])