@devries-cameron20 / t3code-1 / commits / c8267db9ac
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): tagging a thread by drag no longer scrolls the sidebar (#31924)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Theo Browne committed Nov 6, 2026 at 02:33 UTC c8267db9ac19d22b4ff799f2529f5e691999697d
1 file changed +11
apps/web/src/components/Sidebar.tsx
+11
@@ -1055,6 +1055,7 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
1055 } | null>(null);
1056 const dragSensorRef = useRef<SidebarPointerSensor | null>(null);
1057 const contextDragKeyRef = useRef<string | null>(null);
1058 + const dragScrollRef = useRef<{ readonly viewport: Element; readonly top: number } | null>(null);
1059 const [actionSweep, setActionSweep] = useState<{
1060 action: SidebarSweepAction;
1061 keys: ReadonlySet<string>;
@@ -1713,6 +1714,7 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
1714 const finishThreadDrag = (started: boolean) => {
1715 dragSensorRef.current = null;
1716 contextDragKeyRef.current = null;
1717 + dragScrollRef.current = null;
1718 endThreadContextDrag();
1719 if (started) {
1720 listMotionRef.current?.release();
@@ -1739,6 +1741,11 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
1741 const bounds = threadListRef.current?.getBoundingClientRect();
1742 return bounds !== undefined && (point.x < bounds.left || point.x > bounds.right);
1743 };
1744 + // The path out of the list often crosses dnd-kit's edge zone, which autoscrolls the sidebar.
1745 + const restoreDragScroll = () => {
1746 + const scroll = dragScrollRef.current;
1747 + if (scroll && scroll.viewport.scrollTop !== scroll.top) scroll.viewport.scrollTop = scroll.top;
1748 + };
1749 const moveThreadContextDrag = (point: { x: number; y: number }) => {
1750 const contextDrag = pointerOutsideThreadList(point);
1751 setDragState((current) =>
@@ -1750,6 +1757,7 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
1757 endThreadContextDrag();
1758 return false;
1759 }
1760 + restoreDragScroll();
1761 const threads = contextDragThreads();
1762 const title =
1763 threadByKeyRef.current.get(contextDragKeyRef.current ?? "")?.title.trim() || "Thread";
@@ -1758,6 +1766,7 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
1766 };
1767 const dropThreadContextDrag = (point: { x: number; y: number }) => {
1768 if (!pointerOutsideThreadList(point)) return false;
1769 + restoreDragScroll();
1770 dropThreadContext(point, contextDragThreads());
1771 return true;
1772 };
@@ -1884,6 +1893,8 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
1893 if (activeSection === undefined) return;
1894 listMotionRef.current?.suspend();
1895 const list = threadListRef.current;
1896 + const viewport = list?.closest('[data-slot="scroll-area-viewport"]');
1897 + dragScrollRef.current = viewport ? { viewport, top: viewport.scrollTop } : null;
1898 const header = list?.querySelector<HTMLElement>('[data-testid="sidebar-pinned-header"]');
1899 if (list && header) {
1900 const listRect = list.getBoundingClientRect();