Skip to content

Replace BuildWorkout with ChooseWorkout, enforce single workout#62

Open
Tyler-Lopez wants to merge 2 commits into
mainfrom
choose-workout-refactor
Open

Replace BuildWorkout with ChooseWorkout, enforce single workout#62
Tyler-Lopez wants to merge 2 commits into
mainfrom
choose-workout-refactor

Conversation

@Tyler-Lopez
Copy link
Copy Markdown
Owner

@Tyler-Lopez Tyler-Lopez commented May 11, 2026

Summary

When we started work on the app, we weren't totally sure what we wanted to do with the data models.

Something we did, that we later regretted, was building the app around the idea of multiple Workouts. Instead of this, we should just have a single Workout.

This commit sets the application up for this new future, by eliminating multiple workouts.

Future Work

I plan to make the ChooseWorkout screen to allow you to choose from the Workouts saved in the database. When a Workout is created, it will be added to the database automatically and automatically selected.

Right now ChooseWorkout is a little messy. The future commit will make a lot more sense.

Tyler-Lopez and others added 2 commits May 10, 2026 20:41
- Rename buildWorkouts package to chooseWorkout; ChooseWorkoutScreen
  shows a single selected workout (or empty state) rather than a list
- ChooseWorkoutViewModel holds Workout? instead of List<Workout>;
  removes add/delete list logic
- Rename AddWorkoutDestination → CreateWorkoutDestination to match the
  already-named CreateWorkoutScreen composable
- PlayWorkoutVIewModel now accepts a single Workout, dropping the unused
  currentWorkoutIndex / multi-workout traversal path
- Route.PlayWorkout takes Workout instead of List<Workout>
- Home destination, event, and ViewModel updated to NavigateToChooseWorkout
- String resources renamed from build_workouts_* to choose_workout_*
  in both EN and ES locales

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename addWorkoutScreen package to createWorkoutScreen
- AddWorkoutViewModel → CreateWorkoutViewModel
- AddWorkoutViewEvent → CreateWorkoutViewEvent
- AddWorkoutPage → CreateWorkoutPage
- AddWorkoutViewModelFactory → CreateWorkoutViewModelFactory
- String resource keys add_workout_* → create_workout_* in EN and ES

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>


@Composable
fun ChooseWorkoutScreen(viewModel: ChooseWorkoutViewModel) {
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything to do with BuildWorkout has been changed to ChooseWorkout I thought this made a lot more sense. The code is all the same, though.

class PlayWorkoutVIewModel(
private val router: Router<PlayWorkoutDestination>,
private val workouts: List<Workout>,
private val workout: Workout,
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PlayWorkout changed to only take a single Workout.

@Tyler-Lopez Tyler-Lopez requested a review from Maria1-eng May 11, 2026 03:53
@Tyler-Lopez Tyler-Lopez marked this pull request as ready for review May 11, 2026 03:53
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