Skip to content

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

Open
Noojuno wants to merge 5 commits 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 5 commits 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

Fix sidebar project dragging triggered by macOS ctrl+click context menu

  • Adds isContextMenuPointerDown in Sidebar.logic.ts to detect right-click and macOS ctrl+left-click pointer events.
  • Stops propagation of context-menu pointer-down events in the project title handler so the drag sensor is never armed.
  • Suppresses the synthetic click that follows a context-menu invocation to prevent the project from toggling or activating.

Macroscope summarized ff700af.

- 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: b548e86b-3473-4ca7-92c7-13b309324c02

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
📝 Coding Plan
  • Generate coding plan for human review comments

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
@github-actions github-actions bot added the size:M 30-99 changed lines (additions + deletions). label Mar 12, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Noojuno Noojuno force-pushed the t3code/debug-sidebar-context-drag-mode branch from 6ab08cf to 09bd3aa Compare March 12, 2026 20:25
@Noojuno Noojuno requested a review from juliusmarminge March 12, 2026 20:27
@Noojuno Noojuno force-pushed the t3code/debug-sidebar-context-drag-mode branch 2 times, most recently from 781dd39 to 32f802c Compare March 12, 2026 20:31
@Noojuno Noojuno force-pushed the t3code/debug-sidebar-context-drag-mode branch from 32f802c to 44f8826 Compare March 12, 2026 20:43
@Noojuno
Copy link
Contributor Author

Noojuno commented Mar 12, 2026

@juliusmarminge not sure what the deal is with the browser test stage failing, seems to be failing on other people's PR's too

https://github.com/pingdotgg/t3code/actions/runs/22935708344/job/66566456827?pr=882

@juliusmarminge
Copy link
Member

@macroscope-app review this

…r-context-drag-mode

# Conflicts:
#	apps/web/src/components/Sidebar.logic.ts
#	apps/web/src/components/Sidebar.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). 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.

2 participants