Skip to content

today: swipe the day the same way on both platforms - #2379

Merged
ryanbr merged 1 commit into
ryanbr:mainfrom
andremiliano:today/2378-day-swipe-direction
Sep 22, 2026
Merged

ryanbr merged 1 commit into
ryanbr:mainfrom
andremiliano:today/2378-day-swipe-direction

Conversation

@andremiliano

Copy link
Copy Markdown

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 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.

🤖 Generated with Claude Code

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>
@ryanbr
ryanbr merged commit 58c41ba into ryanbr:main Sep 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants