search: Fix expand/collapse button for non multibuffer items (#61519)
# Objective
Fix an issue where the button was being shown in the LSP log view even
because it's `Item::buffer_kind` implementation was returning the
default `ItemBufferKind::None` value.
## Solution
Update the `BufferSearchBar::needs_expand_collapse_option`
implementation to return `false` for all non-multibuffer items instead
of only returning false for singletons.
## Testing
Tested both manually as well as added a new test for this change –
`search::buffer_search::tests::test_no_expand_collapse_option_when_item_is_not_buffer_backed`.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable
## Showcase
<details>
<summary>Before</summary>
<img width="3824" height="2482" alt="CleanShot 2026-07-23 at 11 18
37@2x"
src="https://github.com/user-attachments/assets/f435ca07-5eb0-4c16-b567-ea066dbc0ccd"
/>
</details>
<details>
<summary>After</summary>
<img width="3776" height="2482" alt="CleanShot 2026-07-23 at 11 19
53@2x"
src="https://github.com/user-attachments/assets/b94e59cf-8888-470f-acd1-3bb1b714e62d"
/>
</details>
---
Release Notes:
- Fixed issue where "Collapse All Files"/"Expand All Files" button was
being shown in LSP Log View
aa5603358dDino committed on 7/23/2026, 12:18:21 PM· committed by GitHubparent040a169