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
Workout: the best-set line stays on an exercise with no best set in today's mode yet, so the switch back to last time is still on the card, and a screen reader hears what a tap does (#173)
Duarte Santos67b72f0f3d72
diff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.jsindex 3f22d8902..8105e9d34 100644--- a/frontend/src/locales/ar.js+++ b/frontend/src/locales/ar.js@@ -1431,6 +1431,7 @@ export default {'Best set': 'أفضل مجموعة','Show last time instead': 'اعرض المرة السابقة بدلًا من ذلك','Show your best set instead': 'اعرض أفضل مجموعة لك بدلًا من ذلك',+ 'Best set: nothing logged this way yet': 'أفضل مجموعة: لم يُسجَّل شيء بهذه الطريقة بعد','Shown under each exercise': 'يظهر تحت كل تمرين','What you did the last time, in that routine.': 'ما أدّيته في المرة السابقة ضمن هذا الروتين.','Your heaviest set of the exercise, from any workout.': 'أثقل مجموعة لك في هذا التمرين، من أي جلسة.',diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.jsindex a7805d1e7..518934616 100644--- a/frontend/src/locales/de.js+++ b/frontend/src/locales/de.js@@ -1461,6 +1461,7 @@ export default {'Best set': 'Bester Satz','Show last time instead': 'Stattdessen das letzte Mal zeigen','Show your best set instead': 'Stattdessen deinen besten Satz zeigen',+ 'Best set: nothing logged this way yet': 'Bester Satz: so noch nichts eingetragen','Shown under each exercise': 'Unter jeder Übung angezeigt','What you did the last time, in that routine.': 'Was du beim letzten Mal in dieser Routine gemacht hast.','Your heaviest set of the exercise, from any workout.': 'Dein schwerster Satz der Übung, aus allen Trainings.',diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.jsindex 395bd6814..3a4850100 100644--- a/frontend/src/locales/es.js+++ b/frontend/src/locales/es.js@@ -1441,6 +1441,7 @@ export default {'Best set': 'Mejor serie','Show last time instead': 'Mostrar la última vez','Show your best set instead': 'Mostrar tu mejor serie',+ 'Best set: nothing logged this way yet': 'Mejor serie: aún nada registrado así','Shown under each exercise': 'Debajo de cada ejercicio','What you did the last time, in that routine.': 'Lo que hiciste la última vez en esa rutina.','Your heaviest set of the exercise, from any workout.': 'Tu serie más pesada del ejercicio, de cualquier entrenamiento.',diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.jsindex 72e03fb18..a5355df5c 100644--- a/frontend/src/locales/fr.js+++ b/frontend/src/locales/fr.js@@ -1441,6 +1441,7 @@ export default {'Best set': 'Meilleure série','Show last time instead': 'Afficher plutôt la dernière fois','Show your best set instead': 'Afficher plutôt ta meilleure série',+ 'Best set: nothing logged this way yet': 'Meilleure série : rien de noté ainsi pour l’instant','Shown under each exercise': 'Sous chaque exercice','What you did the last time, in that routine.': 'Ce que tu as fait la dernière fois dans cette routine.','Your heaviest set of the exercise, from any workout.': 'Ta série la plus lourde de l’exercice, toutes séances confondues.',diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.jsindex e22ca3d11..7635fc01a 100644--- a/frontend/src/locales/hi.js+++ b/frontend/src/locales/hi.js@@ -1441,6 +1441,7 @@ export default {'Best set': 'सर्वश्रेष्ठ सेट','Show last time instead': 'इसके बजाय पिछली बार दिखाएँ','Show your best set instead': 'इसके बजाय अपना सर्वश्रेष्ठ सेट दिखाएँ',+ 'Best set: nothing logged this way yet': 'सर्वश्रेष्ठ सेट: इस तरह अभी कुछ दर्ज नहीं','Shown under each exercise': 'हर व्यायाम के नीचे दिखाया जाता है','What you did the last time, in that routine.': 'उस रूटीन में पिछली बार आपने जो किया।','Your heaviest set of the exercise, from any workout.': 'किसी भी वर्कआउट से, इस व्यायाम का आपका सबसे भारी सेट।',diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.jsindex 1bea0f028..3e46318b6 100644--- a/frontend/src/locales/hu.js+++ b/frontend/src/locales/hu.js@@ -1444,6 +1444,7 @@ export default {'Best set': 'Legjobb sorozat','Show last time instead': 'Inkább a legutóbbit mutasd','Show your best set instead': 'Inkább a legjobb sorozatodat mutasd',+ 'Best set: nothing logged this way yet': 'Legjobb sorozat: így még nincs rögzítve semmi','Shown under each exercise': 'Minden gyakorlat alatt','What you did the last time, in that routine.': 'Amit legutóbb abban a rutinban csináltál.','Your heaviest set of the exercise, from any workout.': 'A gyakorlat legnehezebb sorozata, bármelyik edzésedből.',diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.jsindex 25b8cd4fa..54b7e1dac 100644--- a/frontend/src/locales/it.js+++ b/frontend/src/locales/it.js@@ -1441,6 +1441,7 @@ export default {'Best set': 'Serie migliore','Show last time instead': 'Mostra invece l’ultima volta','Show your best set instead': 'Mostra invece la tua serie migliore',+ 'Best set: nothing logged this way yet': 'Serie migliore: ancora niente registrato così','Shown under each exercise': 'Sotto ogni esercizio','What you did the last time, in that routine.': 'Quello che hai fatto l’ultima volta in quella routine.','Your heaviest set of the exercise, from any workout.': 'La tua serie più pesante dell’esercizio, da qualsiasi allenamento.',diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.jsindex 45376dfe3..dca87aa09 100644--- a/frontend/src/locales/ko.js+++ b/frontend/src/locales/ko.js@@ -1441,6 +1441,7 @@ export default {'Best set': '최고 세트','Show last time instead': '대신 지난번 보기','Show your best set instead': '대신 최고 세트 보기',+ 'Best set: nothing logged this way yet': '최고 세트: 이 방식으로는 아직 기록 없음','Shown under each exercise': '각 운동 아래에 표시','What you did the last time, in that routine.': '그 루틴에서 지난번에 한 내용.','Your heaviest set of the exercise, from any workout.': '모든 운동 중 이 운동의 가장 무거운 세트.',diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.jsindex 2df47da45..0ab9e37c1 100644--- a/frontend/src/locales/pl.js+++ b/frontend/src/locales/pl.js@@ -1441,6 +1441,7 @@ export default {'Best set': 'Najlepsza seria','Show last time instead': 'Pokaż zamiast tego ostatni raz','Show your best set instead': 'Pokaż zamiast tego najlepszą serię',+ 'Best set: nothing logged this way yet': 'Najlepsza seria: jeszcze nic tak nie zapisano','Shown under each exercise': 'Pod każdym ćwiczeniem','What you did the last time, in that routine.': 'Ostatni trening w tym planie treningowym.','Your heaviest set of the exercise, from any workout.': 'Najcięższa seria tego ćwiczenia, z dowolnego treningu.',diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.jsindex 20f3ff857..dd434420e 100644--- a/frontend/src/locales/pt-BR.js+++ b/frontend/src/locales/pt-BR.js@@ -807,6 +807,7 @@ export const PT_BR_OVERRIDES = {// Portugal; "Melhor série" is shared and inherits'Show last time instead': 'Mostrar a última vez','Show your best set instead': 'Mostrar sua melhor série',+ 'Best set: nothing logged this way yet': 'Melhor série: ainda nada registrado assim','Shown under each exercise': 'Abaixo de cada exercício','What you did the last time, in that routine.': 'O que você fez da última vez nessa rotina.','Your heaviest set of the exercise, from any workout.': 'Sua série mais pesada do exercício, de qualquer treino.',diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.jsindex d3f3da62a..ed88fe92f 100644--- a/frontend/src/locales/pt.js+++ b/frontend/src/locales/pt.js@@ -1441,6 +1441,7 @@ export default {'Best set': 'Melhor série','Show last time instead': 'Mostrar antes a última vez','Show your best set instead': 'Mostrar antes a tua melhor série',+ 'Best set: nothing logged this way yet': 'Melhor série: ainda nada registado assim','Shown under each exercise': 'Por baixo de cada exercício','What you did the last time, in that routine.': 'O que fizeste da última vez nessa rotina.','Your heaviest set of the exercise, from any workout.': 'A tua série mais pesada do exercício, de qualquer treino.',diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.jsindex 3154e3645..dcdd69ebc 100644--- a/frontend/src/locales/ru.js+++ b/frontend/src/locales/ru.js@@ -1441,6 +1441,7 @@ export default {'Best set': 'Лучший подход','Show last time instead': 'Показать прошлый раз','Show your best set instead': 'Показать ваш лучший подход',+ 'Best set: nothing logged this way yet': 'Лучший подход: так пока ничего не записано','Shown under each exercise': 'Под каждым упражнением','What you did the last time, in that routine.': 'Что вы сделали в прошлый раз в этой программе.','Your heaviest set of the exercise, from any workout.': 'Ваш самый тяжёлый подход в этом упражнении, из любой тренировки.',diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.jsindex b1fdb57bd..5d2e03de5 100644--- a/frontend/src/locales/th.js+++ b/frontend/src/locales/th.js@@ -1452,6 +1452,7 @@ export default {'Best set': 'เซ็ตที่ดีที่สุด','Show last time instead': 'แสดงครั้งก่อนแทน','Show your best set instead': 'แสดงเซ็ตที่ดีที่สุดของคุณแทน',+ 'Best set: nothing logged this way yet': 'เซ็ตที่ดีที่สุด: ยังไม่มีการบันทึกแบบนี้','Shown under each exercise': 'แสดงใต้แต่ละท่า','What you did the last time, in that routine.': 'สิ่งที่คุณทำครั้งก่อนในรูทีนนั้น','Your heaviest set of the exercise, from any workout.': 'เซ็ตที่หนักที่สุดของท่านี้ จากทุกการฝึก',diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.jsindex f9f030514..1d7ac17b7 100644--- a/frontend/src/locales/tr.js+++ b/frontend/src/locales/tr.js@@ -1441,6 +1441,7 @@ export default {'Best set': 'En iyi set','Show last time instead': 'Bunun yerine geçen seferi göster','Show your best set instead': 'Bunun yerine en iyi setini göster',+ 'Best set: nothing logged this way yet': 'En iyi set: bu şekilde henüz kayıt yok','Shown under each exercise': 'Her egzersizin altında','What you did the last time, in that routine.': 'O rutinde geçen sefer yaptıkların.','Your heaviest set of the exercise, from any workout.': 'Bu egzersizdeki en ağır setin, herhangi bir antrenmandan.',diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.jsindex 630193a8b..66b85acf1 100644--- a/frontend/src/locales/uk.js+++ b/frontend/src/locales/uk.js@@ -1375,6 +1375,7 @@ export default {'Best set': 'Найкращий підхід','Show last time instead': 'Показати минулий раз','Show your best set instead': 'Показати твій найкращий підхід',+ 'Best set: nothing logged this way yet': 'Найкращий підхід: так поки нічого не записано','Shown under each exercise': 'Під кожною вправою','What you did the last time, in that routine.': 'Твій результат минулого разу в цій програмі.','Your heaviest set of the exercise, from any workout.': 'Твій найважчий підхід у цій вправі — з будь-якого тренування.',diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.jsindex ed9024eac..e852b6766 100644--- a/frontend/src/locales/zh.js+++ b/frontend/src/locales/zh.js@@ -1441,6 +1441,7 @@ export default {'Best set': '最佳组','Show last time instead': '改为显示上次','Show your best set instead': '改为显示你的最佳组',+ 'Best set: nothing logged this way yet': '最佳组:还没有这样记录过','Shown under each exercise': '每个动作下方显示','What you did the last time, in that routine.': '上次在该训练日完成的内容。','Your heaviest set of the exercise, from any workout.': '该动作在所有训练中最重的一组。',diff --git a/frontend/src/views/Workout.jsx b/frontend/src/views/Workout.jsxindex fed45ed9c..bc7e68d08 100644--- a/frontend/src/views/Workout.jsx+++ b/frontend/src/views/Workout.jsx@@ -193,10 +193,19 @@ function ExerciseBlock({ entryIdx, compact, dense, editing, onToggle, onToggleSi// profile's (S.logRef), so every exercise and the next session follow it.const refBest = S.logRef === 'best'const ref = refBest ? bestSetFor(S, entry.id, mode) : last- const refLine = ref ? <button type="button" className="refline small dim"- title={refBest ? t('Show last time instead') : t('Show your best set instead')}+ // 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 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>{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(', ')}</span>+ <span>{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 9d10dce91..97cff728e 100644--- a/frontend/src/views/Workout.test.jsx+++ b/frontend/src/views/Workout.test.jsx@@ -1939,6 +1939,28 @@ describe('the reference line: last time or best set', () => {await mount([exercise('plain-bench', [false])], 0, { logRef: 'best' })expect(line()).toBeNull()})++ // Logged before only as a hold, today as reps: there is a last time but no best set in this+ // mode. The line used to vanish, and the switch back to "Last time" with it.+ it('stays on the card when there is no best set in this mode yet, and still switches back', async () => {+ const hold = { d: '2026-08-26', start: Date.parse('2026-08-26T18:00:00'), routineIds: ['A'],+ entries: [{ id: 'plain-bench', rid: 'A', target: { mode: 'time', sec: 30 }, sets: [{ sec: 30, w: 0, done: true }] }] }+ await mount([exercise('plain-bench', [false], { rid: 'A' })], 0, { workouts: [hold], logRef: 'best' })+ expect(line().textContent).toBe('Best set: nothing logged this way yet')+ await act(async () => { line().dispatchEvent(new dom.Event('click', { bubbles: true })) })+ expect(mocks.S.logRef).toBe('last')+ await rerender()+ expect(line().textContent).toMatch(/^Last time \(.+\): 0:30$/)+ })++ // 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 })+ expect(line().getAttribute('aria-label')).toMatch(/^Last time \(.+\): 55×8\. Show your best set instead$/)+ await act(async () => { line().dispatchEvent(new dom.Event('click', { bubbles: true })) })+ await rerender()+ expect(line().getAttribute('aria-label')).toMatch(/^Best set \(.+\): 80×5\. Show last time instead$/)+ })})// #284: logging a past workout that went as planned takes one tap, not one per set.