-
Notifications
You must be signed in to change notification settings - Fork 2.3k
archive threads with middle click #2782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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], | ||
| ); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Middle-click archives running threads, showing confusing error toastMedium Severity The Reviewed by Cursor Bugbot for commit 7c19250. Configure here. |
||
| 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} | ||
| > | ||
|
|
||


There was a problem hiding this comment.
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
handleRowAuxClickhandler directly callsattemptArchiveThreadwithout checkingappSettingsConfirmThreadArchive. The existing archive UI (icon button click) respects this user setting by routing throughhandleStartArchiveConfirmationwhen 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.Reviewed by Cursor Bugbot for commit 2879af1. Configure here.