Skip to content

Fix swipe action sensitivity and accidental triggers (solves #34) - #40

Merged
mirarr-app merged 3 commits into
mainfrom
fix/swipe-sensitivity-issue-34
Nov 22, 2026
Merged

mirarr-app merged 3 commits into
mainfrom
fix/swipe-sensitivity-issue-34

Conversation

@parsamrrelax

@parsamrrelax parsamrrelax commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #34.

Underlying Cause

In Compose Material 3, SwipeToDismissBox defaults to a fixed positionalThreshold of 56.dp (~12–15% of row width on standard mobile displays). In addition, AnchoredDraggable has a low velocity threshold (125.dp/s), meaning any slight diagonal drift or lift-off centroid roll during normal vertical scrolling in LazyColumn or tapping registered as a dismissal action (toggle read / delete dialog).

Solution & Changes

  1. SwipeActionDefaults & Positional Threshold:
    • Set positional threshold to 40% (0.4f) of the row width (totalDistance * 0.4f) with a 140.dp fallback when layout width is unmeasured.
  2. Direction-Aware Dismiss Guard:
    • In confirmValueChange, verified both magnitude and direction against threshold:
      • StartToEnd (mark read/unread) requires positive offset offsetPx >= threshold.
      • EndToStart (delete) requires negative offset offsetPx <= -threshold.
      • Settled is always allowed.
      • Rejected drifts, NaN offsets, and directional mismatches so accidental flings snap cleanly back to settled.
  3. Synchronized Haptic Activation:
    • Haptic feedback (GestureThresholdActivate) is triggered the exact moment the gesture crosses the 40% dismissal threshold (via snapshotFlow + distinctUntilChanged), avoiding desynchronization where feedback previously lagged until 50% midpoint.
  4. Comprehensive Test Suite:
    • Unit tests covering drift rejection, directional mismatch rejection, intentional swipes reaching threshold, NaN safety, fallback threshold behavior, and variable screen dimensions.
  5. Release & Versioning:
    • Bumped versionName to 1.3.19 (versionCode 33) and added Fastlane release notes in English and Persian.

@mirarr-app
mirarr-app merged commit 7ed76fc into main Nov 22, 2026
1 check 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.

swipe actions are too sensitive

2 participants