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.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
Arabic: every set on the last-time or best-set line reads weight×reps, the first one included, instead of 8×60 beside 60×8 (#173, !36)
Duarte Santos6896b4f22988
diff --git a/frontend/src/views/Workout.jsx b/frontend/src/views/Workout.jsxindex a7e4f0e3a..3591e32c6 100644--- a/frontend/src/views/Workout.jsx+++ b/frontend/src/views/Workout.jsx@@ -200,16 +200,18 @@ function ExerciseBlock({ entryIdx, compact, dense, editing, onToggle, onToggleSi// An exercise logged before only in another mode (reps then, a hold today) has a last time but// no best set to hold today's rows against. The line stays and says so: gone, it took the// switch back to "Last time" with it, reachable then only from Settings or another card.- const refText = ref- ? `${refBest ? t('Best set') : t('Last time')} (${fmtDate(ref.d)}): ${(refBest ? [ref.set] : ref.sets).map(s => setLabel(entry.id, s, ref.target, speedUnitOf(S))).join(', ')}`- : refBest && last ? t('Best set: nothing logged this way yet') : null+ const refHead = ref ? `${refBest ? t('Best set') : t('Last time')} (${fmtDate(ref.d)}): ` : ''+ const refSets = ref ? (refBest ? [ref.set] : ref.sets).map(s => setLabel(entry.id, s, ref.target, speedUnitOf(S))) : []+ const refText = ref ? refHead + refSets.join(', ') : refBest && last ? t('Best set: nothing logged this way yet') : nullconst refAction = refBest ? t('Show last time instead') : t('Show your best set instead')// The button's text is the reference, which says nothing about what a tap does; its name// carries both, the reference first as it reads on screen, then the switch.const refLine = refText ? <button type="button" className="refline small dim"title={refAction} aria-label={`${refText}. ${refAction}`}onClick={() => update(s => { s.logRef = refBest ? 'last' : 'best' })}>- <span>{refText}</span>+ {/* Each set on its own left-to-right island. In Arabic the first one followed the label's+ direction and read 8×60, while those after a Latin "RIR" read 60×8. */}+ <span>{ref ? <>{refHead}{refSets.map((l, i) => <Fragment key={i}>{i ? ', ' : ''}<bdi dir="ltr">{l}</bdi></Fragment>)}</> : refText}</span><Icon name="shuffle" /></button> : null// A bodyweight set has no weight to type, so the column is not there (issue #32) — onediff --git a/frontend/src/views/Workout.test.jsx b/frontend/src/views/Workout.test.jsxindex bc492847e..d6dc7d14b 100644--- a/frontend/src/views/Workout.test.jsx+++ b/frontend/src/views/Workout.test.jsx@@ -1979,6 +1979,17 @@ describe('the reference line: last time or best set', () => {expect(container.textContent).toContain('Best: 80 kg')})+ // Arabic: a set right after the label took the label's direction and read 8×60, while the+ // sets after a Latin "RIR" read 60×8. Each set is its own left-to-right island.+ it('isolates every set from the text around it', async () => {+ const two = [{ d: '2026-08-26', start: Date.parse('2026-08-26T18:00:00'), routineIds: ['A'],+ entries: [{ id: 'plain-bench', rid: 'A', target: { reps: 8, weight: 60 }, sets: [{ w: 60, r: 8, rir: 3, done: true }, { w: 60, r: 8, rir: 2, done: true }] }] }]+ await mount([exercise('plain-bench', [false], { rid: 'A' })], 0, { workouts: two })+ const sets = [...line().querySelectorAll('bdi')]+ expect(sets.map(b => [b.getAttribute('dir'), b.textContent])).toEqual([['ltr', '60×8 (RIR 3)'], ['ltr', '60×8 (RIR 2)']])+ expect(line().textContent).toMatch(/^Last time \(.+\): 60×8 \(RIR 3\), 60×8 \(RIR 2\)$/)+ })+// The text is the reference; the name also says what a tap does, after the text it shows.it('names the switch a tap makes', async () => {await mount([exercise('plain-bench', [false], { rid: 'A' })], 0, { workouts: history })