From 75cb68750043a0091e3228cb3a4689f418029b44 Mon Sep 17 00:00:00 2001 From: matteoscrugli Date: Tue, 23 Dec 2025 02:36:54 +0100 Subject: [PATCH] Remove edge resistance when sidebar swipe is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makes swiping to open sidebar feel natural without resistance 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- frontend/src/components/SwipeTabs.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/SwipeTabs.tsx b/frontend/src/components/SwipeTabs.tsx index 39bce3e..d88f377 100644 --- a/frontend/src/components/SwipeTabs.tsx +++ b/frontend/src/components/SwipeTabs.tsx @@ -295,7 +295,9 @@ export function SwipeTabs({ let offset = dx; const atStart = state.startIndex <= 0; const atEnd = state.startIndex >= tabs.length - 1; - if ((atStart && dx > 0) || (atEnd && dx < 0)) { + // Don't apply resistance at start if onSwipePastStart is defined (sidebar can open) + const hasVirtualTabAtStart = !!onSwipePastStart; + if ((atStart && dx > 0 && !hasVirtualTabAtStart) || (atEnd && dx < 0)) { offset = dx * EDGE_RESISTANCE; } offset = Math.max(Math.min(offset, width), -width); @@ -306,7 +308,7 @@ export function SwipeTabs({ preventDefault(); } }, - [scheduleDragUpdate, tabs.length] + [onSwipePastStart, scheduleDragUpdate, tabs.length] ); const finishDrag = useCallback(