Refactor /workout route to support URL parameters for easier testing #52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements URL parameter support for the
/workoutroute to simplify testing without needing to modify IndexedDB directly.Problem
Previously, testing different workout types (HIIT, LISS, strength, etc.) required manually modifying IndexedDB data through browser DevTools, which was cumbersome and time-consuming. The existing TESTING.md documentation outlined a complex process involving:
Solution
The
/workoutroute now accepts URL query parameters that override the stored workout state:block- The block type (e.g.,endurance1,powerbuilding3)week- The week number (1-based)day- The day number (1-based, 1-7 for each week)Examples
Test LISS workout:
Shows: LISS run for 60 minutes
Test HIIT workout:
Shows: Reset-20 HIIT with 20 seconds, 5 rounds
Test strength workout:
Shows: Bench Press and Squat strength workout
Implementation Details
Benefits
Documentation
Updated
TESTING.mdwith comprehensive URL parameter examples and moved it to the recommended testing method, while preserving the IndexedDB approach as an alternative for advanced scenarios.Above: Default behavior showing Week 1, Day 1 - Get Ready (Rest Day) from IndexedDB
The URL parameter approach allows instant testing of any workout type without database modifications. For example,
?block=powerbuilding3&week=1&day=3immediately loads a HIIT workout with Reset-20 activity, 20-second intervals, and 5 rounds.Fixes #49.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
workers.cloudflare.comnode /home/REDACTED/work/Unbroken/Unbroken/node_modules/.bin/vite build(dns block)node /home/REDACTED/work/Unbroken/Unbroken/node_modules/.bin/vite dev(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.