Skip to content

fix: prevent Android dismiss handoff jumps - #25

Merged
saseungmin merged 1 commit into
mainfrom
fix/android-dismiss-handoff
Aug 11, 2026
Merged

fix: prevent Android dismiss handoff jumps#25
saseungmin merged 1 commit into
mainfrom
fix/android-dismiss-handoff

Conversation

@saseungmin

Copy link
Copy Markdown
Member

Summary

  • animate only the primary dismiss axis after a gesture commit
  • preserve the final cross-axis drag position during the release handoff
  • cover horizontal and upward axis selection with a regression test
  • add a patch changeset for the Android behavior fix

Root cause

#23 generalized gesture dismiss destinations for upward swipes. The gesture runtime then started withTiming on both X and Y for every accepted direction.

On Android, the final cross-axis value reported at gesture end can differ slightly from the last rendered drag frame. Restarting an otherwise unnecessary timing animation on that axis made the card briefly move backward when the finger was released.

Fix

Horizontal dismisses now animate only X, while upward dismisses animate only Y. The cross axis remains on its last drag frame instead of being restarted at the handoff.

This restores the horizontal dismiss translation behavior from before upward swipe support while retaining the new upward gesture path.

Validation

  • pnpm format:check
  • pnpm lint
  • pnpm typecheck
  • pnpm test --runInBand — 15 suites, 201 tests
  • pnpm build
  • Android emulator profiling with debug and release builds

Remaining validation

A physical Android release device was not available. Emulator profiling still showed general frame drops unrelated to the deterministic cross-axis handoff jump fixed here.

Upward swipe support restarted gesture dismiss timing on both axes.
Preserve the cross-axis drag position and animate only the primary dismiss axis.

Constraint: Horizontal dismisses animate X; upward dismisses animate Y
Rejected: Animate both axes | Android final events can reverse the cross axis
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep the cross axis unchanged during gesture dismiss handoffs
Tested: format, lint, typecheck, 201 tests, build, Android emulator profiling
Not-tested: Physical Android device release behavior
@changeset-bot

changeset-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cb59c4a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@react-native-motion-kit/swipe-deck Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@saseungmin
saseungmin marked this pull request as ready for review August 9, 2026 23:48
@saseungmin
saseungmin merged commit 9be410c into main Aug 11, 2026
3 checks passed
@saseungmin
saseungmin deleted the fix/android-dismiss-handoff branch August 11, 2026 10:18
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.

1 participant