solo_diff_view: Show changes only by default (#59958)

# Objective

- Default the solo diff view to show changed hunks with excerpted
context instead of expanding the entire file.
- Closes https://github.com/zed-industries/zed/issues/59489

## Solution

- Initialize the solo diff editor with excerpts around changed hunks.
- Add a header toggle for switching between the excerpted changes-only
view and the full-file view.
- Keep both sides of the split diff visually aligned when excerpts are
collapsed.

## Testing

- `cargo check -p git_ui`
- `cargo test -p git_ui`

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] 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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

<details>
  <summary>Click to view showcase</summary>

Changes-only default view:
<img width="1624" height="1030"
alt="solo_diff_view_new_default_changes_only_view"
src="https://github.com/user-attachments/assets/c6fb937e-8882-415c-8476-b9c3019c152e"
/>


Toggled full-file view:
<img width="1624" height="1030"
alt="solo_diff_view_toggled_to_full_file_view"
src="https://github.com/user-attachments/assets/3d736d00-178a-4dfa-b1ff-d3d15e33b30e"
/>

</details>

---

Release Notes:

- Improved solo diff view to show changed hunks by default with a toggle
for viewing the full file.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
5fa184f8b6Sathwik Chirivelli committed on 6/29/2026, 2:59:25 AM· committed by GitHubparent33473c1
2 files changedLine totals unavailable