feat: suppress connection alerts for bodyweight-only workouts (#693) - #694
Merged
9thLevelSoftware merged 1 commit intoAug 6, 2026
Merged
Conversation
Modify isWorkoutActiveForConnectionAlert in DefaultWorkoutSessionManager to return false when all exercises in the loaded routine are bodyweight. This prevents the ConnectionLostDialog and BLE auto-reconnect from interrupting bodyweight-only workouts (e.g. pull-up EMOM sessions) when the Vitruvian trainer auto-powers-off after 15 minutes. - Single chokepoint: DefaultWorkoutSessionManager.isWorkoutActiveForConnectionAlert - Null-safe: falls back to full monitoring when routine is not loaded - BleConnectionManager call sites naturally affected (no changes needed) - Unit test: BleConnectionManagerTest bodyweight disconnect scenario - Integration test: MainViewModelTest bodyweight routine disconnect Closes #693
| get() = when (coordinator._workoutState.value) { | ||
| is WorkoutState.Active, is WorkoutState.Countdown, is WorkoutState.Resting -> true | ||
| else -> false | ||
| get() { |
Contributor
There was a problem hiding this comment.
🔥 The Roast: The original isWorkoutActiveForConnectionAlert was a tidy 5-line when expression. This PR turned it into a 22-line novella with an early-return if, two stacked comments, and a when-shaped scar at the bottom. It works — but so does wearing a tuxedo to the gym.
🩹 The Fix: Collapse the state check into a single boolean and let the body be one expression. Roughly:
override val isWorkoutActiveForConnectionAlert: Boolean
get() {
val active = coordinator._workoutState.value.let {
it is WorkoutState.Active || it is WorkoutState.Countdown || it is WorkoutState.Resting
}
if (!active) return false
// Issue #693: trainer not needed for bodyweight-only routines.
val routine = coordinator._loadedRoutine.value
return routine == null ||
routine.exercises.isEmpty() ||
!routine.exercises.all { it.exercise.isBodyweight }
}📏 Severity: suggestion
9thLevelSoftware
deleted the
feat/693-bodyweight-connection-alert-suppression
branch
August 6, 2026 15:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Suppresses the
ConnectionLostDialogand BLE auto-reconnect when the loaded workout routine contains only bodyweight exercises. This prevents spurious interruptions during bodyweight-only sessions (e.g. pull-up EMOM workouts) when the Vitruvian trainer auto-powers-off after 15 minutes of inactivity.Fixes #693
Changes
Single chokepoint:
DefaultWorkoutSessionManager.isWorkoutActiveForConnectionAlertDefaultWorkoutSessionManager.ktisWorkoutActiveForConnectionAlertto returnfalsewhen all routine exercises are bodyweightBleConnectionManagerTest.ktFakeWorkoutStateProviderwithallBodyweightflag; added bodyweight disconnect testMainViewModelTest.kt~91 LOC across 3 files. No UI/schema/API/interface changes.
Behavior Matrix
Test Results
BleConnectionManagerTest— all tests pass (including new bodyweight test)MainViewModelTest— all tests pass (including new bodyweight integration test)shared:testAndroidHostTest— regression suite greenRelease Note
Enhancement: Suppress connection alerts during bodyweight-only workouts
The Phoenix app no longer shows a "Connection Lost" notification or attempts to auto-reconnect when the Vitruvian trainer disconnects during a bodyweight-only workout. Connection monitoring remains fully active for routines that include any cable-based exercise, Just Lift mode, and single cable exercises.