today: swipe the day the same way on both platforms - #2379
Merged
Merged
Conversation
Refs ryanbr#2378. The Today day-navigation swipe ran in opposite directions on Apple and Android. Apple stepped OLDER on a leftward drag in both shells; the Kotlin twin steps older on a RIGHTWARD one (`dayNavSwipeTarget`, pinned by `DayNavTest`), so the same gesture moved the day backwards on one platform and forwards on the other. The Kotlin comment beside that lane describes it as mirroring the iOS swipe, which is where the two look to have drifted apart. Apple moves to Android's direction rather than the reverse, for a reason beyond picking one: rightward-is-older is direct manipulation — dragging the content left brings the page to its right, the later day, into view — which is how a horizontally paged date view behaves elsewhere on the platform. The report behind the issue was exactly that expectation: a swipe right-to-left was expected to move forwards and went back instead. The direction now lives in one pure `TodayView.daySwipeDelta(dx:)` used by both Apple shells, rather than as a sign test written twice inside gesture closures. That is what made the drift invisible: the clamp either side of it was already pure and tested (`clampedDayOffset`, `TodayDayNavClampTests`), while the direction itself was not covered on this platform at all. Android's twin was already pure and already pinned, which is why its direction held. Behaviour otherwise unchanged: the same threshold and horizontal-dominance gates, the same clamp, the same chart-owns-its-own-touches mask on the classic shell. VERIFICATION xcodebuild -scheme Strand -destination 'platform=macOS' test \ -only-testing:StrandTests/TodayDayNavClampTests -> 17 tests, 0 failures xcodebuild -scheme NOOPiOS -configuration Debug \ -destination 'generic/platform=iOS' build -> BUILD SUCCEEDED cd android && ./gradlew testFullDebugUnitTest --tests "com.noop.ui.DayNavTest" -> 7 tests, 0 failures The three new Swift cases mirror the Kotlin ones by name and intent, so the two platforms now assert the same direction rather than describing it in prose. No Kotlin changes: Android already has the direction this adopts, and its test already pins it. One gradle invocation reported FAILED while its own test report recorded 7 passes and no failures, and it did not reproduce on a clean re-run; flagged rather than explained, since nothing in this change touches Kotlin. Not verified on a device: this is a gesture, and the branch has not been run on hardware. The direction is pinned by test on both platforms, but a device pass is the honest missing piece. Co-Authored-By: Claude Opus 5 <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.
Refs #2378.
The Today day-navigation swipe ran in opposite directions on Apple and Android.
Apple stepped OLDER on a leftward drag in both shells; the Kotlin twin steps
older on a RIGHTWARD one (
dayNavSwipeTarget, pinned byDayNavTest), so thesame gesture moved the day backwards on one platform and forwards on the other.
The Kotlin comment beside that lane describes it as mirroring the iOS swipe,
which is where the two look to have drifted apart.
Apple moves to Android's direction rather than the reverse, for a reason beyond
picking one: rightward-is-older is direct manipulation — dragging the content
left brings the page to its right, the later day, into view — which is how a
horizontally paged date view behaves elsewhere on the platform. The report
behind the issue was exactly that expectation: a swipe right-to-left was
expected to move forwards and went back instead.
The direction now lives in one pure
TodayView.daySwipeDelta(dx:)used by bothApple shells, rather than as a sign test written twice inside gesture closures.
That is what made the drift invisible: the clamp either side of it was already
pure and tested (
clampedDayOffset,TodayDayNavClampTests), while thedirection itself was not covered on this platform at all. Android's twin was
already pure and already pinned, which is why its direction held.
Behaviour otherwise unchanged: the same threshold and horizontal-dominance
gates, the same clamp, the same chart-owns-its-own-touches mask on the classic
shell.
VERIFICATION
xcodebuild -scheme Strand -destination 'platform=macOS' test
-only-testing:StrandTests/TodayDayNavClampTests -> 17 tests, 0 failures
xcodebuild -scheme NOOPiOS -configuration Debug
-destination 'generic/platform=iOS' build -> BUILD SUCCEEDED
cd android && ./gradlew testFullDebugUnitTest --tests "com.noop.ui.DayNavTest"
-> 7 tests, 0 failures
The three new Swift cases mirror the Kotlin ones by name and intent, so the two
platforms now assert the same direction rather than describing it in prose.
No Kotlin changes: Android already has the direction this adopts, and its test
already pins it. One gradle invocation reported FAILED while its own test report
recorded 7 passes and no failures, and it did not reproduce on a clean re-run;
flagged rather than explained, since nothing in this change touches Kotlin.
Not verified on a device: this is a gesture, and the branch has not been run on
hardware. The direction is pinned by test on both platforms, but a device pass
is the honest missing piece.
🤖 Generated with Claude Code