From 0cae9867a1b3ad65374b33c648ec6dd131863f35 Mon Sep 17 00:00:00 2001 From: Sebastian G Date: Mon, 7 Sep 2026 13:02:05 +0200 Subject: [PATCH] fix(checkin): per-side reps step by one; drop redundant per-side chip The L/R rep steppers stepped by two (the whole-set rule that keeps a combined total evenly splittable); per side each tap is one rep. Also removes the old '{n} per side' chip, which halved the aggregate total for display and was both redundant and wrong under asymmetry now that each side is entered directly. New 'Per side' tag localised across all languages. --- frontend/src/lib/pt-br-locale.test.js | 4 ++-- frontend/src/locales/de.js | 1 + frontend/src/locales/es.js | 1 + frontend/src/locales/fr.js | 1 + frontend/src/locales/hi.js | 1 + frontend/src/locales/hu.js | 1 + frontend/src/locales/it.js | 1 + frontend/src/locales/ko.js | 1 + frontend/src/locales/pl.js | 1 + frontend/src/locales/pt.js | 1 + frontend/src/locales/ru.js | 1 + frontend/src/locales/th.js | 1 + frontend/src/locales/tr.js | 1 + frontend/src/locales/zh.js | 1 + frontend/src/views/Workout.jsx | 14 +++++++++----- 15 files changed, 24 insertions(+), 7 deletions(-) diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.js index 937f300..148cd64 100644 --- a/frontend/src/lib/pt-br-locale.test.js +++ b/frontend/src/lib/pt-br-locale.test.js @@ -28,10 +28,10 @@ describe('Brazilian Portuguese locale', () => { const fingerprint = createHash('sha256').update(JSON.stringify(inherited)).digest('hex') expect(Object.keys(PT_BR_OVERRIDES)).toHaveLength(626) - expect(inherited).toHaveLength(615) + expect(inherited).toHaveLength(616) // If this fails, review the changed keys and wording before accepting a new hash. From // frontend/: node scripts/pt-br-inheritance-fingerprint.mjs --list - expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('1f33b4f41974b95720a8ac936d8fc5e90ae8b705c8dcc039b2d6fe6563ec4355') + expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('37c65aee17762b05b2289285081fc57e604c3e3947b7eb18bc7170a5f2f70b72') }) test('does not leak European Portuguese UI terms', () => { diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js index 75643c4..41b0393 100644 --- a/frontend/src/locales/de.js +++ b/frontend/src/locales/de.js @@ -697,6 +697,7 @@ export default { '{0} reps in every set — add a set and go back to {1}.': '{0} Wiederholungen in jedem Satz — ein Satz kommt dazu, zurück auf {1}.', '{0} sets of {1} — time to add weight or move to a harder variation.': '{0} Sätze mit {1} — Zeit für Zusatzgewicht oder eine schwerere Variante.', '{0} per side': '{0} pro Seite', + 'Per side': 'Pro Seite', 'You still log the total: {0} is {1} per side.': 'Du trägst weiterhin die Gesamtzahl ein: {0} sind {1} pro Seite.', // --- AI Coach --- diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js index 8a8059c..d6de401 100644 --- a/frontend/src/locales/es.js +++ b/frontend/src/locales/es.js @@ -679,6 +679,7 @@ export default { '{0} reps in every set — add a set and go back to {1}.': '{0} reps en todas las series: añade una serie y vuelve a {1}.', '{0} sets of {1} — time to add weight or move to a harder variation.': '{0} series de {1}: toca añadir peso o pasar a una variante más difícil.', '{0} per side': '{0} por lado', + 'Per side': 'Por lado', 'You still log the total: {0} is {1} per side.': 'Sigues registrando el total: {0} son {1} por lado.', // --- AI Coach --- diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js index 91a78b2..bf8af42 100644 --- a/frontend/src/locales/fr.js +++ b/frontend/src/locales/fr.js @@ -679,6 +679,7 @@ export default { '{0} reps in every set — add a set and go back to {1}.': '{0} répétitions sur toutes les séries — une série en plus, retour à {1}.', '{0} sets of {1} — time to add weight or move to a harder variation.': '{0} séries de {1} — il est temps d’ajouter du poids ou de passer à une variante plus dure.', '{0} per side': '{0} par côté', + 'Per side': 'Par côté', 'You still log the total: {0} is {1} per side.': 'Tu notes toujours le total : {0}, c’est {1} par côté.', // --- AI Coach --- diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js index f6b7c6d..8706dbb 100644 --- a/frontend/src/locales/hi.js +++ b/frontend/src/locales/hi.js @@ -679,6 +679,7 @@ export default { '{0} reps in every set — add a set and go back to {1}.': 'हर सेट में {0} रेप्स — एक सेट जोड़ें और वापस {1} पर।', '{0} sets of {1} — time to add weight or move to a harder variation.': '{1} रेप्स के {0} सेट — अब वज़न बढ़ाने या किसी कठिन वैरिएशन पर जाने का समय।', '{0} per side': 'प्रति तरफ़ {0}', + 'Per side': 'प्रति तरफ़', 'You still log the total: {0} is {1} per side.': 'आप कुल ही दर्ज करते हैं: {0} यानी प्रति तरफ़ {1}।', // --- AI Coach --- diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.js index ccb3fda..76bfd65 100644 --- a/frontend/src/locales/hu.js +++ b/frontend/src/locales/hu.js @@ -658,6 +658,7 @@ export default { '{0} reps in every set — add a set and go back to {1}.': '{0} ismétlés minden sorozatban — egy sorozat hozzáadva, vissza {1}-re.', '{0} sets of {1} — time to add weight or move to a harder variation.': '{0} sorozat {1} ismétléssel — ideje súlyt hozzáadni vagy nehezebb variációra váltani.', '{0} per side': '{0} oldalanként', + 'Per side': 'Oldalanként', 'You still log the total: {0} is {1} per side.': 'Továbbra is az összeset rögzíted: {0} az {1} oldalanként.', '{0} sets · {1} work': '{0} sorozat · {1} munka', 'Make superset with previous': 'Szuperszett az előzővel', diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js index ccd2a3d..77ddcef 100644 --- a/frontend/src/locales/it.js +++ b/frontend/src/locales/it.js @@ -679,6 +679,7 @@ export default { '{0} reps in every set — add a set and go back to {1}.': '{0} ripetizioni in ogni serie — aggiungi una serie e torna a {1}.', '{0} sets of {1} — time to add weight or move to a harder variation.': '{0} serie da {1} — è ora di aggiungere peso o passare a una variante più difficile.', '{0} per side': '{0} per lato', + 'Per side': 'Per lato', 'You still log the total: {0} is {1} per side.': 'Registri sempre il totale: {0} sono {1} per lato.', // --- AI Coach --- diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js index 6474978..101f71b 100644 --- a/frontend/src/locales/ko.js +++ b/frontend/src/locales/ko.js @@ -679,6 +679,7 @@ export default { '{0} reps in every set — add a set and go back to {1}.': '모든 세트 {0}회 달성 — 세트를 추가하고 {1}회로 돌아갑니다.', '{0} sets of {1} — time to add weight or move to a harder variation.': '{1}회 {0}세트 — 이제 무게를 올리거나 더 어려운 동작으로 넘어가세요.', '{0} per side': '한쪽당 {0}회', + 'Per side': '한쪽당', 'You still log the total: {0} is {1} per side.': '기록은 그대로 합계로 합니다: {0}회는 한쪽당 {1}회입니다.', // --- AI Coach --- diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js index 6aa3b21..b309b3d 100644 --- a/frontend/src/locales/pl.js +++ b/frontend/src/locales/pl.js @@ -679,6 +679,7 @@ export default { '{0} reps in every set — add a set and go back to {1}.': 'Wszystkie serie po {0} powt. — dodaj serię i wróć do {1}.', '{0} sets of {1} — time to add weight or move to a harder variation.': '{0} × {1} powt. — czas dodać ciężar albo przejść na trudniejszy wariant.', '{0} per side': '{0} na stronę', + 'Per side': 'Na stronę', 'You still log the total: {0} is {1} per side.': 'Nadal zapisujesz łączną liczbę: {0} to {1} na stronę.', // --- AI Coach --- diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js index 9941a80..4929953 100644 --- a/frontend/src/locales/pt.js +++ b/frontend/src/locales/pt.js @@ -679,6 +679,7 @@ export default { '{0} reps in every set — add a set and go back to {1}.': '{0} repetições em todas as séries — acrescenta uma série e volta a {1}.', '{0} sets of {1} — time to add weight or move to a harder variation.': '{0} séries de {1} — hora de acrescentar peso ou passar a uma variação mais difícil.', '{0} per side': '{0} por lado', + 'Per side': 'Por lado', 'You still log the total: {0} is {1} per side.': 'Continuas a registar o total: {0} são {1} por lado.', // --- AI Coach --- diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js index d91e84e..c77d3cd 100644 --- a/frontend/src/locales/ru.js +++ b/frontend/src/locales/ru.js @@ -679,6 +679,7 @@ export default { '{0} reps in every set — add a set and go back to {1}.': 'Во всех подходах {0} повт. — добавь подход и вернись к {1}.', '{0} sets of {1} — time to add weight or move to a harder variation.': '{0} × {1} — пора добавить вес или перейти к более сложному варианту.', '{0} per side': '{0} на сторону', + 'Per side': 'На сторону', 'You still log the total: {0} is {1} per side.': 'Ты по-прежнему записываешь общее число: {0} — это {1} на сторону.', // --- AI Coach --- diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.js index 984dc82..6c3dd83 100644 --- a/frontend/src/locales/th.js +++ b/frontend/src/locales/th.js @@ -658,6 +658,7 @@ export default { '{0} reps in every set — add a set and go back to {1}.': 'ทำได้ {0} ครั้งในทุกเซ็ต — เพิ่มเซ็ตและกลับไปที่ {1}', '{0} sets of {1} — time to add weight or move to a harder variation.': '{0} เซ็ตของ {1} — ถึงเวลาเพิ่มน้ำหนักหรือเปลี่ยนไปท่าที่ยากขึ้น', '{0} per side': '{0} ต่อข้าง', + 'Per side': 'ต่อข้าง', 'You still log the total: {0} is {1} per side.': 'บันทึกจำนวนรวมตามปกติ: {0} คือ {1} ต่อข้าง', '{0} sets · {1} work': '{0} เซ็ต · เซ็ตหลัก {1}', 'Make superset with previous': 'รวมเป็นซูเปอร์เซ็ตกับท่าก่อนหน้า', diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js index 09d95c8..fdd275f 100644 --- a/frontend/src/locales/tr.js +++ b/frontend/src/locales/tr.js @@ -679,6 +679,7 @@ export default { '{0} reps in every set — add a set and go back to {1}.': 'Her sette {0} tekrar — bir set ekle ve {1} tekrara dön.', '{0} sets of {1} — time to add weight or move to a harder variation.': '{1} tekrarlık {0} set — ağırlık ekleme ya da daha zor bir varyasyona geçme zamanı.', '{0} per side': 'Taraf başına {0}', + 'Per side': 'Taraf başına', 'You still log the total: {0} is {1} per side.': 'Toplamı kaydetmeye devam ediyorsun: {0}, taraf başına {1} demek.', // --- AI Coach --- diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js index c51f23f..1db0a1d 100644 --- a/frontend/src/locales/zh.js +++ b/frontend/src/locales/zh.js @@ -679,6 +679,7 @@ export default { '{0} reps in every set — add a set and go back to {1}.': '每组都做到 {0} 次——加一组,次数回到 {1}。', '{0} sets of {1} — time to add weight or move to a harder variation.': '{0} 组 × {1} 次——该加重量或换更难的变式了。', '{0} per side': '每侧 {0} 次', + 'Per side': '每侧', 'You still log the total: {0} is {1} per side.': '你记录的仍然是总数:{0} 表示每侧 {1} 次。', // --- AI Coach --- diff --git a/frontend/src/views/Workout.jsx b/frontend/src/views/Workout.jsx index 4763125..45d5719 100644 --- a/frontend/src/views/Workout.jsx +++ b/frontend/src/views/Workout.jsx @@ -5,7 +5,7 @@ import { workoutControls } from '../lib/workout-controls.js' import { useUI } from '../store/useUI.js' import { exOr } from '../lib/exercises.js' import { usesBar, barWeightFor, plateSplit } from '../lib/bar.js' -import { effectiveRoutine, lastEntryFor, bestWeightFor, bestWeightForEntry, buildSets, freestyleConfig, defaultConfig, setsDoneActive, setUnitsTotal, supersetUnits, unitOf, setLabel, modeOf, isBw, isPerSide, sideReps, repStep, EFFORT, effortOf, stepEffort, capEffort, cascadeWeight, insertWarmupRow, removeRowAt, pairAdjacent, unpairSuperset, cleanupSg, applyIntensifierPlan, pinnedNoteFor, exNoteFor } from '../lib/history.js' +import { effectiveRoutine, lastEntryFor, bestWeightFor, bestWeightForEntry, buildSets, freestyleConfig, defaultConfig, setsDoneActive, setUnitsTotal, supersetUnits, unitOf, setLabel, modeOf, isBw, isPerSide, repStep, EFFORT, effortOf, stepEffort, capEffort, cascadeWeight, insertWarmupRow, removeRowAt, pairAdjacent, unpairSuperset, cleanupSg, applyIntensifierPlan, pinnedNoteFor, exNoteFor } from '../lib/history.js' import { fmtNum, fmtDate, todayISO, exCount, DAYN } from '../lib/format.js' import { beep, vibrate } from '../lib/sound.js' import { t, exerciseNameFor } from '../lib/i18n.js' @@ -248,7 +248,10 @@ function ExerciseBlock({ entryIdx, compact, onToggle, onToggleSide, onField, onA const fresh = useStore.getState().S.active?.entries[entryIdx]?.sets[i]?.sides?.[side] const cur = fresh ? fresh[col.f] : 0 if (col.f === 'w') return setSide(i, side, col.f, stepWeight(cur, col.step, dir)) - setSide(i, side, col.f, Math.max(0, Math.round(((cur || 0) + dir * col.step) * 100) / 100)) + // Reps step by one per side: repCol's step of two keeps the *combined* total evenly + // splittable, but here each side is logged directly, so one tap is one rep. + const step = col.f === 'r' ? 1 : col.step + setSide(i, side, col.f, Math.max(0, Math.round(((cur || 0) + dir * step) * 100) / 100)) } const sideCell = (sd, i, side, col, cls) => (
@@ -311,9 +314,10 @@ function ExerciseBlock({ entryIdx, compact, onToggle, onToggleSide, onField, onA
}
{cardio && {t('Cardio')}} - {/* You log the total; this is the split, so the set in front of you is unambiguous - without the rep count having to mean two different things (issue #31). */} - {!cardio && !timed && isPerSide(cfg) && {t('{0} per side', fmtNum(sideReps(entry.sets.find(s => !s.done)?.r ?? entry.sets[0]?.r)))}} + {/* A unilateral exercise is logged per side directly (the L/R rows below), so the old + "{n} per side" chip — which halved the combined total for display — is gone: the split + is no longer derived, it is what you enter. The tag only flags that this is per-side. */} + {!cardio && !timed && isPerSide(cfg) && {t('Per side')}} {(ex.tg || ex.bp) && {t(ex.tg || ex.bp)}} {ex.eq && {t(ex.eq)}} {best > 0 && {t('Best:')} {fmtNum(best)} {S.unit}}