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
Live Activity, watch and widgets: exercise names title-cased like the app, not lower-case (Discord)
Duarte Santos1076b9f8badf
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 03f73b30d..5642fe043 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -92,6 +92,8 @@ you leave it alone. Handy for deciding whether those legs are really ready (than- Add exercise → By muscle has the Favourites chip too, for the muscle you picked (#669).- A treadmill's incline can be set in its settings in the routine, not only mid-workout. Thesession opens at it unless last time had a grade of its own, and it travels in shared plans.+- Exercise names on the Lock Screen, in the Dynamic Island, on the Apple Watch and in the widgets+ are title-cased like in the app, instead of whispering "barbell bench press".- A weight change too small to show (say 0.03 kg) reads 0 instead of a lonely "-0".- Admin → AI Coach: the Remove button for the stored key is red now, like every other buttonthat deletes something for good.diff --git a/frontend/src/lib/live-activity.js b/frontend/src/lib/live-activity.jsindex 0ddc8d8b2..c115e5fca 100644--- a/frontend/src/lib/live-activity.js+++ b/frontend/src/lib/live-activity.js@@ -18,7 +18,8 @@// Text only: no exercise animations or pictures (Gym visual licence). iPhone app only.import { MOBILE, nativePlatform } from './mobile.js'import { EXIDX } from './exercises.js'-import { exerciseNameFor, t } from './i18n.js'+import { t } from './i18n.js'+import { exerciseNameText } from './format.js'import { setLabel, supersetUnits } from './history.js'import { isWarmupRow } from './workout-model.js'import { restSecFor } from './supersetFlow.js'@@ -74,7 +75,9 @@ function setView (S, A, { entryIdx, setIdx, restAfter }) {exId: String(e.id),entryIdx,setIdx,- exName: EXIDX[e.id] ? exerciseNameFor(EXIDX[e.id]) : String(target.name || e.name || e.id),+ // Cased as the workout screen shows it: the stored names are lower-case and only CSS title-cases+ // them in the app, which the Lock Screen never sees (Discord).+ exName: EXIDX[e.id] ? exerciseNameText(EXIDX[e.id]) : String(target.name || e.name || e.id),setLine: warmup ? t('Warm-up') + ' ' + n : t('Set {0} of {1}', n, work.length),target: label,restAfter: Math.max(0, Math.round(restAfter || 0)),diff --git a/frontend/src/lib/live-activity.test.js b/frontend/src/lib/live-activity.test.jsindex db870f0f1..fac40b6f1 100644--- a/frontend/src/lib/live-activity.test.js+++ b/frontend/src/lib/live-activity.test.js@@ -41,6 +41,9 @@ describe('buildLiveActivity', () => {expect(live.state.cur.target).toMatch(/62[.,]5/)expect(live.state.ahead.map(x => [x.entryIdx, x.setIdx])).toEqual([[0, 2], [1, 0]])expect(live.state.ahead[1].exName).toBe('Cable thing')+ // Title-cased the way the workout screen shows it (CSS capitalize there), not the stored+ // lower-case name (Discord: lower-case on the Lock Screen).+ expect(live.state.cur.exName).toBe('Barbell Bench Press')expect(live.state).toMatchObject({ done: 1, total: 4, restEndsAt: null, restLeft: null })})it('carries the rest: its end while it runs, what is left while paused, nothing once over', () => {diff --git a/frontend/src/lib/watch-sync.js b/frontend/src/lib/watch-sync.jsindex cb0a48b5d..7998677b9 100644--- a/frontend/src/lib/watch-sync.js+++ b/frontend/src/lib/watch-sync.js@@ -18,14 +18,14 @@ import { MOBILE, nativePlatform } from './mobile.js'import { EXIDX, gifSrc, figureOf, isAssisted } from './exercises.js'import { packId, packDrawingId } from './anim-quality.js'import { getState as animPacks } from './anim-packs.js'-import { exerciseNameFor, getLang, baseLang, onLangChange } from './i18n.js'+import { getLang, baseLang, onLangChange } from './i18n.js'import { modeOf, setLabel, lastEntryFor, effectiveRoutineIds, isBw, isPerSide } from './history.js'import { isWarmupRow, isSideSet, syncSideAggregate } from './workout-model.js'import { bestSetFor } from './exercise-history.js'import { weightIncrement } from './progression.js'import { sessionHistory } from './backfill.js'import { buildCombinedEntries, deriveSessionName } from './session-merge.js'-import { todayISO } from './format.js'+import { todayISO, exerciseNameText } from './format.js'import { sanitizeHr } from './heart-rate.js'import { readWatchPrefs, settingsForWatch, writeWatchStatus, onWatchPrefs } from './watch-settings.js'@@ -91,7 +91,8 @@ function watchEntry (e, H, S) {const best = S ? bestFor(S, e.id, mode) : nullreturn {id: e.id,- name: ex ? exerciseNameFor(ex) : String(target.name || e.name || e.id),+ // Title-cased as on the phone; the watch has no CSS to do it (lib/format.js exerciseNameText).+ name: ex ? exerciseNameText(ex) : String(target.name || e.name || e.id),mode,restSec: num(target.restSec),last,diff --git a/frontend/src/lib/watch-sync.test.js b/frontend/src/lib/watch-sync.test.jsindex bfe469884..3b7ac8fe0 100644--- a/frontend/src/lib/watch-sync.test.js+++ b/frontend/src/lib/watch-sync.test.js@@ -28,8 +28,8 @@ describe('the snapshot', () => {expect(snap.active.entries).toHaveLength(2)const [a, b] = snap.active.entriesexpect(a).toMatchObject({ id: '0025', mode: 'reps', restSec: null, last: null })- expect(typeof a.name).toBe('string')- expect(a.name.length).toBeGreaterThan(0)+ // Title-cased like the phone shows it, not the stored lower-case name.+ expect(a.name).toBe('Barbell Bench Press')expect(a.sets).toEqual([{ w: 60, r: 8, sec: null, done: true, warmup: false }, { w: 60, r: 8, sec: null, done: false, warmup: false }])expect(b.restSec).toBe(120)expect(b.sets[0].warmup).toBe(true)diff --git a/frontend/src/lib/widgets.js b/frontend/src/lib/widgets.jsindex 9f4b367a6..0adc65439 100644--- a/frontend/src/lib/widgets.js+++ b/frontend/src/lib/widgets.js@@ -11,11 +11,11 @@// iPhone app only. Nothing here runs on the web or on Android.import { MOBILE, nativePlatform } from './mobile.js'import { EXIDX } from './exercises.js'-import { exerciseNameFor, t, dateLocale } from './i18n.js'+import { t, dateLocale } from './i18n.js'import { effectiveRoutines, streakWeeks, exLine, bestWeightForEntry } from './history.js'import { deriveSessionName } from './session-merge.js'import { queueOf, weekTally } from './queue.js'-import { todayISO, isoOf, fmtNum, weekStartOf, startOfWeek } from './format.js'+import { todayISO, isoOf, fmtNum, weekStartOf, startOfWeek, exerciseNameText } from './format.js'import { accentPair, accentValue } from './accent.js'import { speedUnitOf } from './speed.js'@@ -26,7 +26,8 @@ export const WIDGET_DAYS = 8export const WIDGET_EXERCISES_MAX = 8const WRITE_DEBOUNCE_MS = 1000-const nameOfCfg = cfg => (EXIDX[cfg?.id] ? exerciseNameFor(EXIDX[cfg.id]) : String(cfg?.name || cfg?.n || cfg?.id || ''))+// Title-cased as the app shows it; a widget has no CSS to do it (lib/format.js exerciseNameText).+const nameOfCfg = cfg => (EXIDX[cfg?.id] ? exerciseNameText(EXIDX[cfg.id]) : String(cfg?.name || cfg?.n || cfg?.id || ''))const routineIdsOf = w => (Array.isArray(w?.routineIds) ? w.routineIds : w?.routineId ? [w.routineId] : [])const shift = (iso, days) => { const d = new Date(iso + 'T12:00:00'); d.setDate(d.getDate() + days); return isoOf(d) }@@ -67,7 +68,7 @@ function lastPrOf (S) {const w = ws.reduce((a, b) => ((b.d || '') > (a.d || '') || ((b.d || '') === (a.d || '') && (b.end || 0) > (a.end || 0)) ? b : a))const id = w.prs[0]const entry = (w.entries || []).find(e => e && e.id === id)- const name = EXIDX[id] ? exerciseNameFor(EXIDX[id]) : String(entry?.target?.name || entry?.name || id)+ const name = EXIDX[id] ? exerciseNameText(EXIDX[id]) : String(entry?.target?.name || entry?.name || id)let best = 0try { best = entry ? bestWeightForEntry(entry) : 0 } catch { best = 0 }const unit = S.unit === 'lb' ? 'lb' : 'kg'diff --git a/frontend/src/lib/widgets.test.js b/frontend/src/lib/widgets.test.jsindex e59279a54..78e8c09e2 100644--- a/frontend/src/lib/widgets.test.js+++ b/frontend/src/lib/widgets.test.js@@ -29,6 +29,8 @@ describe('buildWidgetSnapshot', () => {expect(today.exercises).toHaveLength(2)expect(today.exercises[0].line).toMatch(/3 × 8 · 60 kg/)expect(today.exercises[1].name).toBe('Cable thing')+ // Title-cased like the app shows it, not the stored lower-case name.+ expect(today.exercises[0].name).toBe('Barbell Bench Press')expect(typeof today.weekday).toBe('string')// A rest day is a day without a name; other days carry no exercise list.expect(thu).toMatchObject({ name: null, count: 0 })