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.

Merge fix/setrow-layout: QA round 2026-09-19 (dev team)

Duarte Santos145c668dd17d
diff --cc frontend/src/views/Workout.test.jsx
index e3b669d85,af9ecc628..9b8d3375e
--- a/frontend/src/views/Workout.test.jsx
+++ b/frontend/src/views/Workout.test.jsx
@@@ -1409,31 -1409,47 +1409,76 @@@ describe('per-side effort completion',
})
})
+// QA C9: custom exercises store their target as a muscle-map id ("gluteal"); the tag under the
+// exercise name has to show the same label the detail sheet does (Glutes), not the raw id.
+describe('Workout exercise tags', () => {
+ it('names a custom exercise\'s target muscle by its display name', async () => {
+ const { registerCustom } = await import('../lib/exercises.js')
+ registerCustom([{ id: 'cqa1', n: 'QA Custom Thrust', bp: 'upper legs', eq: 'barbell', custom: true, tg: 'gluteal', sm: [], primaries: ['gluteal'], secondaries: [], muscleGroups: ['gluteal'] }])
+ try {
+ await mount([exercise('cqa1', [false])])
+ const tags = [...container.querySelectorAll('.tag')].map(tag => tag.textContent.trim())
+ expect(tags).toContain('Glutes')
+ expect(tags).not.toContain('gluteal')
+ } finally { registerCustom([]) }
+ })
+
+ // The cardio target "cardiovascular system" is a translated key of its own; mapping it through
+ // MUSCLE_NAME must not turn "Herz-Kreislauf" back into English for every built-in cardio exercise.
+ it('keeps the cardio target translated (burpee, de)', async () => {
+ const { _setLangState } = await import('../lib/i18n-core.js')
+ const { default: de } = await import('../locales/de.js')
+ _setLangState('de', de, null, null)
+ try {
+ await mount([exercise('1160', [false])])
+ const tags = [...container.querySelectorAll('.tag')].map(tag => tag.textContent.trim())
+ expect(tags).toContain('Herz-Kreislauf')
+ expect(tags).not.toContain('Cardiovascular system')
+ } finally { _setLangState('en', null, null, null) }
+ })
+})
++
+ describe('set-row column header', () => {
+ // The L/R rows carry a badge in front of the weight cell that a straight row does not have, so
+ // the shared header needs to know it is sitting over per-side rows to offset its columns (QA C5).
+ it('marks the header of a per-side exercise so the CSS can offset it by the L/R badge', async () => {
+ const side = () => ({ w: 20, r: 8, done: false })
+ await mount([
+ exercise('plain-bench', [false]),
+ exercise('side-curl', [false], {
+ target: { mode: 'reps', side: true, reps: 16, weight: 20, bodyweight: false },
+ sets: [{ w: 20, r: 16, done: false, sides: { L: side(), R: side() } }],
+ }),
+ ], 0, { active: { workoutView: 'list' } })
+ const heads = container.querySelectorAll('.sethead')
+ expect(heads.length).toBe(2)
+ expect(heads[0].classList.contains('per-side')).toBe(false)
+ expect(heads[1].classList.contains('per-side')).toBe(true)
+ expect(container.querySelector('.setrow-side .sidetag')).toBeTruthy()
+ })
+
+ // A weighted hold's row has the play button in front of the tick, so its cells get less room than
+ // a straight row's and the CSS sizes them (and the header over them) by the `timed` marker.
+ it('marks a timed hold\'s rows and header, and neither on a rep set', async () => {
+ await mount([
+ exercise('timed-plank', [false], {
+ target: { mode: 'time', sec: 30, weight: 60, bodyweight: false },
+ sets: [{ sec: 30, w: 60, done: false }],
+ }),
+ exercise('plain-bench', [false]),
+ ], 0, { active: { workoutView: 'list' } })
+ const heads = container.querySelectorAll('.sethead')
+ expect(heads[0].classList.contains('timed')).toBe(true)
+ expect(container.querySelector('.setrow.timed .setgo')).toBeTruthy()
+ expect(heads[1].classList.contains('timed')).toBe(false)
+ expect(container.querySelectorAll('.setrow.timed').length).toBe(1)
+ })
+
+ // With the +/- buttons switched off the cells' floors are the bare numbers; the header must
+ // freeze its columns the same way or the labels drift, so it carries the cells' `plain`.
+ it('carries `plain` on the header when the steppers are off', async () => {
+ await mount([exercise('plain-bench', [false])], 0, { wc: { steppers: false } })
+ expect(container.querySelector('.sethead').classList.contains('plain')).toBe(true)
+ expect(container.querySelector('.setrow .stp.w').classList.contains('plain')).toBe(true)
+ })
+ })