Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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],
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Middle-click bypasses user's archive confirmation preference

Low Severity

The handleRowAuxClick handler directly calls attemptArchiveThread without checking appSettingsConfirmThreadArchive. The existing archive UI (icon button click) respects this user setting by routing through handleStartArchiveConfirmation when enabled, requiring an explicit "Confirm" click before archiving. Middle-click silently ignores this preference, which is especially risky since middle-click can be accidentally triggered during scroll-wheel usage.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2879af1. Configure here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Middle-click archives running threads, showing confusing error toast

Medium Severity

The handleRowAuxClick handler doesn't check isThreadRunning before calling attemptArchiveThread. All other archive paths in this component are guarded by !isThreadRunning — the archive buttons are only rendered when the thread isn't running (line 653). The middle-click bypasses this, causing archiveThread to throw "Cannot archive a running thread," which surfaces as an unexpected error toast to the user instead of being silently prevented.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7c19250. Configure here.

const handleRowKeyDown = useCallback(
(event: React.KeyboardEvent) => {
if (event.key !== "Enter" && event.key !== " ") return;
Expand Down Expand Up @@ -555,6 +569,8 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
isSelected,
})} relative isolate`}
onClick={handleRowClick}
onMouseDown={handleRowMouseDown}
onAuxClick={handleRowAuxClick}
onKeyDown={handleRowKeyDown}
onContextMenu={handleRowContextMenu}
>
Expand Down
Loading