fix: Prevent sidebar project dragging when using macos control+click to open context menu#873
Open
Noojuno wants to merge 1 commit intopingdotgg:mainfrom
Open
Conversation
- Add shared context-menu pointerdown detection logic with unit tests - Stop propagation on right-click/Ctrl-click to avoid arming drag sensors - Suppress the follow-up project title click when opening the project context menu
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
Updated the drag handler to ignore control+click actions when starting dragging.
Why
When using my trackpad on my MacBook, I was running into issues right clicking projects (while testing other stuff), because I was using the control+click method of triggering a right click.
This was causing the app to begin the drag state for a project when the context menu was dismissed, instead of just triggering the context menu.
UI Changes
The UI changes were kind of hard to show, but in all examples I did a normal drag, then a normal control+click and either clicked away or pressed esc to close the context menu, then moved my cursor (so not holding down click).
In the before, it kept the click action in a drag state even though I had let go of left click.
Before
Screen.Recording.2026-03-11.at.1.13.43.PM.mov
Screen.Recording.2026-03-11.at.1.14.37.PM.mov
After
Screen.Recording.2026-03-11.at.1.12.11.PM.mov
Screen.Recording.2026-03-11.at.1.11.11.PM.mov
Checklist
Note
Prevent sidebar project navigation after context-menu pointer gestures
isContextMenuPointerDownin Sidebar.logic.ts to detect secondary-button clicks and ctrl+click as context-menu gestures.suppressProjectClickForContextMenuRefin Sidebar.tsx to block the synthetic click that fires after a context menu is invoked on a project title.onContextMenuhandler sets the ref before opening the menu;handleProjectTitleClickchecks it and suppresses navigation;handleProjectTitlePointerDownCapturestops propagation to prevent the drag sensor from arming.Macroscope summarized 6e2350c.