# git_ui: Restore search in solo diff views \(\#60936\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/777aa2ee85a61796a15fd0aeec1df4c39925aae5)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 777aa2ee85a61796a15fd0aeec1df4c39925aae5

Requested commit: 777aa2ee85a61796a15fd0aeec1df4c39925aae5

Commit: 777aa2ee85a61796a15fd0aeec1df4c39925aae5

Tree: a1a762b344ec7cda812752d489e4a1c957faeea1

Author: saberoueslati

Committer: GitHub

## Message

```
git_ui: Restore search in solo diff views (#60936)

## 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](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>
```

## Parents

- [ed4d201f507ee28733f52b528244c49c6f5a4daf](https://git.cafe/gitcafe/zed/commit/ed4d201f507ee28733f52b528244c49c6f5a4daf?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/777aa2ee85a61796a15fd0aeec1df4c39925aae5?format=markdown)
