Skip to content

Conversation

@jruttan1
Copy link

@jruttan1 jruttan1 commented Jan 28, 2026

Description: This PR updates the "Go to Definition" button in the symbol hover tooltip to use a Nextjs Link component when a definition is found

Changes:
Uses getBrowsePath to correctly generate the destination URL
Conditionally renders a for single definitions, allowing users to Cmd Click / Middle Click to open the file in a new tab

Notes:
I chose not to update the "Find References" button in this PR. Since that action primarily toggles the side panel state rather than navigating to a distinct resource, it feels more appropriate to keep it as a button for now to ensure stable behaviour.

Fixes #793

Summary by CodeRabbit

  • New Features
    • Improved symbol hover popup with direct navigation links to single symbol definitions.
    • Smart detection of single-definition cases now displays as a clickable link instead of a button, enabling faster navigation.
    • Enhanced handling for symbols with multiple definitions, preserving existing button behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 28, 2026

Walkthrough

The PR modifies the symbol hover popup component to render a Link to a definition when a single, in-file definition exists. It computes the definition href using domain context and path information, falling back to the LoadingButton behavior for multiple definitions or when no definitive href is available.

Changes

Cohort / File(s) Summary
Definition Navigation Enhancement
packages/web/src/ee/features/codeNav/components/symbolHoverPopup/index.tsx
Adds conditional Link rendering for single definitions with domain-aware href computation using getBrowsePath and useDomain. Falls back to LoadingButton for multiple definitions. Includes onClick audit action recording and extends imports with buttonVariants, useDomain, getBrowsePath, and Link.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: converting the 'Go to Definition' button to a Link component to enable opening in a new tab.
Linked Issues check ✅ Passed The PR implements the primary requirement from issue #793 to make the 'Go to Definition' control a link for opening in new tab via Cmd+click.
Out of Scope Changes check ✅ Passed The PR focuses on converting 'Go to Definition' to a Link component while intentionally excluding 'Find References' (toggles side panel state), which is appropriately scoped.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

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.

[FR] go to def / find all ref buttons should be links

1 participant