From d05e45e7d339ca464b2424f62d0926e8babaf56f Mon Sep 17 00:00:00 2001 From: Boof2015 <75185879+Boof2015@users.noreply.github.com> Date: Tue, 7 Jul 2026 15:28:42 -0400 Subject: [PATCH] improve horizontal swipe gesture thresholds --- src/components/SwipeableRow.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/SwipeableRow.tsx b/src/components/SwipeableRow.tsx index bf5f450..471028e 100644 --- a/src/components/SwipeableRow.tsx +++ b/src/components/SwipeableRow.tsx @@ -22,6 +22,9 @@ import { commitHaptic, tickHaptic } from '@/lib/haptics'; type IconName = keyof typeof Ionicons.glyphMap; +const SWIPE_ACTIVE_OFFSET_X = 10; +const SWIPE_FAIL_OFFSET_Y = 30; + export interface SwipeAction { icon: IconName; /** Background of the revealed action lane. */ @@ -79,8 +82,8 @@ export function SwipeableRow({ const pan = Gesture.Pan() .enabled(enabled && rowWidth > 0 && (hasRight || hasLeft)) - .activeOffsetX([-12, 12]) - .failOffsetY([-12, 12]) + .activeOffsetX([-SWIPE_ACTIVE_OFFSET_X, SWIPE_ACTIVE_OFFSET_X]) + .failOffsetY([-SWIPE_FAIL_OFFSET_Y, SWIPE_FAIL_OFFSET_Y]) .onUpdate((e) => { let t = e.translationX; if (t > 0 && !hasRight) t = 0;