Skip to content

fix: Prevent sidebar project dragging when using macos control+click to open context menu#873

Open
Noojuno wants to merge 1 commit intopingdotgg:mainfrom
Noojuno:t3code/debug-sidebar-context-drag-mode
Open

fix: Prevent sidebar project dragging when using macos control+click to open context menu#873
Noojuno wants to merge 1 commit intopingdotgg:mainfrom
Noojuno:t3code/debug-sidebar-context-drag-mode

Conversation

@Noojuno
Copy link
Contributor

@Noojuno Noojuno commented Mar 11, 2026

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

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Prevent sidebar project navigation after context-menu pointer gestures

  • Adds isContextMenuPointerDown in Sidebar.logic.ts to detect secondary-button clicks and ctrl+click as context-menu gestures.
  • Adds suppressProjectClickForContextMenuRef in Sidebar.tsx to block the synthetic click that fires after a context menu is invoked on a project title.
  • The onContextMenu handler sets the ref before opening the menu; handleProjectTitleClick checks it and suppresses navigation; handleProjectTitlePointerDownCapture stops propagation to prevent the drag sensor from arming.

Macroscope summarized 6e2350c.

- 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
@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 42de114a-01c1-4a1d-821f-51278a9600bb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Mar 11, 2026
@Noojuno Noojuno changed the title fix: Prevent sidebar project clicks after context-menu pointer gestures fix: Prevent sidebar project dragging when using macos control+click to open context menu Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant