From a4f73e34d1e351d715c6126313be762143c73aeb Mon Sep 17 00:00:00 2001 From: Duarte Santos Date: Wed, 22 Jul 2026 00:34:27 +0200 Subject: [PATCH] Custom exercises: optional description + reachable delete Adds an optional free-text description to custom exercises, shown where a built-in exercise shows its animation (detail + config sheets) and included in exercise search. Deleting was only reachable from the Exercises tab detail sheet, which you never pass through when tapping an exercise inside a routine. The routine's config sheet now offers "Edit or delete this exercise", and its old "Remove exercise" button is relabelled "Remove from routine" so removing from a routine and deleting for good are no longer confusable. Refs #11 --- CHANGELOG.md | 11 ++++++++--- frontend/src/index.css | 3 +++ frontend/src/locales/de.js | 6 +++++- frontend/src/locales/es.js | 6 +++++- frontend/src/locales/fr.js | 6 +++++- frontend/src/locales/hi.js | 6 +++++- frontend/src/locales/it.js | 6 +++++- frontend/src/locales/ko.js | 6 +++++- frontend/src/locales/pl.js | 6 +++++- frontend/src/locales/pt.js | 6 +++++- frontend/src/locales/ru.js | 6 +++++- frontend/src/locales/tr.js | 6 +++++- frontend/src/locales/zh.js | 6 +++++- frontend/src/sheets.jsx | 17 +++++++++++++---- frontend/src/views/Library.jsx | 2 +- 15 files changed, 80 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68f64d4..fdfdc76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,13 +7,18 @@ Custom exercises — add movements that aren't in the catalogue. (#11) - ✨ **Create your own exercise** from the exercise picker or the Exercises tab: a name and a body part is all it takes. Your search text is pre-filled as the name, so "no match" flows straight into "create it". +- 📝 **Optional description** — setup, cues, anything you want to remember. It shows on the + exercise's detail and config sheets (where a built-in exercise would show its animation), + and it's searchable, so you can find your own exercises by their cues too. - 🏋️ Custom exercises behave like built-in ones everywhere — routines, supersets, workout logging, weight suggestions, PRs, stats and history. The animation stays blank by design. - 🏃 Pick the *cardio* body part and it logs time + speed instead of weight × reps, like the built-in cardio exercises. -- ✏️ Edit (rename / change body part) or delete your custom exercises from their detail sheet. - Deleting removes them from your routines; already-logged workouts keep their sets and still - show the exercise name. +- ✏️ Edit (rename, change body part or description) or delete your custom exercises — from + their detail sheet in the Exercises tab, or straight from the exercise inside a routine via + "Edit or delete this exercise". Deleting removes them from your routines; already-logged + workouts keep their sets and still show the exercise name. (The routine sheet's old "Remove + exercise" button is now labelled "Remove from routine", so the two are no longer confusable.) - 🌍 Fully translated into all 12 UI languages, and synced to your profile like the rest of your data. diff --git a/frontend/src/index.css b/frontend/src/index.css index ff25dff..74c06d1 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -134,6 +134,9 @@ a{color:var(--acc)} .input{width:100%;background:var(--bg2);border:1px solid var(--line);border-radius:12px; padding:13px 14px;font-size:1rem;outline:none} .input:focus{border-color:var(--acc)} +textarea.input{min-height:88px;resize:vertical;line-height:1.45} +.exnote{background:var(--bg2);border-radius:12px;padding:12px 14px;line-height:1.5; + white-space:pre-wrap;font-size:.92rem;margin-bottom:10px} .search{position:relative} .search .input{padding-left:40px} .search svg{position:absolute;left:13px;top:50%;transform:translateY(-50%);width:17px;height:17px; diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js index 08716a7..fa9f9c4 100644 --- a/frontend/src/locales/de.js +++ b/frontend/src/locales/de.js @@ -346,5 +346,9 @@ export default { 'Delete “{0}”?': '„{0}“ löschen?', 'It will be removed from your routines. Already-logged workouts keep their sets.': 'Sie wird aus deinen Routinen entfernt. Bereits geloggte Workouts behalten ihre Sätze.', 'Exercise deleted': 'Übung gelöscht', - 'Finish your current workout first': 'Beende zuerst dein laufendes Workout' + 'Finish your current workout first': 'Beende zuerst dein laufendes Workout', + 'Description (optional) — setup, cues, anything you want to remember': 'Beschreibung (optional) — Aufbau, Hinweise, was du dir merken willst', + 'Delete exercise': 'Übung löschen', + 'Edit or delete this exercise': 'Übung bearbeiten oder löschen', + 'Remove from routine': 'Aus Routine entfernen' } diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js index 6d79425..b827592 100644 --- a/frontend/src/locales/es.js +++ b/frontend/src/locales/es.js @@ -328,5 +328,9 @@ export default { 'Delete “{0}”?': '¿Eliminar «{0}»?', 'It will be removed from your routines. Already-logged workouts keep their sets.': 'Se quitará de tus rutinas. Los entrenamientos ya registrados conservan sus series.', 'Exercise deleted': 'Ejercicio eliminado', - 'Finish your current workout first': 'Termina primero tu entrenamiento actual' + 'Finish your current workout first': 'Termina primero tu entrenamiento actual', + 'Description (optional) — setup, cues, anything you want to remember': 'Descripción (opcional) — preparación, consejos, lo que quieras recordar', + 'Delete exercise': 'Eliminar ejercicio', + 'Edit or delete this exercise': 'Editar o eliminar este ejercicio', + 'Remove from routine': 'Quitar de la rutina' } diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js index da18e03..cfe6a03 100644 --- a/frontend/src/locales/fr.js +++ b/frontend/src/locales/fr.js @@ -328,5 +328,9 @@ export default { 'Delete “{0}”?': 'Supprimer « {0} » ?', 'It will be removed from your routines. Already-logged workouts keep their sets.': 'Il sera retiré de vos routines. Les séances déjà enregistrées gardent leurs séries.', 'Exercise deleted': 'Exercice supprimé', - 'Finish your current workout first': 'Terminez d’abord votre séance en cours' + 'Finish your current workout first': 'Terminez d’abord votre séance en cours', + 'Description (optional) — setup, cues, anything you want to remember': 'Description (facultatif) — installation, conseils, ce que vous voulez retenir', + 'Delete exercise': 'Supprimer l’exercice', + 'Edit or delete this exercise': 'Modifier ou supprimer cet exercice', + 'Remove from routine': 'Retirer de la routine' } diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js index ed7390f..e09b48c 100644 --- a/frontend/src/locales/hi.js +++ b/frontend/src/locales/hi.js @@ -328,5 +328,9 @@ export default { 'Delete “{0}”?': '“{0}” हटाएं?', 'It will be removed from your routines. Already-logged workouts keep their sets.': 'यह आपकी रूटीन से हट जाएगी। दर्ज की गई वर्कआउट में सेट बने रहेंगे।', 'Exercise deleted': 'एक्सरसाइज़ हटाई गई', - 'Finish your current workout first': 'पहले चल रही वर्कआउट पूरी करें' + 'Finish your current workout first': 'पहले चल रही वर्कआउट पूरी करें', + 'Description (optional) — setup, cues, anything you want to remember': 'विवरण (वैकल्पिक) — सेटअप, संकेत, जो कुछ भी याद रखना चाहें', + 'Delete exercise': 'एक्सरसाइज़ हटाएं', + 'Edit or delete this exercise': 'इस एक्सरसाइज़ को संपादित या हटाएं', + 'Remove from routine': 'रूटीन से हटाएं' } diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js index bb77bdc..d75935d 100644 --- a/frontend/src/locales/it.js +++ b/frontend/src/locales/it.js @@ -328,5 +328,9 @@ export default { 'Delete “{0}”?': 'Eliminare «{0}»?', 'It will be removed from your routines. Already-logged workouts keep their sets.': 'Verrà rimosso dalle tue routine. Gli allenamenti già registrati mantengono le loro serie.', 'Exercise deleted': 'Esercizio eliminato', - 'Finish your current workout first': 'Prima concludi l’allenamento in corso' + 'Finish your current workout first': 'Prima concludi l’allenamento in corso', + 'Description (optional) — setup, cues, anything you want to remember': 'Descrizione (facoltativa) — setup, spunti, quello che vuoi ricordare', + 'Delete exercise': 'Elimina esercizio', + 'Edit or delete this exercise': 'Modifica o elimina questo esercizio', + 'Remove from routine': 'Rimuovi dalla routine' } diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js index 1a3b6f7..efa78cd 100644 --- a/frontend/src/locales/ko.js +++ b/frontend/src/locales/ko.js @@ -328,5 +328,9 @@ export default { 'Delete “{0}”?': '“{0}” 삭제할까요?', 'It will be removed from your routines. Already-logged workouts keep their sets.': '루틴에서 제거됩니다. 이미 기록된 운동은 세트를 유지합니다.', 'Exercise deleted': '운동 삭제됨', - 'Finish your current workout first': '진행 중인 운동을 먼저 마치세요' + 'Finish your current workout first': '진행 중인 운동을 먼저 마치세요', + 'Description (optional) — setup, cues, anything you want to remember': '설명 (선택) — 세팅, 큐, 기억하고 싶은 모든 것', + 'Delete exercise': '운동 삭제', + 'Edit or delete this exercise': '이 운동 편집 또는 삭제', + 'Remove from routine': '루틴에서 제거' } diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js index 5f5cbfe..9bc5dda 100644 --- a/frontend/src/locales/pl.js +++ b/frontend/src/locales/pl.js @@ -328,5 +328,9 @@ export default { 'Delete “{0}”?': 'Usunąć „{0}”?', 'It will be removed from your routines. Already-logged workouts keep their sets.': 'Zostanie usunięte z twoich planów. Zapisane treningi zachowają swoje serie.', 'Exercise deleted': 'Ćwiczenie usunięte', - 'Finish your current workout first': 'Najpierw zakończ bieżący trening' + 'Finish your current workout first': 'Najpierw zakończ bieżący trening', + 'Description (optional) — setup, cues, anything you want to remember': 'Opis (opcjonalnie) — ustawienie, wskazówki, co chcesz zapamiętać', + 'Delete exercise': 'Usuń ćwiczenie', + 'Edit or delete this exercise': 'Edytuj lub usuń to ćwiczenie', + 'Remove from routine': 'Usuń z planu' } diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js index d93fde1..355de22 100644 --- a/frontend/src/locales/pt.js +++ b/frontend/src/locales/pt.js @@ -328,5 +328,9 @@ export default { 'Delete “{0}”?': 'Eliminar «{0}»?', 'It will be removed from your routines. Already-logged workouts keep their sets.': 'Será removido das tuas rotinas. Os treinos já registados mantêm as suas séries.', 'Exercise deleted': 'Exercício eliminado', - 'Finish your current workout first': 'Termina primeiro o treino atual' + 'Finish your current workout first': 'Termina primeiro o treino atual', + 'Description (optional) — setup, cues, anything you want to remember': 'Descrição (opcional) — preparação, dicas, o que quiseres lembrar', + 'Delete exercise': 'Eliminar exercício', + 'Edit or delete this exercise': 'Editar ou eliminar este exercício', + 'Remove from routine': 'Remover da rotina' } diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js index 2299ebb..2ec50ab 100644 --- a/frontend/src/locales/ru.js +++ b/frontend/src/locales/ru.js @@ -328,5 +328,9 @@ export default { 'Delete “{0}”?': 'Удалить «{0}»?', 'It will be removed from your routines. Already-logged workouts keep their sets.': 'Оно будет убрано из ваших программ. Записанные тренировки сохранят свои подходы.', 'Exercise deleted': 'Упражнение удалено', - 'Finish your current workout first': 'Сначала завершите текущую тренировку' + 'Finish your current workout first': 'Сначала завершите текущую тренировку', + 'Description (optional) — setup, cues, anything you want to remember': 'Описание (необязательно) — настройка, подсказки, всё, что хотите запомнить', + 'Delete exercise': 'Удалить упражнение', + 'Edit or delete this exercise': 'Изменить или удалить это упражнение', + 'Remove from routine': 'Убрать из программы' } diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js index a343cc0..95f7aca 100644 --- a/frontend/src/locales/tr.js +++ b/frontend/src/locales/tr.js @@ -328,5 +328,9 @@ export default { 'Delete “{0}”?': '“{0}” silinsin mi?', 'It will be removed from your routines. Already-logged workouts keep their sets.': 'Rutinlerinden kaldırılacak. Kayıtlı antrenmanlar setlerini korur.', 'Exercise deleted': 'Egzersiz silindi', - 'Finish your current workout first': 'Önce mevcut antrenmanını bitir' + 'Finish your current workout first': 'Önce mevcut antrenmanını bitir', + 'Description (optional) — setup, cues, anything you want to remember': 'Açıklama (isteğe bağlı) — kurulum, ipuçları, hatırlamak istediklerin', + 'Delete exercise': 'Egzersizi sil', + 'Edit or delete this exercise': 'Bu egzersizi düzenle veya sil', + 'Remove from routine': 'Rutinden çıkar' } diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js index 6b11865..34168a4 100644 --- a/frontend/src/locales/zh.js +++ b/frontend/src/locales/zh.js @@ -328,5 +328,9 @@ export default { 'Delete “{0}”?': '删除「{0}」?', 'It will be removed from your routines. Already-logged workouts keep their sets.': '将从你的计划中移除。已记录的训练会保留其组数。', 'Exercise deleted': '动作已删除', - 'Finish your current workout first': '请先完成当前训练' + 'Finish your current workout first': '请先完成当前训练', + 'Description (optional) — setup, cues, anything you want to remember': '描述(可选)——设置、要点,任何你想记住的内容', + 'Delete exercise': '删除动作', + 'Edit or delete this exercise': '编辑或删除此动作', + 'Remove from routine': '从计划中移除' } diff --git a/frontend/src/sheets.jsx b/frontend/src/sheets.jsx index f46e5f3..fae35cf 100644 --- a/frontend/src/sheets.jsx +++ b/frontend/src/sheets.jsx @@ -161,6 +161,7 @@ function ExerciseDetail({ ex, close }) { 🛠 {t(ex.eq)} {(ex.sm || []).slice(0, 3).map((s, i) => {t(s)})} + {ex.desc &&
{ex.desc}
} {best > 0 &&
🏆 {t('Best:')} {fmtNum(best)} {st.unit}{last ? ` · ${t('last')} ${fmtDate(last.d)}: ${last.sets.map(s => setLabel(ex.id, s)).join(', ')}` : ''}
} {ex.custom &&
@@ -211,17 +212,19 @@ export const addToRoutineSheet = ex => ui().openSheet(close => { const name = n.trim() if (!name) { toast(t('Give it a name')); return } if (!bp) { toast(t('Pick a body part')); return } const dup = allExercises(S()).find(e => e.n.toLowerCase() === name.toLowerCase() && e.id !== (existing || {}).id) if (dup) { toast(t('“{0}” already exists', dup.n)); return } + const d = desc.trim().slice(0, 1000) let id = existing && existing.id - if (existing) update(s => { const c = (s.customEx || []).find(x => x.id === id); if (c) { c.n = name; c.bp = bp } }) + if (existing) update(s => { const c = (s.customEx || []).find(x => x.id === id); if (c) { c.n = name; c.bp = bp; c.desc = d } }) else { id = 'c' + uid() - update(s => { (s.customEx = s.customEx || []).push({ id, n: name, bp, tg: '', eq: 'custom', custom: true }) }) + update(s => { (s.customEx = s.customEx || []).push({ id, n: name, bp, desc: d, tg: '', eq: 'custom', custom: true }) }) } close() toast(existing ? t('Saved ✓') : t('“{0}” created ✓', name)) @@ -235,7 +238,11 @@ function CustomExForm({ existing, prefill, onDone, close }) { {BODYPARTS.map(b => )}
{bp === 'cardio' &&
🏃 {t('Cardio exercises log time + speed instead of weight × reps.')}
} +