Skip to content

feat: allow symbol navigation buttons to open in new tab#1079

Closed
msukkari wants to merge 4 commits intomainfrom
cursor/SOU-847-symbol-navigation-new-tab-0795
Closed

feat: allow symbol navigation buttons to open in new tab#1079
msukkari wants to merge 4 commits intomainfrom
cursor/SOU-847-symbol-navigation-new-tab-0795

Conversation

@msukkari
Copy link
Copy Markdown
Contributor

@msukkari msukkari commented Apr 2, 2026

Summary

This PR enables users to open code navigation buttons ("Go to definition" and "Find references") in a new tab by using Cmd+click (Mac) or Ctrl+click (Windows/Linux).

Changes

  • useBrowseNavigation.ts: Added createBrowsePath function that returns the URL path without navigating, allowing components to use it as an href attribute
  • symbolHoverPopup/index.tsx:
    • Replaced button elements with Next.js Link components for proper Cmd+click / Ctrl+click support
    • Added gotoDefinitionHref and findReferencesHref memos to compute the navigation URLs
    • When a definition is available, renders as a Link with button styling
    • When loading or no definition found, renders as a disabled LoadingButton
    • Analytics/audit logging is captured via the onClick handler

How it works

The buttons now render as Next.js Link components with the navigation URL in the href prop. Next.js Link components natively support modifier key clicks:

  • Regular click: Navigate in the current tab (same behavior as before)
  • Cmd+click (Mac) / Ctrl+click (Windows): Opens in a new tab via native browser behavior
  • Middle-click: Opens in a new tab
  • Right-click → Open in new tab: Standard browser context menu works

This works in both the file browser (/browse) and in Ask sessions when hovering over symbols in code citations.

Fixes #847

Linear Issue: SOU-847

Open in Web Open in Cursor 

- Add createBrowsePath to useBrowseNavigation hook to generate URLs
- Update LoadingButton component to support asChild prop for anchor elements
- Convert symbol hover popup buttons to use anchor elements with href
- Users can now cmd+click (ctrl+click) to open definitions/references in new tab

Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

Important

Review skipped

Draft detected.

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a23a17a1-dc2d-4052-9d3d-38ffdede9ae9

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
  • Commit unit tests in branch cursor/SOU-847-symbol-navigation-new-tab-0795

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.

cursoragent and others added 3 commits April 2, 2026 17:27
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
- Replace anchor elements with Next.js Link components for proper
  Cmd+click (Mac) / Ctrl+click (Windows) support to open in new tabs
- Revert LoadingButton asChild changes since we now use Link directly
- Buttons now properly support native browser behavior for opening links

Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
@msukkari msukkari closed this Apr 3, 2026
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