# solo_diff_view: Add git action to open file diff and other improvements \(\#59752\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 0346cc77ee22b2a458224dc029c24a647607f7b2

Requested commit: 0346cc77ee22b2a458224dc029c24a647607f7b2

Commit: 0346cc77ee22b2a458224dc029c24a647607f7b2

Tree: e8b733dc66010acdc8ec947d8c73ee5b0f4de2d5

Author: Sathwik Chirivelli

Committer: GitHub

## Message

```
solo_diff_view: Add git action to open file diff and other improvements (#59752)

# Objective

- Polish the solo diff review UI by reducing redundant controls and
hiding inactive fold controls in split diff views.

## Solution

- Collapse the solo diff header's `Stage File` / `Unstage File` actions
into one button that shows the action relevant to the file's current
staging state.
- Stop reserving fold gutter space and rendering fold crease toggles for
editors with companion snapshots, matching the existing LHS split diff
behavior.

## Testing

- `cargo fmt --check`
- `cargo check -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

Before, the solo diff header showed both file-level staging actions at
once, and the RHS split diff gutter could show fold arrows that did not
work in that view. After this change, the header shows the relevant
file-level staging action and split companion panes no longer show
inactive fold controls.

Release Notes:

- Improved solo diff controls by showing the relevant file staging
action and hiding inactive fold toggles in split diffs.
```

## Parents

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

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