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.
This commit is contained in:
1 parent
af751a718e
commit
0cae9867a1
15 files changed
+24
-7
No files matched your search
@@ -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', () => {
|
||||
|
||||
@@ -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 ---
|
||||
|
||||
@@ -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 ---
|
||||
|
||||
@@ -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 ---
|
||||
|
||||
@@ -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 ---
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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 ---
|
||||
|
||||
@@ -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 ---
|
||||
|
||||
@@ -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 ---
|
||||
|
||||
@@ -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 ---
|
||||
|
||||
@@ -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 ---
|
||||
|
||||
@@ -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': 'รวมเป็นซูเปอร์เซ็ตกับท่าก่อนหน้า',
|
||||
|
||||
@@ -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 ---
|
||||
|
||||
@@ -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 ---
|
||||
|
||||
@@ -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) => (
|
||||
<div className={'stp ' + cls + (wc.steppers ? '' : ' plain')}>
|
||||
@@ -311,9 +314,10 @@ function ExerciseBlock({ entryIdx, compact, onToggle, onToggleSide, onField, onA
|
||||
</div>}
|
||||
<div className="row" style={{ gap: 6, flexWrap: 'wrap', marginBottom: 8 }}>
|
||||
{cardio && <span className="tag acc"><Icon name="figureRun" />{t('Cardio')}</span>}
|
||||
{/* 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) && <span className="tag acc nocap"><Icon name="shuffle" />{t('{0} per side', fmtNum(sideReps(entry.sets.find(s => !s.done)?.r ?? entry.sets[0]?.r)))}</span>}
|
||||
{/* 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) && <span className="tag acc nocap"><Icon name="shuffle" />{t('Per side')}</span>}
|
||||
{(ex.tg || ex.bp) && <span className="tag">{t(ex.tg || ex.bp)}</span>}
|
||||
{ex.eq && <span className="tag">{t(ex.eq)}</span>}
|
||||
{best > 0 && <span className="tag nocap">{t('Best:')} {fmtNum(best)} {S.unit}</span>}
|
||||
|
||||
Reference in new issue
Block a user