From 2879af14bebb980d0997c37b4df631f3114e690f Mon Sep 17 00:00:00 2001 From: "t3-code[bot]" <269035359+t3-code[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 09:56:03 +0300 Subject: [PATCH] archive threads with middle click --- apps/web/src/components/Sidebar.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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} >