Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 13, 2025

This PR adds rounds functionality to HIIT workouts and updates the type system to support numeric duration/distance values as requested. HIIT workouts can now specify the number of rounds in addition to duration or distance, providing better clarity for interval-based exercises.

Changes Made

Type System Updates:

  • Updated CardioWorkout interface in types.ts to support:
    • duration?: number (seconds for HIIT, minutes for LISS)
    • distance?: number (meters for HIIT, kilometers for LISS)
    • rounds?: number field for interval tracking

Training Templates Updated:
Updated all HIIT workout definitions in blockTemplates.ts to use numeric values:

  • Reset-20: Now uses duration: 20 (seconds) and duration: 15 (seconds) with rounds
  • Hill Sprints: Uses rounds only (3, 5, 7 rounds)
  • GC 9: Uses distance: 100 (meters) with 10 rounds
  • 600m Resets: Uses distance: 600 (meters) with 6 rounds
  • Tempo Run: Uses distance: 5000 (meters for continuous runs)

UI Enhancement:

  • Updated CardioWorkouts.svelte to display duration/distance with proper units
  • HIIT workouts show seconds/meters, LISS workouts show minutes/kilometers
  • Rounds appear below duration/distance when present
  • Preserved existing LISS timer functionality

Examples

Before:

{ type: "hiit", activity: "Reset-20", duration: "20 sec" }
{ type: "hiit", activity: "Hill Sprints", duration: "3 sprints" }

After:

{ type: "hiit", activity: "Reset-20", duration: 20, rounds: 5 }
{ type: "hiit", activity: "GC 9", distance: 100, rounds: 10 }
{ type: "hiit", activity: "Hill Sprints", rounds: 7 }

The UI now clearly shows duration/distance with appropriate units and rounds information for better workout guidance.

HIIT Workout with Duration and Rounds

Makes progress on #42.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link

cloudflare-workers-and-pages bot commented Sep 13, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
unbroken fc15a43 Commit Preview URL

Branch Preview URL
Sep 13 2025, 03:11 PM

Co-authored-by: Bruno-366 <81762173+Bruno-366@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] For HIIT workouts: Add rounds functionality Add rounds functionality to HIIT workouts Sep 13, 2025
@Copilot Copilot AI requested a review from Bruno-366 September 13, 2025 14:24
Copilot finished work on behalf of Bruno-366 September 13, 2025 14:24
@Bruno-366
Copy link
Owner

@copilot can you update the types for hiit workouts to allow for either "duration" or "distance" and update src/blockTemplates.ts accordingly? "duration" or "distance" should be numbers not strings. for hiit workouts "duration" is in seconds and "distance" is in meters (for liss workouts i guess it would be minutes and kilometers respectively)

- Modified CardioWorkout interface to support optional duration and distance as numbers
- For HIIT workouts: duration in seconds, distance in meters
- For LISS workouts: duration in minutes, distance in kilometers
- Updated all HIIT workouts in blockTemplates.ts to use numeric values:
  - Reset-20: duration: 20/15 (seconds) with rounds
  - Hill Sprints: rounds only (no duration/distance)
  - GC 9: distance: 100 (meters) with rounds
  - 600m Resets: distance: 600 (meters) with rounds
  - Tempo Run: distance: 5000 (meters)
- Updated CardioWorkouts.svelte to display proper units based on workout type
- Preserved existing LISS timer functionality

Co-authored-by: Bruno-366 <81762173+Bruno-366@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 13, 2025

@copilot can you update the types for hiit workouts to allow for either "duration" or "distance" and update src/blockTemplates.ts accordingly? "duration" or "distance" should be numbers not strings. f...

I've updated the types and blockTemplates as requested! The changes include:

Type System:

  • CardioWorkout now supports duration?: number and distance?: number
  • For HIIT: duration in seconds, distance in meters
  • For LISS: duration in minutes, distance in kilometers

All HIIT workouts updated:

  • Reset-20: duration: 20 (seconds) with rounds
  • GC 9: distance: 100 (meters) with rounds
  • Hill Sprints: rounds only
  • Tempo Run: distance: 5000 (meters)
  • 600m Resets: distance: 600 (meters) with rounds

The UI now displays proper units (seconds/meters for HIIT, minutes/km for LISS) and all existing functionality is preserved.

HIIT Workout Display

Commit: fc15a43

@Copilot Copilot AI changed the title Add rounds functionality to HIIT workouts Add rounds functionality and numeric duration/distance support to HIIT workouts Sep 13, 2025
Copilot finished work on behalf of Bruno-366 September 13, 2025 15:07
@Bruno-366 Bruno-366 marked this pull request as ready for review September 13, 2025 15:48
@Bruno-366 Bruno-366 changed the title Add rounds functionality and numeric duration/distance support to HIIT workouts Add rounds and numeric duration/distance to HIIT workouts in blockTemplates.ts Sep 13, 2025
@Bruno-366 Bruno-366 merged commit 642b66e into main Sep 13, 2025
6 checks passed
@Bruno-366 Bruno-366 deleted the copilot/fix-42 branch September 13, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants