diff --git a/CHANGELOG.md b/CHANGELOG.md index 357f269..1034ced 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## v1.1.5 — 2026-07-22 + +- 🏋️ **Filter exercises by equipment** (#6). A second filter row under the body parts lets you + narrow the list to what you actually have — body weight, dumbbell, barbell, cable, band, and so + on — in both the Exercises library and the exercise picker. The options adapt to what you've + already selected and are ordered by how many exercises use them, so every combination on screen + has results behind it and the row stays short. Building a bodyweight-only plan is now two taps + per body part. +- ⏱️ **Fixed: the rest timer froze at 0:01** (#14) instead of counting down to the end. It also + meant the timer could only be cleared with Skip, and a redundant "rest over" push notification + could still fire. + ## v1.1.4 — 2026-07-22 Admin dashboard for self-hosters (opt-in — off by default). diff --git a/frontend/src/lib/exercises.js b/frontend/src/lib/exercises.js index a0b3d5a..c482e7b 100644 --- a/frontend/src/lib/exercises.js +++ b/frontend/src/lib/exercises.js @@ -5,6 +5,15 @@ export const EXIDX = {} EXDB.forEach(e => { EXIDX[e.id] = e }) export const BODYPARTS = [...new Set(EXDB.map(e => e.bp))].sort() +// Equipment options present in a given list of exercises, most common first (issue #6). +// Deriving them from the *already filtered* list keeps the chip row short and means +// every body-part × equipment combination on screen has results behind it. +export function equipmentOf(list) { + const c = {} + list.forEach(e => { if (e.eq) c[e.eq] = (c[e.eq] || 0) + 1 }) + return Object.keys(c).sort((a, b) => c[b] - c[a] || (a < b ? -1 : 1)) +} + // Custom (user-created) exercises live in synced state S.customEx (issue #11) and are // merged into the id index here so every EXIDX[id] lookup keeps working unchanged. let customIds = [] diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js index b1c5475..3163096 100644 --- a/frontend/src/locales/de.js +++ b/frontend/src/locales/de.js @@ -302,6 +302,7 @@ export default { 'lower legs': 'Unterschenkel', 'neck': 'Nacken', 'shoulders': 'Schultern', 'upper arms': 'Oberarme', 'upper legs': 'Oberschenkel', 'waist': 'Rumpf', // --- data terms: equipment --- + 'Any equipment': 'Alle Geräte', 'assisted': 'assistiert', 'band': 'Band', 'barbell': 'Langhantel', 'body weight': 'Körpergewicht', 'bosu ball': 'Bosu-Ball', 'cable': 'Kabelzug', 'dumbbell': 'Kurzhantel', 'elliptical machine': 'Crosstrainer', 'ez barbell': 'SZ-Stange', 'hammer': 'Hammer', diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js index d70762f..aee490c 100644 --- a/frontend/src/locales/es.js +++ b/frontend/src/locales/es.js @@ -285,6 +285,7 @@ export default { 'back': 'espalda', 'cardio': 'cardio', 'chest': 'pecho', 'lower arms': 'antebrazos', 'lower legs': 'pantorrillas', 'neck': 'cuello', 'shoulders': 'hombros', 'upper arms': 'brazos', 'upper legs': 'piernas', 'waist': 'abdomen', + 'Any equipment': 'Cualquier equipo', 'assisted': 'asistido', 'band': 'banda', 'barbell': 'barra', 'body weight': 'peso corporal', 'bosu ball': 'bosu', 'cable': 'polea', 'dumbbell': 'mancuerna', 'elliptical machine': 'elíptica', 'ez barbell': 'barra EZ', 'hammer': 'martillo', diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js index af8b843..ed18529 100644 --- a/frontend/src/locales/fr.js +++ b/frontend/src/locales/fr.js @@ -285,6 +285,7 @@ export default { 'back': 'dos', 'cardio': 'cardio', 'chest': 'pectoraux', 'lower arms': 'avant-bras', 'lower legs': 'mollets', 'neck': 'cou', 'shoulders': 'épaules', 'upper arms': 'bras', 'upper legs': 'cuisses', 'waist': 'abdos', + 'Any equipment': 'Tout équipement', 'assisted': 'assisté', 'band': 'élastique', 'barbell': 'barre', 'body weight': 'poids du corps', 'bosu ball': 'bosu', 'cable': 'poulie', 'dumbbell': 'haltère', 'elliptical machine': 'vélo elliptique', 'ez barbell': 'barre EZ', 'hammer': 'marteau', diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js index 0680a22..5dd9582 100644 --- a/frontend/src/locales/hi.js +++ b/frontend/src/locales/hi.js @@ -285,6 +285,7 @@ export default { 'back': 'पीठ', 'cardio': 'कार्डियो', 'chest': 'छाती', 'lower arms': 'अग्रबाहु', 'lower legs': 'पिंडलियाँ', 'neck': 'गर्दन', 'shoulders': 'कंधे', 'upper arms': 'बाजू', 'upper legs': 'जाँघें', 'waist': 'पेट', + 'Any equipment': 'कोई भी उपकरण', 'assisted': 'सहायता प्राप्त', 'band': 'बैंड', 'barbell': 'बारबेल', 'body weight': 'शरीर का वज़न', 'bosu ball': 'बोसु बॉल', 'cable': 'केबल', 'dumbbell': 'डम्बल', 'elliptical machine': 'एलिप्टिकल मशीन', 'ez barbell': 'EZ बारबेल', 'hammer': 'हैमर', diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js index 0c67f5e..5da0ee6 100644 --- a/frontend/src/locales/it.js +++ b/frontend/src/locales/it.js @@ -285,6 +285,7 @@ export default { 'back': 'schiena', 'cardio': 'cardio', 'chest': 'petto', 'lower arms': 'avambracci', 'lower legs': 'polpacci', 'neck': 'collo', 'shoulders': 'spalle', 'upper arms': 'braccia', 'upper legs': 'gambe', 'waist': 'addome', + 'Any equipment': 'Qualsiasi attrezzo', 'assisted': 'assistito', 'band': 'elastico', 'barbell': 'bilanciere', 'body weight': 'corpo libero', 'bosu ball': 'bosu', 'cable': 'cavo', 'dumbbell': 'manubrio', 'elliptical machine': 'ellittica', 'ez barbell': 'bilanciere EZ', 'hammer': 'martello', diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js index 89fc91e..4017cc2 100644 --- a/frontend/src/locales/ko.js +++ b/frontend/src/locales/ko.js @@ -285,6 +285,7 @@ export default { 'back': '등', 'cardio': '유산소', 'chest': '가슴', 'lower arms': '전완', 'lower legs': '종아리', 'neck': '목', 'shoulders': '어깨', 'upper arms': '팔', 'upper legs': '허벅지', 'waist': '복부', + 'Any equipment': '모든 장비', 'assisted': '보조', 'band': '밴드', 'barbell': '바벨', 'body weight': '맨몸', 'bosu ball': '보수볼', 'cable': '케이블', 'dumbbell': '덤벨', 'elliptical machine': '일립티컬', 'ez barbell': 'EZ바', 'hammer': '해머', diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js index 6b9bb6e..e4b0b89 100644 --- a/frontend/src/locales/pl.js +++ b/frontend/src/locales/pl.js @@ -285,6 +285,7 @@ export default { 'back': 'plecy', 'cardio': 'cardio', 'chest': 'klatka', 'lower arms': 'przedramiona', 'lower legs': 'łydki', 'neck': 'kark', 'shoulders': 'barki', 'upper arms': 'ramiona', 'upper legs': 'uda', 'waist': 'brzuch', + 'Any equipment': 'Dowolny sprzęt', 'assisted': 'z asystą', 'band': 'guma', 'barbell': 'sztanga', 'body weight': 'masa ciała', 'bosu ball': 'bosu', 'cable': 'wyciąg', 'dumbbell': 'hantla', 'elliptical machine': 'orbitrek', 'ez barbell': 'sztanga łamana', 'hammer': 'młot', diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js index a6a993f..8f025aa 100644 --- a/frontend/src/locales/pt.js +++ b/frontend/src/locales/pt.js @@ -285,6 +285,7 @@ export default { 'back': 'costas', 'cardio': 'cardio', 'chest': 'peito', 'lower arms': 'antebraços', 'lower legs': 'gémeos', 'neck': 'pescoço', 'shoulders': 'ombros', 'upper arms': 'braços', 'upper legs': 'pernas', 'waist': 'abdómen', + 'Any equipment': 'Qualquer equipamento', 'assisted': 'assistido', 'band': 'banda', 'barbell': 'barra', 'body weight': 'peso corporal', 'bosu ball': 'bosu', 'cable': 'cabo', 'dumbbell': 'haltere', 'elliptical machine': 'elíptica', 'ez barbell': 'barra EZ', 'hammer': 'martelo', diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js index 8ae0263..1f67b95 100644 --- a/frontend/src/locales/ru.js +++ b/frontend/src/locales/ru.js @@ -285,6 +285,7 @@ export default { 'back': 'спина', 'cardio': 'кардио', 'chest': 'грудь', 'lower arms': 'предплечья', 'lower legs': 'голени', 'neck': 'шея', 'shoulders': 'плечи', 'upper arms': 'руки', 'upper legs': 'бёдра', 'waist': 'пресс', + 'Any equipment': 'Любой инвентарь', 'assisted': 'с поддержкой', 'band': 'лента', 'barbell': 'штанга', 'body weight': 'свой вес', 'bosu ball': 'босу', 'cable': 'блок', 'dumbbell': 'гантель', 'elliptical machine': 'эллипсоид', 'ez barbell': 'EZ-гриф', 'hammer': 'молот', diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js index 14b2759..e756386 100644 --- a/frontend/src/locales/tr.js +++ b/frontend/src/locales/tr.js @@ -285,6 +285,7 @@ export default { 'back': 'sırt', 'cardio': 'kardiyo', 'chest': 'göğüs', 'lower arms': 'ön kollar', 'lower legs': 'baldırlar', 'neck': 'boyun', 'shoulders': 'omuzlar', 'upper arms': 'üst kollar', 'upper legs': 'bacaklar', 'waist': 'karın', + 'Any equipment': 'Tüm ekipmanlar', 'assisted': 'destekli', 'band': 'bant', 'barbell': 'halter', 'body weight': 'vücut ağırlığı', 'bosu ball': 'bosu topu', 'cable': 'kablo', 'dumbbell': 'dambıl', 'elliptical machine': 'eliptik bisiklet', 'ez barbell': 'EZ bar', 'hammer': 'çekiç', diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js index cedf4bb..954f094 100644 --- a/frontend/src/locales/zh.js +++ b/frontend/src/locales/zh.js @@ -285,6 +285,7 @@ export default { 'back': '背部', 'cardio': '有氧', 'chest': '胸部', 'lower arms': '前臂', 'lower legs': '小腿', 'neck': '颈部', 'shoulders': '肩部', 'upper arms': '上臂', 'upper legs': '大腿', 'waist': '腰腹', + 'Any equipment': '所有器械', 'assisted': '辅助', 'band': '弹力带', 'barbell': '杠铃', 'body weight': '自重', 'bosu ball': '波速球', 'cable': '绳索', 'dumbbell': '哑铃', 'elliptical machine': '椭圆机', 'ez barbell': '曲杆杠铃', 'hammer': '锤', diff --git a/frontend/src/sheets.jsx b/frontend/src/sheets.jsx index fae35cf..97ffb47 100644 --- a/frontend/src/sheets.jsx +++ b/frontend/src/sheets.jsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react' import { useStore } from './store/useStore.js' import { useUI } from './store/useUI.js' -import { EXDB, EXIDX, BODYPARTS, isCardio, allExercises } from './lib/exercises.js' +import { EXDB, EXIDX, BODYPARTS, isCardio, allExercises, equipmentOf } from './lib/exercises.js' import { fmtDate, fmtNum, fmtVol, fmtDur, todayISO, uid, DAYN, MONTHS_LONG, ACCENTS } from './lib/format.js' import { lastEntryFor, bestWeightFor, buildSets, effectiveRoutineId, workoutVolume, setsDone, setsDoneActive, lastBW, supersetUnits, unitOf, setLabel, defaultConfig, cleanupSg } from './lib/history.js' import { beep, vibrate } from './lib/sound.js' @@ -280,23 +280,32 @@ function ExercisePicker({ onPick, close }) { const usage = usageMap(st) const [q, setQ] = useState('') const [bp, setBp] = useState('') // '' = all, '★' = chosen, else a body part + const [eq, setEq] = useState('') // '' = any equipment const [shown, setShown] = useState(50) const ql = q.toLowerCase().trim() const all = allExercises(st) - let f = all.filter(e => + let base = all.filter(e => (bp === '★' ? usage[e.id] : (!bp || e.bp === bp)) && (!ql || e.n.toLowerCase().includes(ql) || e.tg.includes(ql) || e.eq.includes(ql) || (e.desc || '').toLowerCase().includes(ql))) - if (bp === '★') f = [...f].sort((a, b) => (usage[b.id] - usage[a.id]) || (a.n < b.n ? -1 : 1)) + if (bp === '★') base = [...base].sort((a, b) => (usage[b.id] - usage[a.id]) || (a.n < b.n ? -1 : 1)) + const eqOpts = equipmentOf(base) + // Drop the equipment filter if the search narrowed it away, so you never hit a dead end. + const eqOn = eqOpts.includes(eq) ? eq : '' + const f = eqOn ? base.filter(e => e.eq === eqOn) : base const chosenCount = Object.keys(usage).length return <>