fix(#656): Set Summary (unlimited) + Next Set now advances per tap, not silently skipping to End Routine#657
Conversation
…ary autoplay OFF When Set Summary is 'unlimited', proceedFromSummary()'s autoplay OFF branch advances currentSetIndex and calls enterSetReady() but never transitions workoutState out of SetSummary. ActiveWorkoutScreen keeps isWorkoutActive=true (SetSummary is in the active set), so its nav gate that routes RoutineFlowState.SetReady -> SetReady screen never fires. Every Next Set tap silently advances the index; after N taps the routine-complete branch fires and shows End Routine. Mirror the routine-complete branch pattern (line 892): set workoutState = Idle before enterSetReady so the nav gate unmounts and navigates to SetReady. Adds Issue656ReproTest (AndroidHostTest) asserting workoutState leaves SetSummary after the first tap and that the last-set tap drives RoutineFlowState.Complete (End Routine).
There was a problem hiding this comment.
Code Review
This pull request addresses Issue #656 by resetting the workout state to Idle when transitioning to the SetReady screen, which ensures the UI correctly unmounts the set summary. It also adds a reproduction test suite (Issue656ReproTest.kt) to verify this behavior. The review feedback suggests reversing the order of state updates in DefaultWorkoutSessionManager.kt to prevent potential UI race conditions, and replacing reflection-based class name assertions in the tests with type-safe is checks to avoid issues with Kotlin Multiplatform and obfuscation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Code Review Roast 🔥Verdict: No Issues Found | Recommendation: Merge Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything, and the diff turns out to be a one-line state-machine fix that mirrors a pattern already living ten lines above it. Whoever traced this bug to the missing 📊 Overall: Like a 3-bullet PR description that actually matches the diff. Rare breed. Correctness / Safety FindingsNo correctness or safety findings. The fix mirrors line 892 verbatim (routine-complete branch) and is consistent with the autoplay ON branch (line 989). Both regression tests assert behavior, not implementation details. Ponytail Review
Ponytail net: -22 lines (dedupe), up to -97 lines if the symptom-replication test goes. Suggested Minimal PatchNo patch needed for correctness. Optional cleanup: extract the duplicated routine fixture into a private helper. Final Merge GuidanceCan merge as-is. Ponytail suggestions are optional cleanup and do not block the fix. Files Reviewed (2 files)
Fix these issues in Kilo Cloud Reviewed by minimax-m3 · Input: 45.2K · Output: 5.5K · Cached: 356.4K |
Fixes #656
Bug
With Set Summary configured to "unlimited" (autoplay OFF) and per-set rest times that differ, tapping "Next Set" on the Set Summary screen did not advance to the next set. Each tap silently advanced the set index; after N taps (N = total sets), the Summary page changed to "End Routine" and exited the exercise, skipping every middle set's SetReady transition.
Root cause
DefaultWorkoutSessionManager.proceedFromSummary()autoplay OFF branch (line 903-) advanced_currentSetIndex/_currentExerciseIndexand calledenterSetReady()(which setsroutineFlowState = SetReady) but never transitionedworkoutStateout ofSetSummary. The companion routine-complete branch (line 892) and the autoplay ON branch (line 977 + rest timer) both transitionworkoutState; the autoplay OFF branch was the only one missing the transition.ActiveWorkoutScreen.kt(lines 295-306) gates navigation to the SetReady screen on!isWorkoutActive, andisWorkoutActiveincludesWorkoutState.SetSummary. WithworkoutStatestuck in SetSummary, the gate never fires and the screen stays mounted on SetSummary while the index advances underneath. After N taps,getNextStep()returns null and the routine-complete branch fires, displaying "End Routine".Fix
Add
coordinator._workoutState.value = WorkoutState.Idleimmediately beforeenterSetReady(nextExIdx, nextSetIdx)in the autoplay OFF branch. This mirrors the routine-complete branch pattern (line 892) and makesisWorkoutActive = falseso the nav gate unmounts SetSummary and routes to SetReady.One-line state-machine fix. No UI changes, no autoplay ON behavior changes.
Tests
Issue656ReproTestinshared/src/commonTest(AndroidHostTest):proceedFromSummary_unlimitedSummaryDoesNotNavigateOutOfSetSummary— asserts that after the first "Next Set" tap,routineFlowStateis SetReady ANDworkoutStatehas left SetSummary (the bug fingerprint).proceedFromSummary_unlimitedSecondTapAdvancesFurtherAndEventuallyCompletes— asserts the last-set tap drivesroutineFlowState.Complete(End Routine), matching the reporter's symptom.presentation.manager.*AndroidHostTests still pass (180+ tests, 0 failures).Acceptance criteria (from RCA)