Align Watch EMOM reps with iPhone (1-based currentInterval) - #59
Merged
Conversation
The Watch "REPS" metric showed `completedIntervals` (0-based) while the iPhone shows `currentInterval` (1-based, the interval currently in progress). Both views read the same shared EMOMTimerModel, computed independently from the same time anchor — so the gap was purely a display offset: the Watch read one behind the iPhone for the whole workout (0/N at start vs 1/N). Render `currentInterval` on the Watch so both devices match in lockstep (1/N → N/N; the model already caps at totalIntervals, so no over-count). Also bump MARKETING_VERSION to 1.5.3 on the iOS and Watch app targets. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
For an EMOM workout, the Watch's REPS metric read one behind the iPhone for the entire workout —
0/Nat the start while the iPhone showed1/N.This was not a connectivity/sync bug. Both devices run the same shared
EMOMTimerModeland compute the rep count independently from the same time anchor (EMOM sends no rep-count messages — unlike AMRAP's.incrementRound). The gap was a pure display offset: the two views rendered different properties of the same model.EMOMTimerView.swift:127/:435rendercurrentInterval=min(completedIntervals + 1, totalIntervals)(1-based, "interval currently in progress").WatchEMOMTimerView.swift:226renderedcompletedIntervals(0-based, "reps finished").Change
Render
currentIntervalon the Watch so it matches the iPhone's 1-based display:currentInterval(EMOMTimerModel.swift:68) already caps attotalIntervals, so completion still readsN/N(no over-count). No model change — it's the existing, tested source of truth (EMOMTimerModelTests.currentInterval_startsAtOne). The iPhone already usescurrentIntervalacross all its REPS surfaces, so the Watch was the lone outlier.Also bumps
MARKETING_VERSIONto 1.5.3 on the iOS and Watch app targets (coordinated release).Verification
xcodebuildbuild succeeds (iOS app + embedded Watch app).1/Nat the start and advances in lockstep with the iPhone, endingN/N.🤖 Generated with Claude Code