Skip to content

fix(web): prevent stalled code search result navigation - #1574

Merged
brendan-kellam merged 2 commits into
mainfrom
brendan/fix-search-result-navigation
Aug 12, 2026
Merged

fix(web): prevent stalled code search result navigation#1574
brendan-kellam merged 2 commits into
mainfrom
brendan/fix-search-result-navigation

Conversation

@brendan-kellam

@brendan-kellam brendan-kellam commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • disable Next.js prefetching for code search matches and PathHeader links
  • restore Cmd/Ctrl-click behavior so a code match opens in the preview panel at the correct match
  • add focused interaction coverage for ordinary, modified, and keyboard activation

Test plan

  • yarn workspace @sourcebot/web test src/app/\(app\)/search/components/searchResultsPanel/fileMatch.test.tsx
  • yarn workspace @sourcebot/web eslint src/app/\(app\)/search/components/searchResultsPanel/fileMatch.tsx src/app/\(app\)/search/components/searchResultsPanel/fileMatch.test.tsx src/app/\(app\)/search/components/searchResultsPanel/fileMatchContainer.tsx src/app/\(app\)/components/pathHeader.tsx

Note

Cursor Bugbot is generating a summary for commit 74f3951. Configure here.

Summary by CodeRabbit

  • New Features
    • Cmd/Ctrl-clicking or pressing Cmd/Ctrl+Enter on a code search result now opens its preview without navigating away.
  • Bug Fixes
    • Improved code search result navigation behavior.
    • Disabled unnecessary link prefetching for repository, branch, breadcrumb, and search result links.
  • Documentation
    • Added an Unreleased changelog entry describing these improvements.

@github-actions

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Changes

Navigation and preview behavior

Layer / File(s) Summary
Path navigation prefetch control
packages/web/src/app/(app)/components/pathHeader.tsx
Repository, branch or revision, hidden breadcrumb, and visible breadcrumb links disable Next.js prefetching.
Search match preview interactions
packages/web/src/app/(app)/search/components/searchResultsPanel/fileMatch.tsx, packages/web/src/app/(app)/search/components/searchResultsPanel/fileMatchContainer.tsx, packages/web/src/app/(app)/search/components/searchResultsPanel/fileMatch.test.tsx, CHANGELOG.md
FileMatch handles modifier-based preview interactions and disables prefetching. FileMatchContainer calculates cumulative match indexes. Tests cover navigation and preview behavior. The changelog records the fixes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: ⚪ Minimal · up to fa034

The change is localized to search-result navigation and has no actionable merge-blocking risk remaining; the additional modifier-path assertions are a non-blocking follow-up.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant FileMatch
  participant FileMatchContainer
  User->>FileMatch: Modifier-click or modifier-plus-Enter
  FileMatch->>FileMatchContainer: onOpenPreview()
  FileMatchContainer->>FileMatchContainer: Calculate cumulative match index
  FileMatchContainer-->>User: Open file preview at match index
Loading

Possibly related PRs

🚥 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 clearly and concisely describes the primary change: preventing stalled code search result navigation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch brendan/fix-search-result-navigation

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/web/src/app/`(app)/search/components/searchResultsPanel/fileMatch.test.tsx:
- Around line 63-92: Update the ordinary-click test for FileMatch to assert its
click event is not defaultPrevented while preserving the existing no-preview
assertion. Extend the modifier-plus-Enter test coverage to run for both metaKey
(Cmd) and ctrlKey (Ctrl), asserting each event prevents navigation and calls
onOpenPreview once.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e10de595-2c40-4e5d-bf3a-651fc177f98a

📥 Commits

Reviewing files that changed from the base of the PR and between a4a0f0e and fa0343c.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • packages/web/src/app/(app)/components/pathHeader.tsx
  • packages/web/src/app/(app)/search/components/searchResultsPanel/fileMatch.test.tsx
  • packages/web/src/app/(app)/search/components/searchResultsPanel/fileMatch.tsx
  • packages/web/src/app/(app)/search/components/searchResultsPanel/fileMatchContainer.tsx

@brendan-kellam
brendan-kellam merged commit 3aa8711 into main Aug 12, 2026
15 checks passed
@brendan-kellam
brendan-kellam deleted the brendan/fix-search-result-navigation branch August 12, 2026 22:46
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.

1 participant