From c53e5ee6885e70eb650eeb9f84c51b917096e3ca Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Wed, 7 Jan 2026 16:33:04 -0600 Subject: [PATCH] fix: cancel long-press timer when user scrolls Adds onTouchMove handler to cancel the long-press selection mode timer when the user starts scrolling, preventing accidental entry into multi-select mode during scroll gestures. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- frontend/src/components/ChatHistoryList.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/src/components/ChatHistoryList.tsx b/frontend/src/components/ChatHistoryList.tsx index 1c5d24c16..3d2e8e418 100644 --- a/frontend/src/components/ChatHistoryList.tsx +++ b/frontend/src/components/ChatHistoryList.tsx @@ -446,6 +446,14 @@ export function ChatHistoryList({ } }, []); + // Cancel long-press when user starts scrolling (touch move) + const handleLongPressMove = useCallback(() => { + if (longPressTimerRef.current) { + clearTimeout(longPressTimerRef.current); + longPressTimerRef.current = null; + } + }, []); + // Cleanup long-press timer on unmount useEffect(() => { return () => { @@ -610,6 +618,7 @@ export function ChatHistoryList({ onMouseUp={handleLongPressEnd} onMouseLeave={handleLongPressEnd} onTouchStart={() => isMobile && handleLongPressStart(conv.id)} + onTouchMove={handleLongPressMove} onTouchEnd={handleLongPressEnd} onTouchCancel={handleLongPressEnd} className={`rounded-lg py-2 transition-all hover:text-primary cursor-pointer ${