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.

Plan: the Weekly muscle volume link waits for a routine, like the Stats card it opens

Duarte Santos9a8dcbf84875
diff --git a/frontend/src/views/Plan.jsx b/frontend/src/views/Plan.jsx
index 72adbd9a5..d9bea800d 100644
--- a/frontend/src/views/Plan.jsx
+++ b/frontend/src/views/Plan.jsx
@@ -251,11 +251,12 @@ function Schedule({ S, update, nav, mode }) {
</>}
</div>}
- {/* Weekly muscle volume is analysis: it moved to Stats, next to Muscle balance. */}
- <Section className="plan-link">
+ {/* Weekly muscle volume is analysis: it moved to Stats, next to Muscle balance. Stats only
+ shows that card once there is a routine, so the link waits for one too. */}
+ {S.routines.length > 0 && <Section className="plan-link">
<Row icon="chart" iconTint="var(--indigo)" title={t('Weekly muscle volume')} subtitle={t('Now in Stats, next to Muscle balance')}
accessory="chevron" onClick={() => nav('/stats?focus=weekly-volume')} />
- </Section>
+ </Section>}
</>
}
diff --git a/frontend/src/views/Plan.rotation.test.jsx b/frontend/src/views/Plan.rotation.test.jsx
index 0218fcfde..09fc73197 100644
--- a/frontend/src/views/Plan.rotation.test.jsx
+++ b/frontend/src/views/Plan.rotation.test.jsx
@@ -271,6 +271,11 @@ describe('Plan — Schedule extras', () => {
expect(mocks.nav).toHaveBeenCalledWith('/stats?focus=weekly-volume')
})
+ it('has no volume link before there is a routine (Stats has no card to show then)', () => {
+ mount({ routines: [], week: {} })
+ expect(host.querySelector('.plan-link')).toBe(null)
+ })
+
it('switches to Routines and remembers it for next time', () => {
mount()
const seg = label => [...host.querySelectorAll('.plan-views button')].find(b => b.textContent === label)