Skip to content

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.

Focus mode: the exercise menu's heading is title-cased like in Cards (Discord)

Duarte Santosab2de81c39aa
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9d42c104f..263b7fa53 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -93,7 +93,8 @@ you leave it alone. Handy for deciding whether those legs are really ready (than
- A treadmill's incline can be set in its settings in the routine, not only mid-workout. The
session 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".
+ are title-cased like in the app (Focus mode's exercise menu too), instead of whispering
+ "barbell bench press".
- Focus mode: the exercise's ⋯ menu has Add set and Add warm-up set, so one more set no longer
means a trip to the Cards layout.
- A weight change too small to show (say 0.03 kg) reads 0 instead of a lonely "-0".
diff --git a/frontend/src/views/FocusView.jsx b/frontend/src/views/FocusView.jsx
index c1c4eb071..f8bcc2716 100644
--- a/frontend/src/views/FocusView.jsx
+++ b/frontend/src/views/FocusView.jsx
@@ -2,7 +2,7 @@ import { useState } from 'react'
import { useStore } from '../store/useStore.js'
import { exOr } from '../lib/exercises.js'
import { clampIncline, hasIncline, inclineFits, INCLINE_MAX, INCLINE_STEP } from '../lib/incline.js'
-import { exerciseNameFor, t } from '../lib/i18n.js'
+import { exerciseNameClass, exerciseNameFor, t } from '../lib/i18n.js'
import { fmtDate, fmtNum, fmtPlate } from '../lib/format.js'
import { EFFORT, effortOf, modeOf } from '../lib/history.js'
import { lastEntryFor, pinnedNoteFor, setsRepsOf } from '../lib/history.js'
@@ -225,6 +225,8 @@ export default function FocusView({
const addRow = add => () => { add(); clearPointer(entryIdx) }
const openExerciseMenu = () => menuSheet({
title: exerciseNameFor(exOr(entry.id)),
+ // Title-cased like the card's own heading and the Cards layout's menu, not the stored lower case.
+ titleClass: exerciseNameClass(exOr(entry.id)),
items: [
{ icon: 'plus', label: t('Add set'), onClick: addRow(onAddSet) },
{ icon: 'sunrise', label: t('Add warm-up set'), onClick: addRow(onAddWarmup) },
diff --git a/frontend/src/views/FocusView.test.jsx b/frontend/src/views/FocusView.test.jsx
index d8180c3b7..5873237dd 100644
--- a/frontend/src/views/FocusView.test.jsx
+++ b/frontend/src/views/FocusView.test.jsx
@@ -125,6 +125,11 @@ describe('Focus workout view', () => {
expect(sets().filter(row => row.phase === 'warmup' || row.warmup)).toHaveLength(1)
})
+ it('title-cases the exercise menu\'s heading like the Cards layout does', () => {
+ mount({ id: SQUAT, target: { sets: 1, reps: 5, weight: 95 }, sets: [{ w: 95, r: 5, done: false }] })
+ expect(openMenu().querySelector('h3').className).toBe('capitalize')
+ })
+
it('uses the exercise rest-pause duration for a new burst', () => {
mount({
id: SQUAT,