Skip to content

Conversation

@H4ad
Copy link

@H4ad H4ad commented Dec 4, 2025

πŸ“„ Summary

Add support to open the new tab not only via CTRL but also via middle click of the button, like URL link.


βœ… Changes

  • Feature: Brief description
  • Bug fix: Brief description

πŸ§ͺ How to Test

  1. Open the initial page
  2. Middle click in any menu item

πŸ” Related Issues

I found no related issue.


πŸ“Έ Screenshots / Screen Recording (if applicable / mandatory for UI related changes)

No screenshots since this change via click.


πŸ“‹ Checklist

  • Dev Review
  • Test cases added (Unit/ Integration / E2E)
  • Manually tested the changes

πŸ‘€ Notes for Reviewers

Inspired by https://www.linkedin.com/feed/update/urn:li:activity:7400183369948520448?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7400183369948520448%2C7400648742405554176%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287400648742405554176%2Curn%3Ali%3Aactivity%3A7400183369948520448%29


Note

Enable opening sidebar items in new tabs via middle-click or Ctrl/Meta, with centralized event check and NavItem middle-button handling.

  • Frontend – SideNav:
    • Introduce shouldMouseEventOpenInNewTab to detect Ctrl/Meta or middle-click and use it in onClickGetStarted, onClickHandler, and handleMenuItemClick to open routes in a new tab.
    • Update hooks dependencies to include shouldMouseEventOpenInNewTab.
  • Frontend – NavItem:
    • Add onMouseDown to trigger onClick on middle mouse button when not disabled.

Written by Cursor Bugbot for commit 634cb52. This will update automatically on new commits. Configure here.

@H4ad H4ad requested review from YounixM and aks07 as code owners December 4, 2025 04:40
@CLAassistant
Copy link

CLAassistant commented Dec 4, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

if (event.button === 1 && !isDisabled) {
onClick(event);
}
}}
Copy link

Choose a reason for hiding this comment

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

Bug: Middle click on pin icons triggers unintended navigation

The new onMouseDown handler catches middle clicks on the entire nav-item div, including the Pin and PinOff icons inside it. The pin icons only have onClick handlers with stopPropagation(), which doesn't prevent mousedown events from bubbling. When a user middle-clicks on the pin icon, the mousedown event bubbles up to the parent div and triggers navigation (opening in a new tab), which is unintended behavior. The handler needs to check if the click target is the pin icon and skip navigation in that case.

Fix in CursorΒ Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants