diff --git a/frontend/src/components/Icon.jsx b/frontend/src/components/Icon.jsx index 033f3f1..065eb24 100644 --- a/frontend/src/components/Icon.jsx +++ b/frontend/src/components/Icon.jsx @@ -108,6 +108,7 @@ const P = { flag: <>, chartLine: , dot: , + more: <>, history: <>, signOut: <>, shuffle: <>, diff --git a/frontend/src/index.css b/frontend/src/index.css index f53aee0..1692132 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -639,6 +639,7 @@ h4.sec{ .setrow .n{ width:24px;height:24px;border-radius:50%;background:var(--surface-2);color:var(--label-2); display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:500;flex:none; + position:relative;padding:0;border:0;font-family:inherit;cursor:pointer; transition:background var(--fast),color var(--fast); } .setrow .stp.w{flex:1.4;min-width:0} @@ -667,6 +668,19 @@ h4.sec{ .subrow .stp.mini button{width:26px;height:30px} .subrow .stp.mini .num{font-size:13px;min-height:30px} .subrow .iconbtn{width:26px;height:26px;font-size:11px;flex:none} +/* The number is the set's menu (drop / burst / remove); a 24px circle needs a finger-sized hit area. */ +.setrow .n::before{content:'';position:absolute;inset:-10px} +/* No +/- buttons: the number field takes the whole cell and is the tap target. */ +.stp.plain{grid-template-columns:1fr} +.stp.plain .val{width:100%} +.stp.plain .num{width:100%;text-align:center} +/* --- menu sheet (the workout's "more" menus) --- */ +.menu-list .menu-item{min-height:52px;padding:8px 12px} +.menu-list .menu-item .lrow-i{width:32px;height:32px;font-size:16px;background:var(--surface-2);color:var(--label)} +.menu-list .menu-item.danger .tt,.menu-list .menu-item.danger .lrow-i{color:var(--red)} +.menu-list .menu-item.disabled{opacity:.4;pointer-events:none} +.menu-on{color:transparent;font-size:16px;flex:none} +.menu-on.is-on{color:var(--acc)} .setextra{display:flex;flex-wrap:wrap;gap:6px;margin:2px 0 8px 32px} .setextra .chip.add{display:inline-flex;align-items:center;gap:4px;color:var(--acc)} .setextra .chip.add svg{width:13px;height:13px} diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.js index 2e82c54..d84f00d 100644 --- a/frontend/src/lib/pt-br-locale.test.js +++ b/frontend/src/lib/pt-br-locale.test.js @@ -27,11 +27,11 @@ describe('Brazilian Portuguese locale', () => { .sort(byCodeUnit) const fingerprint = createHash('sha256').update(JSON.stringify(inherited)).digest('hex') - expect(Object.keys(PT_BR_OVERRIDES)).toHaveLength(612) - expect(inherited).toHaveLength(583) + expect(Object.keys(PT_BR_OVERRIDES)).toHaveLength(617) + expect(inherited).toHaveLength(592) // 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('c7ddbc412a3e758704289b4414372f2cbc0e26be4c0a0d95676cb3316ecae85a') + expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('088bb72a6ce33793bcc81215c2e7fc036226d8f144c53a633982e5b336226293') }) test('does not leak European Portuguese UI terms', () => { diff --git a/frontend/src/lib/workout-controls.js b/frontend/src/lib/workout-controls.js new file mode 100644 index 0000000..f6daed8 --- /dev/null +++ b/frontend/src/lib/workout-controls.js @@ -0,0 +1,15 @@ +// Which optional control groups the workout screen shows besides the sets themselves +// (Settings → During a workout → Workout controls). The lean default keeps the sets and one +// "more" button per exercise; each flag brings one of the old always-visible groups back. +// Lives in its own module so views can read it without the store — the store's DEF only +// references it. +export const WC_DEFAULT = Object.freeze({ + steppers: true, // +/- buttons on every weight/reps/effort field + setShortcuts: false, // "+ Drop" / "+ Burst" chips on every set and the warm-up/remove/add row + pairButtons: false, // "Make superset with previous/next" in the exercise header + exerciseButtons: false, // Move up/down, Swap, Remove exercise below the exercise +}) + +export function workoutControls(S) { + return { ...WC_DEFAULT, ...((S && S.wc) || {}) } +} diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js index ff55561..c7d9f05 100644 --- a/frontend/src/locales/de.js +++ b/frontend/src/locales/de.js @@ -1156,4 +1156,18 @@ export default { 'Point the camera at the QR code': 'Richte die Kamera auf den QR-Code', 'Camera is not available here — import a photo or type the code instead.': 'Die Kamera ist hier nicht verfügbar — importiere ein Foto oder tippe den Code ein.', 'Camera access was denied — allow it in your browser and try again.': 'Kamerazugriff wurde verweigert — erlaube ihn im Browser und versuche es erneut.', + 'Add note': 'Notiz hinzufügen', + 'Edit note': 'Notiz bearbeiten', + 'Progression settings': 'Progressions-Einstellungen', + 'Set {0}': 'Satz {0}', + 'Drop set': 'Drop-Satz', + 'Rest-pause burst': 'Rest-Pause-Burst', + 'Remove this set': 'Diesen Satz entfernen', + 'Workout controls': 'Bedienelemente im Training', + 'Weight and reps buttons': 'Plus/Minus-Tasten für Gewicht und Wdh.', + 'Off: tap the number and type it': 'Aus: Zahl antippen und eintippen', + 'Drop and burst shortcuts on every set': 'Drop/Burst-Kürzel an jedem Satz', + 'Superset buttons in the exercise header': 'Superset-Tasten im Übungskopf', + 'Move, swap and remove buttons below the exercise': 'Verschieben/Tauschen/Entfernen-Tasten unter der Übung', + 'Everything hidden here stays one tap away: the ⋯ button of an exercise and the number of a set.': 'Alles, was hier ausgeblendet ist, bleibt einen Tipp entfernt: die ⋯-Taste einer Übung und die Nummer eines Satzes.', } diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js index f481b5d..fe27196 100644 --- a/frontend/src/locales/es.js +++ b/frontend/src/locales/es.js @@ -1137,4 +1137,18 @@ export default { 'Point the camera at the QR code': 'Apunta la cámara al código QR', 'Camera is not available here — import a photo or type the code instead.': 'La cámara no está disponible aquí — importa una foto o escribe el código.', 'Camera access was denied — allow it in your browser and try again.': 'Se denegó el acceso a la cámara — permítelo en el navegador e inténtalo de nuevo.', + 'Add note': 'Añadir nota', + 'Edit note': 'Editar nota', + 'Progression settings': 'Ajustes de progresión', + 'Set {0}': 'Serie {0}', + 'Drop set': 'Serie descendente', + 'Rest-pause burst': 'Ráfaga rest-pause', + 'Remove this set': 'Quitar esta serie', + 'Workout controls': 'Controles del entrenamiento', + 'Weight and reps buttons': 'Botones +/− de peso y repeticiones', + 'Off: tap the number and type it': 'Desactivado: toca el número y escríbelo', + 'Drop and burst shortcuts on every set': 'Atajos de drop y ráfaga en cada serie', + 'Superset buttons in the exercise header': 'Botones de superserie en la cabecera del ejercicio', + 'Move, swap and remove buttons below the exercise': 'Botones mover, cambiar y quitar debajo del ejercicio', + 'Everything hidden here stays one tap away: the ⋯ button of an exercise and the number of a set.': 'Todo lo que ocultes aquí sigue a un toque: el botón ⋯ de un ejercicio y el número de una serie.', } diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js index 578b41d..e24fe32 100644 --- a/frontend/src/locales/fr.js +++ b/frontend/src/locales/fr.js @@ -1137,4 +1137,18 @@ export default { 'Point the camera at the QR code': 'Pointez la caméra vers le code QR', 'Camera is not available here — import a photo or type the code instead.': 'La caméra n’est pas disponible ici — importez une photo ou saisissez le code.', 'Camera access was denied — allow it in your browser and try again.': 'L’accès à la caméra a été refusé — autorisez-le dans le navigateur et réessayez.', + 'Add note': 'Ajouter une note', + 'Edit note': 'Modifier la note', + 'Progression settings': 'Réglages de progression', + 'Set {0}': 'Série {0}', + 'Drop set': 'Série dégressive', + 'Rest-pause burst': 'Rafale rest-pause', + 'Remove this set': 'Supprimer cette série', + 'Workout controls': 'Commandes pendant la séance', + 'Weight and reps buttons': 'Boutons +/− poids et répétitions', + 'Off: tap the number and type it': 'Désactivé : touchez le nombre et saisissez-le', + 'Drop and burst shortcuts on every set': 'Raccourcis drop et rafale sur chaque série', + 'Superset buttons in the exercise header': 'Boutons superset dans l\'en-tête de l\'exercice', + 'Move, swap and remove buttons below the exercise': 'Boutons déplacer, remplacer et retirer sous l\'exercice', + 'Everything hidden here stays one tap away: the ⋯ button of an exercise and the number of a set.': 'Tout ce qui est masqué ici reste à un tap : le bouton ⋯ d\'un exercice et le numéro d\'une série.', } diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js index 540dc07..0e87eb2 100644 --- a/frontend/src/locales/hi.js +++ b/frontend/src/locales/hi.js @@ -1137,4 +1137,18 @@ export default { 'Point the camera at the QR code': 'कैमरे को QR कोड पर रखें', 'Camera is not available here — import a photo or type the code instead.': 'कैमरा यहाँ उपलब्ध नहीं है — फ़ोटो इंपोर्ट करें या कोड टाइप करें।', 'Camera access was denied — allow it in your browser and try again.': 'कैमरे की अनुमति नहीं मिली — ब्राउज़र में अनुमति दें और फिर कोशिश करें।', + 'Add note': 'नोट जोड़ें', + 'Edit note': 'नोट संपादित करें', + 'Progression settings': 'प्रगति सेटिंग', + 'Set {0}': 'सेट {0}', + 'Drop set': 'ड्रॉप सेट', + 'Rest-pause burst': 'रेस्ट-पॉज़ बर्स्ट', + 'Remove this set': 'यह सेट हटाएँ', + 'Workout controls': 'वर्कआउट नियंत्रण', + 'Weight and reps buttons': 'वज़न और रेप्स के +/− बटन', + 'Off: tap the number and type it': 'बंद: संख्या पर टैप करें और टाइप करें', + 'Drop and burst shortcuts on every set': 'हर सेट पर ड्रॉप और बर्स्ट शॉर्टकट', + 'Superset buttons in the exercise header': 'व्यायाम शीर्षक में सुपरसेट बटन', + 'Move, swap and remove buttons below the exercise': 'व्यायाम के नीचे स्थानांतरित, बदलें और हटाएँ बटन', + 'Everything hidden here stays one tap away: the ⋯ button of an exercise and the number of a set.': 'यहाँ छिपाया गया सब कुछ एक टैप दूर रहता है: व्यायाम का ⋯ बटन और सेट की संख्या।', } diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.js index ea4b17e..d798393 100644 --- a/frontend/src/locales/hu.js +++ b/frontend/src/locales/hu.js @@ -1140,4 +1140,18 @@ export default { 'Point the camera at the QR code': 'Irányítsd a kamerát a QR-kódra', 'Camera is not available here — import a photo or type the code instead.': 'A kamera itt nem elérhető — importálj egy fotót vagy írd be a kódot.', 'Camera access was denied — allow it in your browser and try again.': 'A kamera-hozzáférés elutasítva — engedélyezd a böngészőben, és próbáld újra.', + 'Add note': 'Jegyzet hozzáadása', + 'Edit note': 'Jegyzet szerkesztése', + 'Progression settings': 'Progresszió beállításai', + 'Set {0}': '{0}. sorozat', + 'Drop set': 'Drop szett', + 'Rest-pause burst': 'Rest-pause sorozat', + 'Remove this set': 'Sorozat eltávolítása', + 'Workout controls': 'Vezérlők edzés közben', + 'Weight and reps buttons': 'Súly és ismétlés +/− gombok', + 'Off: tap the number and type it': 'Ki: koppints a számra és írd be', + 'Drop and burst shortcuts on every set': 'Drop és rest-pause gyorsgombok minden sorozatnál', + 'Superset buttons in the exercise header': 'Szuperszett gombok a gyakorlat fejlécében', + 'Move, swap and remove buttons below the exercise': 'Mozgatás, csere és eltávolítás gombok a gyakorlat alatt', + 'Everything hidden here stays one tap away: the ⋯ button of an exercise and the number of a set.': 'Minden, amit itt elrejtesz, egy koppintásra marad: a gyakorlat ⋯ gombja és a sorozat száma.', } diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js index 76be90d..52978fc 100644 --- a/frontend/src/locales/it.js +++ b/frontend/src/locales/it.js @@ -1137,4 +1137,18 @@ export default { 'Point the camera at the QR code': 'Inquadra il codice QR con la fotocamera', 'Camera is not available here — import a photo or type the code instead.': 'La fotocamera non è disponibile qui — importa una foto o digita il codice.', 'Camera access was denied — allow it in your browser and try again.': 'Accesso alla fotocamera negato — consentilo nel browser e riprova.', + 'Add note': 'Aggiungi nota', + 'Edit note': 'Modifica nota', + 'Progression settings': 'Impostazioni di progressione', + 'Set {0}': 'Serie {0}', + 'Drop set': 'Drop set', + 'Rest-pause burst': 'Raffica rest-pause', + 'Remove this set': 'Rimuovi questa serie', + 'Workout controls': 'Controlli durante l’allenamento', + 'Weight and reps buttons': 'Pulsanti +/− di peso e ripetizioni', + 'Off: tap the number and type it': 'Disattivato: tocca il numero e digitalo', + 'Drop and burst shortcuts on every set': 'Scorciatoie drop e raffica su ogni serie', + 'Superset buttons in the exercise header': 'Pulsanti superset nell’intestazione dell’esercizio', + 'Move, swap and remove buttons below the exercise': 'Pulsanti sposta, sostituisci e rimuovi sotto l’esercizio', + 'Everything hidden here stays one tap away: the ⋯ button of an exercise and the number of a set.': 'Tutto ciò che nascondi qui resta a un tocco: il pulsante ⋯ di un esercizio e il numero di una serie.', } diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js index 7928916..1f62ce2 100644 --- a/frontend/src/locales/ko.js +++ b/frontend/src/locales/ko.js @@ -1137,4 +1137,18 @@ export default { 'Point the camera at the QR code': '카메라를 QR 코드에 맞추세요', 'Camera is not available here — import a photo or type the code instead.': '여기서는 카메라를 사용할 수 없습니다 — 사진을 가져오거나 코드를 입력하세요.', 'Camera access was denied — allow it in your browser and try again.': '카메라 접근이 거부되었습니다 — 브라우저에서 허용한 뒤 다시 시도하세요.', + 'Add note': '메모 추가', + 'Edit note': '메모 편집', + 'Progression settings': '진행 설정', + 'Set {0}': '{0}세트', + 'Drop set': '드롭 세트', + 'Rest-pause burst': '레스트 포즈', + 'Remove this set': '이 세트 삭제', + 'Workout controls': '운동 중 버튼', + 'Weight and reps buttons': '무게·횟수 +/− 버튼', + 'Off: tap the number and type it': '끄면 숫자를 눌러 직접 입력', + 'Drop and burst shortcuts on every set': '모든 세트에 드롭·레스트 포즈 바로가기', + 'Superset buttons in the exercise header': '운동 제목의 슈퍼세트 버튼', + 'Move, swap and remove buttons below the exercise': '운동 아래의 이동·교체·삭제 버튼', + 'Everything hidden here stays one tap away: the ⋯ button of an exercise and the number of a set.': '여기서 숨긴 것은 모두 한 번의 탭으로 열 수 있습니다: 운동의 ⋯ 버튼과 세트 번호.', } diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js index 1d61870..f6d8f9b 100644 --- a/frontend/src/locales/pl.js +++ b/frontend/src/locales/pl.js @@ -1137,4 +1137,18 @@ export default { 'Point the camera at the QR code': 'Skieruj aparat na kod QR', 'Camera is not available here — import a photo or type the code instead.': 'Aparat nie jest tu dostępny — zaimportuj zdjęcie lub wpisz kod.', 'Camera access was denied — allow it in your browser and try again.': 'Odmówiono dostępu do aparatu — zezwól w przeglądarce i spróbuj ponownie.', + 'Add note': 'Dodaj notatkę', + 'Edit note': 'Edytuj notatkę', + 'Progression settings': 'Ustawienia progresji', + 'Set {0}': 'Seria {0}', + 'Drop set': 'Drop set', + 'Rest-pause burst': 'Seria rest-pause', + 'Remove this set': 'Usuń tę serię', + 'Workout controls': 'Przyciski podczas treningu', + 'Weight and reps buttons': 'Przyciski +/− ciężaru i powtórzeń', + 'Off: tap the number and type it': 'Wyłączone: dotknij liczby i wpisz ją', + 'Drop and burst shortcuts on every set': 'Skróty drop i rest-pause przy każdej serii', + 'Superset buttons in the exercise header': 'Przyciski superserii w nagłówku ćwiczenia', + 'Move, swap and remove buttons below the exercise': 'Przyciski przenieś, zamień i usuń pod ćwiczeniem', + 'Everything hidden here stays one tap away: the ⋯ button of an exercise and the number of a set.': 'Wszystko, co tu ukryjesz, jest o jedno dotknięcie: przycisk ⋯ ćwiczenia i numer serii.', } diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.js index 670575d..7bb2752 100644 --- a/frontend/src/locales/pt-BR.js +++ b/frontend/src/locales/pt-BR.js @@ -638,6 +638,11 @@ export const PT_BR_OVERRIDES = { 'Clear selection': 'Limpar seleção', 'Primary target': 'Músculo principal', 'Also trains': 'Também trabalha', + 'Progression settings': 'Configurações de progressão', + 'Workout controls': 'Controles durante o treino', + 'Off: tap the number and type it': 'Desligado: toque no número e digite', + 'Move, swap and remove buttons below the exercise': 'Botões mover, trocar e remover abaixo do exercício', + 'Everything hidden here stays one tap away: the ⋯ button of an exercise and the number of a set.': 'Tudo o que você esconde aqui fica a um toque: o botão ⋯ de um exercício e o número de uma série.', } export default { ...pt, ...PT_BR_OVERRIDES } diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js index 60dd52f..91531ec 100644 --- a/frontend/src/locales/pt.js +++ b/frontend/src/locales/pt.js @@ -1137,4 +1137,18 @@ export default { 'Point the camera at the QR code': 'Aponta a câmara para o código QR', 'Camera is not available here — import a photo or type the code instead.': 'A câmara não está disponível aqui — importa uma foto ou escreve o código.', 'Camera access was denied — allow it in your browser and try again.': 'O acesso à câmara foi recusado — permite-o no navegador e tenta de novo.', + 'Add note': 'Adicionar nota', + 'Edit note': 'Editar nota', + 'Progression settings': 'Definições de progressão', + 'Set {0}': 'Série {0}', + 'Drop set': 'Drop set', + 'Rest-pause burst': 'Rajada rest-pause', + 'Remove this set': 'Remover esta série', + 'Workout controls': 'Controlos durante o treino', + 'Weight and reps buttons': 'Botões +/− de peso e repetições', + 'Off: tap the number and type it': 'Desligado: toca no número e escreve-o', + 'Drop and burst shortcuts on every set': 'Atalhos de drop e rajada em cada série', + 'Superset buttons in the exercise header': 'Botões de superset no cabeçalho do exercício', + 'Move, swap and remove buttons below the exercise': 'Botões mover, trocar e remover por baixo do exercício', + 'Everything hidden here stays one tap away: the ⋯ button of an exercise and the number of a set.': 'Tudo o que escondes aqui fica a um toque: o botão ⋯ de um exercício e o número de uma série.', } diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js index d3c8917..bb31317 100644 --- a/frontend/src/locales/ru.js +++ b/frontend/src/locales/ru.js @@ -1137,4 +1137,18 @@ export default { 'Point the camera at the QR code': 'Наведите камеру на QR-код', 'Camera is not available here — import a photo or type the code instead.': 'Камера здесь недоступна — импортируйте фото или введите код.', 'Camera access was denied — allow it in your browser and try again.': 'Доступ к камере запрещён — разрешите его в браузере и попробуйте снова.', + 'Add note': 'Добавить заметку', + 'Edit note': 'Изменить заметку', + 'Progression settings': 'Настройки прогрессии', + 'Set {0}': 'Подход {0}', + 'Drop set': 'Дроп-сет', + 'Rest-pause burst': 'Отдых-пауза', + 'Remove this set': 'Удалить этот подход', + 'Workout controls': 'Кнопки во время тренировки', + 'Weight and reps buttons': 'Кнопки +/− для веса и повторений', + 'Off: tap the number and type it': 'Выкл.: нажмите на число и введите его', + 'Drop and burst shortcuts on every set': 'Кнопки дроп-сета и отдых-паузы у каждого подхода', + 'Superset buttons in the exercise header': 'Кнопки суперсета в заголовке упражнения', + 'Move, swap and remove buttons below the exercise': 'Кнопки переместить, заменить и удалить под упражнением', + 'Everything hidden here stays one tap away: the ⋯ button of an exercise and the number of a set.': 'Всё скрытое здесь остаётся в одном нажатии: кнопка ⋯ упражнения и номер подхода.', } diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.js index 196b91f..a904903 100644 --- a/frontend/src/locales/th.js +++ b/frontend/src/locales/th.js @@ -1148,4 +1148,18 @@ export default { 'Point the camera at the QR code': 'เล็งกล้องไปที่ QR โค้ด', 'Camera is not available here — import a photo or type the code instead.': 'ใช้กล้องที่นี่ไม่ได้ — นำเข้ารูปภาพหรือพิมพ์รหัสแทน', 'Camera access was denied — allow it in your browser and try again.': 'การเข้าถึงกล้องถูกปฏิเสธ — อนุญาตในเบราว์เซอร์แล้วลองอีกครั้ง', + 'Add note': 'เพิ่มโน้ต', + 'Edit note': 'แก้ไขโน้ต', + 'Progression settings': 'ตั้งค่าการเพิ่มน้ำหนัก', + 'Set {0}': 'เซ็ต {0}', + 'Drop set': 'ดรอปเซ็ต', + 'Rest-pause burst': 'เรสต์พอส', + 'Remove this set': 'ลบเซ็ตนี้', + 'Workout controls': 'ปุ่มระหว่างออกกำลังกาย', + 'Weight and reps buttons': 'ปุ่ม +/− น้ำหนักและจำนวนครั้ง', + 'Off: tap the number and type it': 'ปิด: แตะตัวเลขแล้วพิมพ์เอง', + 'Drop and burst shortcuts on every set': 'ปุ่มลัดดรอปเซ็ตและเรสต์พอสทุกเซ็ต', + 'Superset buttons in the exercise header': 'ปุ่มซูเปอร์เซ็ตในหัวข้อท่า', + 'Move, swap and remove buttons below the exercise': 'ปุ่มย้าย สลับ และลบใต้ท่าออกกำลังกาย', + 'Everything hidden here stays one tap away: the ⋯ button of an exercise and the number of a set.': 'ทุกอย่างที่ซ่อนไว้ยังอยู่ห่างแค่แตะเดียว: ปุ่ม ⋯ ของท่าและหมายเลขเซ็ต', } diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js index 0b0853b..407ada7 100644 --- a/frontend/src/locales/tr.js +++ b/frontend/src/locales/tr.js @@ -1137,4 +1137,18 @@ export default { 'Point the camera at the QR code': 'Kamerayı QR koda tutun', 'Camera is not available here — import a photo or type the code instead.': 'Kamera burada kullanılamıyor — bir fotoğraf içe aktarın veya kodu yazın.', 'Camera access was denied — allow it in your browser and try again.': 'Kamera erişimi reddedildi — tarayıcıda izin verip tekrar deneyin.', + 'Add note': 'Not ekle', + 'Edit note': 'Notu düzenle', + 'Progression settings': 'İlerleme ayarları', + 'Set {0}': 'Set {0}', + 'Drop set': 'Drop set', + 'Rest-pause burst': 'Rest-pause patlaması', + 'Remove this set': 'Bu seti kaldır', + 'Workout controls': 'Antrenman kontrolleri', + 'Weight and reps buttons': 'Ağırlık ve tekrar +/− düğmeleri', + 'Off: tap the number and type it': 'Kapalı: sayıya dokunup yazın', + 'Drop and burst shortcuts on every set': 'Her sette drop ve patlama kısayolları', + 'Superset buttons in the exercise header': 'Egzersiz başlığında süperset düğmeleri', + 'Move, swap and remove buttons below the exercise': 'Egzersizin altında taşı, değiştir ve kaldır düğmeleri', + 'Everything hidden here stays one tap away: the ⋯ button of an exercise and the number of a set.': 'Burada gizlenen her şey bir dokunuş uzakta kalır: egzersizin ⋯ düğmesi ve setin numarası.', } diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js index ad32543..3254ff1 100644 --- a/frontend/src/locales/zh.js +++ b/frontend/src/locales/zh.js @@ -1137,4 +1137,18 @@ export default { 'Point the camera at the QR code': '将摄像头对准二维码', 'Camera is not available here — import a photo or type the code instead.': '此处无法使用摄像头 — 请导入照片或手动输入代码。', 'Camera access was denied — allow it in your browser and try again.': '摄像头访问被拒绝 — 请在浏览器中允许后重试。', + 'Add note': '添加备注', + 'Edit note': '编辑备注', + 'Progression settings': '渐进设置', + 'Set {0}': '第 {0} 组', + 'Drop set': '递减组', + 'Rest-pause burst': '休息暂停组', + 'Remove this set': '删除这一组', + 'Workout controls': '训练中的按钮', + 'Weight and reps buttons': '重量和次数的 +/− 按钮', + 'Off: tap the number and type it': '关闭:点按数字直接输入', + 'Drop and burst shortcuts on every set': '每组显示递减/休息暂停快捷按钮', + 'Superset buttons in the exercise header': '动作标题中的超级组按钮', + 'Move, swap and remove buttons below the exercise': '动作下方的移动、替换和删除按钮', + 'Everything hidden here stays one tap away: the ⋯ button of an exercise and the number of a set.': '这里隐藏的一切都只需一次点按:动作的 ⋯ 按钮和组号。', } diff --git a/frontend/src/sheets.jsx b/frontend/src/sheets.jsx index 3b3af2e..c16534c 100644 --- a/frontend/src/sheets.jsx +++ b/frontend/src/sheets.jsx @@ -49,6 +49,31 @@ function ConfirmDialog({ title, message, confirmText, cancelText, danger, onConf } +/* ============================ menu sheet ============================ */ +// A list of actions, one per row, closing on tap. This is where the workout screen parks +// everything that is not a set you are about to log: the point of a single "more" button is +// that the ten things you do once a session stop competing with the two you do every set. +// items: [{ icon, label, sub, onClick, danger, disabled, on }] — `on` draws a check for toggles. +function MenuSheet({ title, subtitle, items, close }) { + return <> + {title &&

{title}

} + {subtitle &&
{subtitle}
} +
+ {items.filter(Boolean).map((it, i) =>
{ close(); it.onClick && it.onClick() })}> + {it.icon && } +
{it.label}
{it.sub &&
{it.sub}
}
+ {it.on != null && } +
)} +
+ +} +export function menuSheet(opts) { + ui().openSheet(close => ) +} + // Themed replacement for window.confirm — callback-based (no blocking). export function confirmSheet(opts) { ui().openSheet(close => , { kind: 'center' }) diff --git a/frontend/src/store/useStore.js b/frontend/src/store/useStore.js index 4c5f879..15f74dc 100644 --- a/frontend/src/store/useStore.js +++ b/frontend/src/store/useStore.js @@ -8,6 +8,8 @@ import { MOBILE, initReminderSync, nativeLoad, nativeSave, syncReminder, writeAu import { loadRemote, chooseLocal, forgetRemote, connect } from '../lib/remote.js' import { loadCoachDevice, saveCoachDevice, coachDeviceSettings } from '../lib/coach-device.js' +import { WC_DEFAULT } from '../lib/workout-controls.js' + const KEY = 'gym_state_v1' export const DEF = { unit: 'kg', restSec: 90, restPauseSec: 15, sound: true, timerFlash: false, keepAwake: true, lang: 'en', @@ -18,6 +20,10 @@ export const DEF = { // or 'list' (every exercise stacked and scrollable). Purely presentational: profiles // written before this setting existed overlay onto DEF and keep the 'cards' behaviour. workoutView: 'cards', + // Which controls the workout screen shows besides the sets themselves. The default is the + // lean layout: one "more" button per exercise and a menu on each set number. Every switch + // brings one of the old always-visible button groups back (Settings → During a workout). + wc: { ...WC_DEFAULT }, // effort: which per-set effort scale is logged — 'none' | 'rir' | 'rpe'. null, not 'none', so // that a profile which never chose (loaded state is overlaid on DEF, on every path: local, // server pull, backup import) still falls back to the `showRir` boolean this replaced and diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsx index d349a96..36c1e49 100644 --- a/frontend/src/views/Settings.jsx +++ b/frontend/src/views/Settings.jsx @@ -1,6 +1,7 @@ import { useEffect, useRef, useState } from 'react' import { useNavigate } from 'react-router-dom' import { useStore, DEF, hasData } from '../store/useStore.js' +import { workoutControls } from '../lib/workout-controls.js' import { useUI } from '../store/useUI.js' import { ACCENTS, todayISO, localTZ, weekStartOf, MONDAY, SUNDAY } from '../lib/format.js' import { effortOf } from '../lib/history.js' @@ -157,6 +158,11 @@ export default function Settings() { value={S.workoutView === 'list' ? 'list' : 'cards'} onChange={v => update(s => { s.workoutView = v })} /> + {/* The lean workout screen keeps the sets and one "more" button per exercise; each switch + brings one of the old always-visible button groups back for people who liked them. */} +