Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
Add a "Classic timer sound" switch alongside Sounds in Settings
Tom Longfield8425314ff184
diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.jsindex 890175234..829813880 100644--- a/frontend/src/lib/pt-br-locale.test.js+++ b/frontend/src/lib/pt-br-locale.test.js@@ -41,7 +41,7 @@ describe('Brazilian Portuguese locale', () => {// has to be taught is a number nobody reads. What the numbers stood for is asserted above.// If the hash fails, review the changed keys and wording before accepting a new one. From// frontend/: node scripts/pt-br-inheritance-fingerprint.mjs --list- expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('9be6cc7996a836338e4c6d4aaa075dc40f350dad94c72ef67c0a021870720c49')+ expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('aa898433549270cc669e45d306042bd859702f9434eaa47ee9cbb125d9c881f8')})test('does not leak European Portuguese UI terms', () => {diff --git a/frontend/src/lib/sound.js b/frontend/src/lib/sound.jsindex 22ac68c63..57132c7df 100644--- a/frontend/src/lib/sound.js+++ b/frontend/src/lib/sound.js@@ -96,11 +96,21 @@ export function beep(enabled, freq, dur, when) {// ticks before it (660 Hz), a set tick (1040 Hz) nor the rising finish fanfare has.// It does not turn other apps down. A web page cannot duck another app's audio: Android only// grants audio focus to native code, and on iOS the 'playback' session pauses the music (1. above).+//+// Some people preferred the original under music — quieter is not a defect for everyone, e.g.+// headphones at the gym rather than a phone speaker next to a stereo. Settings → "Classic timer+// sound" (S.classicChime) picks between the two without reviving the three separate beep() calls+// this replaced: CLASSIC is the exact same three tones, just driven through the same tone() path+// as the chime below, so both share one gating/try-catch and one sleepAfter bookkeeping.export const CHIME_PEAK = 0.9const CHIME = [[1319, 0.16, 0], [988, 0.16, 0.22], [1319, 0.5, 0.44]]-export function chime(enabled) {+const CLASSIC = [[880, 0.15, 0], [880, 0.15, 0.25], [1320, 0.4, 0.5]]+export function chime(enabled, classic) {if (!enabled) return- try { CHIME.forEach(([freq, dur, when]) => tone(freq, dur, when, { peak: CHIME_PEAK, hold: 0.6, bright: true })) } catch (e) { /* */ }+ try {+ if (classic) CLASSIC.forEach(([freq, dur, when]) => tone(freq, dur, when))+ else CHIME.forEach(([freq, dur, when]) => tone(freq, dur, when, { peak: CHIME_PEAK, hold: 0.6, bright: true }))+ } catch (e) { /* */ }}// Call from inside a tap. Gets the context created and running while the browser still countsdiff --git a/frontend/src/lib/sound.test.js b/frontend/src/lib/sound.test.jsindex 047396bcd..d02403f55 100644--- a/frontend/src/lib/sound.test.js+++ b/frontend/src/lib/sound.test.js@@ -289,6 +289,41 @@ describe('the chime at the end of a rest or a hold', () => {})})+// Settings → "Classic timer sound": the exact three beeps this replaced, picked back with a+// second argument rather than reviving the old inline beep() calls at the call sites.+describe('chime(enabled, classic) — the original three beeps', () => {+ it('makes no sound with sounds off, classic or not', () => {+ sound.chime(false, true)+ expect(FakeCtx.instances).toHaveLength(0)+ })++ it('is the same three tones and timing as the original beep() calls: 880, 880, 1320 Hz', () => {+ sound.chime(true, true)+ const tones = ctx().tones+ expect(tones.map(tn => tn.freq)).toEqual([880, 880, 1320])+ expect(tones.map(tn => tn.at)).toEqual([0, 0.25, 0.5])+ })++ it('peaks at a plain beep\'s level, not the louder chime\'s', () => {+ sound.chime(true, true)+ const peakOf = events => Math.max(...events.map(([, v]) => v))+ for (const gain of ctx().gains) expect(peakOf(gain)).toBe(0.35)+ })++ it('fades from the start instead of holding its peak', () => {+ sound.chime(true, true)+ const first = ctx().gains[0]+ const held = first.find(([kind, v, at]) => kind === 'set' && v === 0.35 && at > 0.05)+ expect(held).toBeFalsy()+ })++ it('is a plain sine, not the brighter periodic wave', () => {+ sound.chime(true, true)+ expect(ctx().waves).toBe(0)+ expect(ctx().oscs.every(o => o.type === 'sine' && o.wave === null)).toBe(true)+ })+})+// Discord (asierlama): vibration on or off on its own, the way sound is.describe('vibrate switch', () => {let callsdiff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.jsindex 07697206c..8c5c0a4ca 100644--- a/frontend/src/locales/ar.js+++ b/frontend/src/locales/ar.js@@ -1289,6 +1289,8 @@ export default {'No entries yet — log your weight to start the curve.': 'لا توجد إدخالات بعد — سجّل وزنك لبدء المنحنى.','Play sounds when the phone is on silent': 'تشغيل الأصوات عندما يكون الهاتف صامتًا','Music playing on this phone stops during a workout and does not resume by itself.': 'الموسيقى التي تعمل على هذا الهاتف تتوقف أثناء التمرين ولا تستأنف من تلقاء نفسها.',+ 'Classic timer sound': 'صوت المؤقت الكلاسيكي',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': 'الصوت الأكثر هدوءًا المكوّن من ثلاث نغمات من قبل الإصدار 1.3.9، بدلاً من الرنين الأعلى صوتًا.','Add this device\'s workouts to your profile?': 'إضافة تدريبات هذا الجهاز إلى ملفك؟','{0} workouts and {1} weigh-ins were logged on this device while signed out. Add them to your profile, or keep the profile exactly as it is on the server.': 'سُجلت {0} تدريبات و{1} قياسات وزن على هذا الجهاز أثناء تسجيل الخروج. أضفها إلى ملفك، أو أبقِ الملف كما هو على الخادم.','{0} workout and {1} weigh-in were logged on this device while signed out. Add them to your profile, or keep the profile exactly as it is on the server.': 'سُجل {0} تدريب و{1} قياس وزن على هذا الجهاز أثناء تسجيل الخروج. أضفهما إلى ملفك، أو أبقِ الملف كما هو على الخادم.',diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.jsindex 663a5a5bb..d9c99004f 100644--- a/frontend/src/locales/de.js+++ b/frontend/src/locales/de.js@@ -466,6 +466,8 @@ export default {'No entries yet — log your weight to start the curve.': 'Noch keine Einträge — trag dein Gewicht ein, um die Kurve zu starten.','Play sounds when the phone is on silent': 'Töne auch bei stummgeschaltetem Telefon abspielen','Music playing on this phone stops during a workout and does not resume by itself.': 'Musik, die auf diesem Telefon läuft, stoppt während eines Trainings und setzt nicht von selbst wieder ein.',+ 'Classic timer sound': 'Klassischer Timer-Sound',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': 'Der leisere Dreifach-Piepton aus der Zeit vor 1.3.9 statt des lauteren Klingeltons.','Data': 'Daten','Export backup (JSON)': 'Backup exportieren (JSON)','Import backup': 'Backup importieren',diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.jsindex 8e1d9aa99..b8d11526b 100644--- a/frontend/src/locales/es.js+++ b/frontend/src/locales/es.js@@ -451,6 +451,8 @@ export default {'No entries yet — log your weight to start the curve.': 'Sin registros aún — apunta tu peso para empezar la curva.','Play sounds when the phone is on silent': 'Reproducir sonidos con el teléfono en silencio','Music playing on this phone stops during a workout and does not resume by itself.': 'La música que suena en este teléfono se detiene durante un entrenamiento y no se reanuda por sí sola.',+ 'Classic timer sound': 'Sonido clásico del temporizador',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': 'El sonido más suave de tres pitidos de antes de la 1.3.9, en lugar del timbre más fuerte.','Data': 'Datos','Export backup (JSON)': 'Exportar copia (JSON)','Import backup': 'Importar copia',diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.jsindex ee904194c..016eec8bc 100644--- a/frontend/src/locales/fr.js+++ b/frontend/src/locales/fr.js@@ -451,6 +451,8 @@ export default {'No entries yet — log your weight to start the curve.': 'Aucune entrée — note ton poids pour démarrer la courbe.','Play sounds when the phone is on silent': 'Jouer les sons même si le téléphone est en mode silencieux','Music playing on this phone stops during a workout and does not resume by itself.': 'La musique en cours de lecture sur ce téléphone s’arrête pendant une séance et ne reprend pas toute seule.',+ 'Classic timer sound': 'Son classique du minuteur',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': 'Le son plus discret à trois bips d’avant la 1.3.9, au lieu du carillon plus fort.','Data': 'Données','Export backup (JSON)': 'Exporter une sauvegarde (JSON)','Import backup': 'Importer une sauvegarde',diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.jsindex ccb0ca2aa..77061cd0a 100644--- a/frontend/src/locales/hi.js+++ b/frontend/src/locales/hi.js@@ -451,6 +451,8 @@ export default {'No entries yet — log your weight to start the curve.': 'अभी कोई एंट्री नहीं — ग्राफ़ शुरू करने के लिए वज़न दर्ज करें।','Play sounds when the phone is on silent': 'फ़ोन साइलेंट पर हो तब भी आवाज़ें बजाएँ','Music playing on this phone stops during a workout and does not resume by itself.': 'इस फ़ोन पर चल रहा संगीत वर्कआउट के दौरान रुक जाता है और अपने आप फिर से शुरू नहीं होता।',+ 'Classic timer sound': 'क्लासिक टाइमर ध्वनि',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': 'तेज़ चाइम के बजाय 1.3.9 से पहले वाली शांत तीन-बीप ध्वनि।','Data': 'डेटा','Export backup (JSON)': 'बैकअप निर्यात करें (JSON)','Import backup': 'बैकअप आयात करें',diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.jsindex 61b151edc..8ec5fef0d 100644--- a/frontend/src/locales/hu.js+++ b/frontend/src/locales/hu.js@@ -881,6 +881,8 @@ export default {'No entries yet — log your weight to start the curve.': 'Még nincs bejegyzés — rögzítsd a súlyodat a görbe elindításához.','Play sounds when the phone is on silent': 'Hangok lejátszása akkor is, ha a telefon némítva van','Music playing on this phone stops during a workout and does not resume by itself.': 'A telefonon szóló zene edzés közben leáll, és nem indul újra magától.',+ 'Classic timer sound': 'Klasszikus időzítő hang',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': 'Az 1.3.9 előtti halkabb, három sípolásból álló hang a hangosabb csengés helyett.','Import from Hevy': 'Importálás a Hevyből','Pull your history with a Hevy Pro API key': 'Előzmények letöltése Hevy Pro API-kulccsal','Pull your history with a Hevy Pro API key. The key is only used for this import and is not saved.': 'Előzmények letöltése Hevy Pro API-kulccsal. A kulcs csak ehhez az importhoz kell, nem mentjük el.',diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.jsindex 48e5dd34d..5b0d1902a 100644--- a/frontend/src/locales/it.js+++ b/frontend/src/locales/it.js@@ -451,6 +451,8 @@ export default {'No entries yet — log your weight to start the curve.': 'Nessun dato — registra il tuo peso per iniziare la curva.','Play sounds when the phone is on silent': 'Riproduci i suoni anche con il telefono in silenzioso','Music playing on this phone stops during a workout and does not resume by itself.': 'La musica in riproduzione su questo telefono si ferma durante un allenamento e non riprende da sola.',+ 'Classic timer sound': 'Suono classico del timer',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': 'Il suono più silenzioso a tre bip di prima della 1.3.9, invece del suono più forte.','Data': 'Dati','Export backup (JSON)': 'Esporta backup (JSON)','Import backup': 'Importa backup',diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.jsindex 02628fa0a..bf937a987 100644--- a/frontend/src/locales/ko.js+++ b/frontend/src/locales/ko.js@@ -451,6 +451,8 @@ export default {'No entries yet — log your weight to start the curve.': '아직 기록이 없어요 — 체중을 기록해 그래프를 시작하세요.','Play sounds when the phone is on silent': '무음 모드에서도 소리 재생','Music playing on this phone stops during a workout and does not resume by itself.': '운동 중에는 이 휴대폰에서 재생 중인 음악이 멈추며, 자동으로 다시 재생되지 않습니다.',+ 'Classic timer sound': '클래식 타이머 소리',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': '더 큰 차임벨 대신 1.3.9 이전의 더 조용한 세 번의 비프음을 사용합니다.','Data': '데이터','Export backup (JSON)': '백업 내보내기 (JSON)','Import backup': '백업 가져오기',diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.jsindex f5910a684..714ccc24b 100644--- a/frontend/src/locales/pl.js+++ b/frontend/src/locales/pl.js@@ -451,6 +451,8 @@ export default {'No entries yet — log your weight to start the curve.': 'Brak wpisów — zapisz wagę, aby zacząć krzywą.','Play sounds when the phone is on silent': 'Odtwarzaj dźwięki także przy wyciszonym telefonie','Music playing on this phone stops during a workout and does not resume by itself.': 'Muzyka odtwarzana na tym telefonie zatrzymuje się podczas treningu i nie wznawia się sama.',+ 'Classic timer sound': 'Klasyczny dźwięk minutnika',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': 'Cichszy dźwięk trzech sygnałów sprzed wersji 1.3.9 zamiast głośniejszego dzwonka.','Data': 'Dane','Export backup (JSON)': 'Eksportuj kopię (JSON)','Import backup': 'Importuj kopię',diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.jsindex 65dd8ff54..1bb4b67b4 100644--- a/frontend/src/locales/pt.js+++ b/frontend/src/locales/pt.js@@ -451,6 +451,8 @@ export default {'No entries yet — log your weight to start the curve.': 'Ainda sem registos — regista o teu peso para começar a curva.','Play sounds when the phone is on silent': 'Reproduzir sons com o telemóvel em silêncio','Music playing on this phone stops during a workout and does not resume by itself.': 'A música a tocar neste telemóvel para durante um treino e não retoma sozinha.',+ 'Classic timer sound': 'Som clássico do temporizador',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': 'O som mais suave de três bipes de antes da 1.3.9, em vez do som mais alto.','Data': 'Dados','Export backup (JSON)': 'Exportar cópia (JSON)','Import backup': 'Importar cópia',diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.jsindex 2df1568f7..f04fd53aa 100644--- a/frontend/src/locales/ru.js+++ b/frontend/src/locales/ru.js@@ -451,6 +451,8 @@ export default {'No entries yet — log your weight to start the curve.': 'Записей пока нет — внеси вес, чтобы начать кривую.','Play sounds when the phone is on silent': 'Воспроизводить звуки при беззвучном режиме','Music playing on this phone stops during a workout and does not resume by itself.': 'Музыка, играющая на этом телефоне, останавливается во время тренировки и сама не возобновляется.',+ 'Classic timer sound': 'Классический звук таймера',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': 'Более тихий звук из трёх сигналов, как до версии 1.3.9, вместо более громкого перезвона.','Data': 'Данные','Export backup (JSON)': 'Экспорт резервной копии (JSON)','Import backup': 'Импорт резервной копии',diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.jsindex 3604d80fa..0a3888f1f 100644--- a/frontend/src/locales/th.js+++ b/frontend/src/locales/th.js@@ -889,6 +889,8 @@ export default {'No entries yet — log your weight to start the curve.': 'ยังไม่มีข้อมูล — บันทึกน้ำหนักเพื่อเริ่มกราฟ','Play sounds when the phone is on silent': 'เล่นเสียงแม้โทรศัพท์อยู่ในโหมดเงียบ','Music playing on this phone stops during a workout and does not resume by itself.': 'เพลงที่เล่นอยู่บนโทรศัพท์นี้จะหยุดระหว่างการออกกำลังกาย และจะไม่เล่นต่อเอง',+ 'Classic timer sound': 'เสียงตัวจับเวลาแบบคลาสสิก',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': 'เสียงบี๊บสามครั้งที่เบากว่าแบบก่อนเวอร์ชัน 1.3.9 แทนเสียงกริ่งที่ดังกว่า','Import from Hevy': 'นำเข้าจาก Hevy','Pull your history with a Hevy Pro API key': 'ดึงประวัติด้วยคีย์ API ของ Hevy Pro','Pull your history with a Hevy Pro API key. The key is only used for this import and is not saved.': 'ดึงประวัติด้วยคีย์ API ของ Hevy Pro คีย์ใช้สำหรับการนำเข้าครั้งนี้เท่านั้นและจะไม่ถูกบันทึก',diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.jsindex 1c96ebc30..da80ed3a7 100644--- a/frontend/src/locales/tr.js+++ b/frontend/src/locales/tr.js@@ -451,6 +451,8 @@ export default {'No entries yet — log your weight to start the curve.': 'Henüz kayıt yok — eğriyi başlatmak için kilonu gir.','Play sounds when the phone is on silent': 'Telefon sessizdeyken de sesleri çal','Music playing on this phone stops during a workout and does not resume by itself.': 'Bu telefonda çalan müzik antrenman sırasında durur ve kendiliğinden devam etmez.',+ 'Classic timer sound': 'Klasik zamanlayıcı sesi',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': '1.3.9 öncesindeki daha sessiz üçlü bip sesi, daha yüksek çalan sesi yerine.','Data': 'Veriler','Export backup (JSON)': 'Yedeği dışa aktar (JSON)','Import backup': 'Yedeği içe aktar',diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.jsindex ba239e0c8..dfd3010df 100644--- a/frontend/src/locales/uk.js+++ b/frontend/src/locales/uk.js@@ -1156,6 +1156,8 @@ export default {"No entries yet — log your weight to start the curve.": "Записів поки немає — внеси вагу, щоб почати криву.","Play sounds when the phone is on silent": "Відтворювати звуки в беззвучному режимі","Music playing on this phone stops during a workout and does not resume by itself.": "Музика, що грає на цьому телефоні, зупиняється під час тренування і сама не відновлюється.",+ 'Classic timer sound': 'Класичний звук таймера',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': 'Тихіший звук із трьох сигналів, як до версії 1.3.9, замість гучнішого дзвону.','Deletes your plan, workouts, body weight, photos and videos from your profile on this server and on every signed-in device. This cannot be undone.': 'Видаляє план, тренування, вагу тіла, фото й відео з профілю на цьому сервері й на всіх пристроях, де виконано вхід. Скасувати неможливо.',"Sync failed: the server refused the upload as too large. Your changes have not reached the server.": "Синхронізація не вдалася: сервер відхилив завантаження як завелике. Твої зміни не дійшли до сервера.","Workout view": "Вигляд тренування",diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.jsindex 84237894a..ef62993a8 100644--- a/frontend/src/locales/zh.js+++ b/frontend/src/locales/zh.js@@ -451,6 +451,8 @@ export default {'No entries yet — log your weight to start the curve.': '还没有记录——记录体重以开始曲线。','Play sounds when the phone is on silent': '手机静音时也播放提示音','Music playing on this phone stops during a workout and does not resume by itself.': '锻炼期间,这部手机正在播放的音乐会停止,且不会自动恢复。',+ 'Classic timer sound': '经典计时提示音',+ 'The quieter three-beep sound from before 1.3.9, instead of the louder chime.': '使用 1.3.9 版本之前更轻柔的三声提示音,而不是更响亮的铃声。','Data': '数据','Export backup (JSON)': '导出备份(JSON)','Import backup': '导入备份',diff --git a/frontend/src/store/useUI.js b/frontend/src/store/useUI.jsindex 74f803eb4..0b9c889a4 100644--- a/frontend/src/store/useUI.js+++ b/frontend/src/store/useUI.js@@ -93,12 +93,12 @@ const runRest = (set, get) => {const seenLive = !document.hidden && pageHiddenAt === nullif (!document.hidden) pageHiddenAt = nullif (left === tm.left) return- const snd = useStore.getState().S.sound+ const { sound: snd, classicChime } = useStore.getState().Sif (left <= 0) {if (seenLive) {// The Android alarm for this end stays quiet while the app is on screen, so this chime is// the only one. Locked, this branch never runs and the alarm's tone does.- chime(snd)+ chime(snd, classicChime)vibrate([200, 100, 200]); get().flashTimer()}// The toast stays even when the rest ran out while the app was hidden: a guest, or anyone@@ -276,10 +276,10 @@ export const useUI = create((set, get) => ({const seenLive = !document.hidden && pageHiddenAt === nullif (!document.hidden) pageHiddenAt = nullif (left === wk.left) return- const snd = useStore.getState().S.sound+ const { sound: snd, classicChime } = useStore.getState().Sif (left <= 0) {if (seenLive && !wk.alerted) {- chime(snd)+ chime(snd, classicChime)vibrate([200, 100, 200]); get().flashTimer()}if (wk.overtime && left > -MAX_WORK_OVERTIME_SEC) { set({ work: { ...wk, left, alerted: true } }); return }diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsxindex d04cc7246..8dad02dca 100644--- a/frontend/src/views/Settings.jsx+++ b/frontend/src/views/Settings.jsx@@ -476,6 +476,16 @@ export default function Settings() {<Switch checked={!!S.soundOnSilent} onChange={v => update(s => { s.soundOnSilent = v })} /></Row>)}+ {/* The chime that replaced the original three beeps (Discord: "too quiet under music") is+ not an improvement for everyone — louder is a cost with headphones or in a quiet room.+ Off by default so a fresh profile keeps the current sound; on brings the original back+ unchanged (lib/sound.js's CLASSIC). */}+ {S.sound && (+ <Row icon="bell" iconTint="var(--teal)" title={t('Classic timer sound')}+ subtitle={t('The quieter three-beep sound from before 1.3.9, instead of the louder chime.')}>+ <Switch checked={!!S.classicChime} onChange={v => update(s => { s.classicChime = v })} />+ </Row>+ )}{/* The buzz at the end of a rest or a hold and on a set tick, on its own switch like thesound (Discord, asierlama). Not offered where there is nothing to buzz: iOS has nonavigator.vibrate. */}