From b1b3408efab9a97aebd9b194c5a07cabfbabe4e4 Mon Sep 17 00:00:00 2001 From: dotta Date: Sat, 28 Mar 2026 19:16:19 -0500 Subject: [PATCH] Restrict sidebar reordering to mouse input Co-Authored-By: Paperclip --- ui/src/components/CompanyRail.tsx | 5 +++-- ui/src/components/SidebarProjects.tsx | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/src/components/CompanyRail.tsx b/ui/src/components/CompanyRail.tsx index 2ec8fc06..0448c79a 100644 --- a/ui/src/components/CompanyRail.tsx +++ b/ui/src/components/CompanyRail.tsx @@ -4,7 +4,7 @@ import { useQueries } from "@tanstack/react-query"; import { DndContext, closestCenter, - PointerSensor, + MouseSensor, useSensor, useSensors, type DragEndEvent, @@ -244,7 +244,8 @@ export function CompanyRail() { // Require 8px of movement before starting a drag to avoid interfering with clicks const sensors = useSensors( - useSensor(PointerSensor, { + // Keep sidebar reordering mouse-only so touch input can scroll/tap without drag affordances. + useSensor(MouseSensor, { activationConstraint: { distance: 8 }, }) ); diff --git a/ui/src/components/SidebarProjects.tsx b/ui/src/components/SidebarProjects.tsx index cc6f417c..3c63ebc3 100644 --- a/ui/src/components/SidebarProjects.tsx +++ b/ui/src/components/SidebarProjects.tsx @@ -4,7 +4,7 @@ import { useQuery } from "@tanstack/react-query"; import { ChevronRight, Plus } from "lucide-react"; import { DndContext, - PointerSensor, + MouseSensor, closestCenter, type DragEndEvent, useSensor, @@ -153,7 +153,8 @@ export function SidebarProjects() { const projectMatch = location.pathname.match(/^\/(?:[^/]+\/)?projects\/([^/]+)/); const activeProjectRef = projectMatch?.[1] ?? null; const sensors = useSensors( - useSensor(PointerSensor, { + // Project reordering is intentionally desktop-only; touch should remain tap/scroll behavior. + useSensor(MouseSensor, { activationConstraint: { distance: 8 }, }), );