StudentMargaretP
CategoryBasic Function
Prompt TitleAdd workout logging flow
Prompt

Prompt 1: Add a "Start Workout" button to the plan detail page. On click, create a row in workout_sessions with user_id, plan_id, started_at = now(), status = 'in_progress', then navigate to a new (currently blank) active-session screen showing the plan name and a running elapsed-time counter based on started_at.

Prompt 2: On the active-session screen, list the exercises from the plan (via plan_exercises) in order, pre-filled with target sets/reps/weight/duration/distance as placeholders. For each set, let the user confirm or adjust actual values and save it as a row in session_exercise_logs. Use steppers (+/- buttons) for reps/weight instead of requiring the keyboard. Save each set immediately on entry, not in a batch at the end.

Prompt 3: Support starting a session with no plan (plan_id = NULL). On the active-session screen for these sessions, let users search the exercise library (reuse the existing search/filter UI) and add exercises to the session, then log sets using the same set-logging UI from Step 2.

Prompt 4: Add a "Finish Workout" button that opens a summary screen where the user enters: date (defaulted from started_at, editable), heart rate avg/max (optional), calories (optional), steps (optional), and notes (optional, free text). On save, update the session: ended_at = now(), status = 'completed', and store the entered fields.

Prompt 5: On app load, check if the logged-in user has a session with status = 'in_progress'. If found, prompt them to resume (return to the active-session screen with previously logged sets intact) or discard (status = 'abandoned', ended_at = now()).

Prompt 6: Add a "Log a past workout" flow: same summary form as Step 4, but started_at/ended_at are both manually entered, and all exercise sets are entered at once (not live) via a simpler form.

ProgressStarted