diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index e8c5bbe0b11..8f0ea9fa8cb 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -416,6 +416,20 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP }, [handleThreadClick, orderedProjectThreadKeys, threadRef], ); + const handleRowMouseDown = useCallback((event: React.MouseEvent) => { + if (event.button !== 1) return; + event.preventDefault(); + }, []); + const handleRowAuxClick = useCallback( + (event: React.MouseEvent) => { + if (event.button !== 1) return; + event.preventDefault(); + event.stopPropagation(); + clearConfirmingArchive(); + void attemptArchiveThread(threadRef); + }, + [attemptArchiveThread, clearConfirmingArchive, threadRef], + ); const handleRowKeyDown = useCallback( (event: React.KeyboardEvent) => { if (event.key !== "Enter" && event.key !== " ") return; @@ -555,6 +569,8 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP isSelected, })} relative isolate`} onClick={handleRowClick} + onMouseDown={handleRowMouseDown} + onAuxClick={handleRowAuxClick} onKeyDown={handleRowKeyDown} onContextMenu={handleRowContextMenu} >