Skip to content

git_ui: Restore search in solo diff views - #60936

Merged
ChristopherBiscardi merged 2 commits into
zed-industries:mainfrom
saberoueslati:git_ui/restore-solo-diff-search
Jul 20, 2026
Merged

git_ui: Restore search in solo diff views#60936
ChristopherBiscardi merged 2 commits into
zed-industries:mainfrom
saberoueslati:git_ui/restore-solo-diff-search

Conversation

@saberoueslati

@saberoueslati saberoueslati commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Context

Buffer search did not work in file diffs opened from the Git panel because SoloDiffView did not expose its embedded editor as searchable. Restoring search also revealed that the primary toolbar clipped several search controls, so the deployed search bar now uses the full-width secondary row for this view.

Closes #60659.

How to Review

Three files changed. Read in this order:

crates/git_ui/src/solo_diff_view.rs : SoloDiffView::as_searchable now returns its embedded SplittableEditor, restoring search for the focused diff side while keeping the editor hidden from global diff-style controls.

crates/search/src/buffer_search.rs : Buffer search now detects when its searchable split editor is intentionally hidden by the containing item. When deployed, this case uses the secondary toolbar row so Toggle Replace, search options, match navigation, and match counts remain visible. Other multibuffer layouts keep their existing primary toolbar location.

crates/git_ui/src/git_panel.rs : The regression test now opens a solo diff through the Git panel, confirms the split editor is searchable, deploys buffer search, verifies the secondary toolbar location, runs a query, and checks that the focused editor receives a search highlight.

Manual test after the fix below :

Screencast.from.2026-07-14.00-39-04.webm

Self-Review Checklist

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • Fixed searching in file diffs opened from the Git panel.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jul 13, 2026
@SomeoneToIgnore SomeoneToIgnore added the area:integrations/git Git integration feedback label Jul 16, 2026

@ChristopherBiscardi ChristopherBiscardi 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.

thanks!

@ChristopherBiscardi ChristopherBiscardi self-assigned this Jul 20, 2026
@ChristopherBiscardi
ChristopherBiscardi added this pull request to the merge queue Jul 20, 2026
Merged via the queue into zed-industries:main with commit 777aa2e Jul 20, 2026
1 check passed
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
## Context

Buffer search did not work in file diffs opened from the Git panel
because `SoloDiffView` did not expose its embedded editor as searchable.
Restoring search also revealed that the primary toolbar clipped several
search controls, so the deployed search bar now uses the full-width
secondary row for this view.

Closes zed-industries#60659.

## How to Review

Three files changed. Read in this order:

**`crates/git_ui/src/solo_diff_view.rs`** :
`SoloDiffView::as_searchable` now returns its embedded
`SplittableEditor`, restoring search for the focused diff side while
keeping the editor hidden from global diff-style controls.

**`crates/search/src/buffer_search.rs`** : Buffer search now detects
when its searchable split editor is intentionally hidden by the
containing item. When deployed, this case uses the secondary toolbar row
so Toggle Replace, search options, match navigation, and match counts
remain visible. Other multibuffer layouts keep their existing primary
toolbar location.

**`crates/git_ui/src/git_panel.rs`** : The regression test now opens a
solo diff through the Git panel, confirms the split editor is
searchable, deploys buffer search, verifies the secondary toolbar
location, runs a query, and checks that the focused editor receives a
search highlight.

Manual test after the fix below :

[Screencast from 2026-07-14
00-39-04.webm](https://github.com/user-attachments/assets/022ab106-d35a-4a75-98db-8809b86fa58d)

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the UI/UX checklist
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed searching in file diffs opened from the Git panel.

Co-authored-by: Chris Biscardi <chris@christopherbiscardi.com>
playdohface pushed a commit to playdohface/zed that referenced this pull request Aug 29, 2026
## Context

Buffer search did not work in file diffs opened from the Git panel
because `SoloDiffView` did not expose its embedded editor as searchable.
Restoring search also revealed that the primary toolbar clipped several
search controls, so the deployed search bar now uses the full-width
secondary row for this view.

Closes zed-industries#60659.

## How to Review

Three files changed. Read in this order:

**`crates/git_ui/src/solo_diff_view.rs`** :
`SoloDiffView::as_searchable` now returns its embedded
`SplittableEditor`, restoring search for the focused diff side while
keeping the editor hidden from global diff-style controls.

**`crates/search/src/buffer_search.rs`** : Buffer search now detects
when its searchable split editor is intentionally hidden by the
containing item. When deployed, this case uses the secondary toolbar row
so Toggle Replace, search options, match navigation, and match counts
remain visible. Other multibuffer layouts keep their existing primary
toolbar location.

**`crates/git_ui/src/git_panel.rs`** : The regression test now opens a
solo diff through the Git panel, confirms the split editor is
searchable, deploys buffer search, verifies the secondary toolbar
location, runs a query, and checks that the focused editor receives a
search highlight.

Manual test after the fix below :

[Screencast from 2026-07-14
00-39-04.webm](https://github.com/user-attachments/assets/022ab106-d35a-4a75-98db-8809b86fa58d)

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the UI/UX checklist
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed searching in file diffs opened from the Git panel.

Co-authored-by: Chris Biscardi <chris@christopherbiscardi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:integrations/git Git integration feedback cla-signed The user has signed the Contributor License Agreement

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Search not working in file diff view

3 participants