wger
wger copied to clipboard
Timer for Timed Exercises
Proposed Changes
- Added unit_type field to RepetitionUnit model to distinguish TIME, REPETITIONS, and DISTANCE units
- Created "Add Timed Exercise" form (Training > Add Timed Exercise) allowing users to add time-based exercises to routines
- Implemented countdown timer that appears as a stopwatch button next to exercises with time units (Seconds/Minutes) on routine view pages
- Timer modal includes circular progress display, start/pause/reset controls, and audio completion alert
How it works
- Navigate to Training > Add Timed Exercise
- Select a routine, exercise (e.g., Plank), duration, and unit (Seconds/Minutes)
- View the routine - a stopwatch icon appears next to the timed exercise
- Click the icon to open the countdown timer
- Use start/pause/reset controls; audio plays on completion
Related Issue(s)
See also #2008
User commands due to this PR
- Users need to run database migrations
- This applies the migration that adds the unit_type field to RepetitionUnit and sets existing units to their appropriate types (Seconds/Minutes → TIME, Miles/Km → DISTANCE, Reps/Till Failure → REPETITIONS).