Skip to content
6 changes: 5 additions & 1 deletion apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
DndContext,
useSensor,
useSensors,
type AutoScrollOptions,
type DragEndEvent,
type DragOverEvent,
type DragStartEvent,
Expand Down Expand Up @@ -876,6 +877,9 @@ function checkThreadOperations(

const SIDEBAR_DRAG_DISTANCE = 6;

// dnd-kit's 20% edge zone at full speed runs the list away while the pointer rests near the bottom.
const SIDEBAR_AUTO_SCROLL: AutoScrollOptions = { threshold: { x: 0, y: 0.05 }, acceleration: 3 };

const SIDEBAR_DRAG_LABEL_HEIGHT = 24;

const threadSearchResultId = (index: number) => `sidebar-thread-search-result-${index}`;
Expand Down Expand Up @@ -3280,7 +3284,7 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
>
<DndContext
sensors={dndSensors}
autoScroll={!isContextDrag}
autoScroll={isContextDrag ? false : SIDEBAR_AUTO_SCROLL}
collisionDetection={dndCollisionDetection}
modifiers={dndModifiers}
onDragStart={handleThreadDragStart}
Expand Down
Loading