zed/assets
Sathwik Chirivelli 076fd14c88
git_panel: Add better view options (#59043)
Self-Review Checklist:

- [x] I have reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed 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
- [x] Performance impact has been considered and is acceptable

## Summary

This updates the Git Panel view controls so the panel can independently
model:

- whether entries are shown as a list or tree
- whether flat entries are sorted by path or name
- whether entries are grouped by status or shown as one combined set

It also keeps the Project Diff order consistent with the Git Panel,
including tree ordering, status grouping, and flat name/path sorting.

## Why This Is Useful

The previous sort_by_path boolean overloaded two separate ideas: sorting
and grouping. That made it hard to represent the view users actually
wanted, especially a single tree where tracked and untracked files are
not split into separate sections.

This change replaces that boolean with explicit enum settings:

- git_panel.sort_by: path or name
- git_panel.group_by: none or status

That keeps the settings mutually exclusive, easier to extend, and closer
to the UI model.

## Implementation Notes

- Adds a dedicated Git Panel View Options menu using the sliders icon.
- Moves view, sort, and group controls out of the overflow actions menu.
- Disables sort options in tree view because tree order is folder-first
rather than pure path/name sorting.
- Removes the Tracked heading when grouping is disabled.
- Keeps Git Panel tree expansion state when switching view options.
- Recomputes Project Diff sort prefixes from tree_view, sort_by, and
group_by so diff cards follow the same top-to-bottom order as the Git
Panel.
- Preserves Project Diff open/closed file state across view option
changes by carrying fold state by repo path instead of by synthetic sort
key.
- Updates settings UI renderers and docs for the new enum settings.

## Testing

- [x] cargo fmt --package git_ui --package settings_ui
- [x] cargo check -p git_ui
- [x] Verified settings UI enum dropdown rendering for Git Panel
sort/group settings

Closes https://github.com/zed-industries/zed/issues/53555
Closes https://github.com/zed-industries/zed/issues/56039
Closes https://github.com/zed-industries/zed/issues/45438

Release Notes:

- Improved Git Panel view options and Project Diff ordering.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-06-21 22:36:42 +00:00
..
badge Adjust Zed badge (#35294) 2025-07-29 15:09:31 -04:00
fonts Use semibold (#47725) 2026-01-27 08:50:52 -07:00
icons language_models: Add Anthropic-compatible provider support in settings (#50381) 2026-06-12 03:00:42 +00:00
images cloud_api_types: Add ZedVip variant to Plan (#59443) 2026-06-18 20:51:36 +00:00
keymaps Add preview to pickers and make them resizable (#59604) 2026-06-19 17:43:07 +00:00
prompts A couple new inline assistant tests (#45049) 2025-12-17 13:02:03 -08:00
settings git_panel: Add better view options (#59043) 2026-06-21 22:36:42 +00:00
sounds call: Play a different sound when a guest joins (#38987) 2025-09-27 09:20:55 -04:00
themes Revert vim mode colors in One theme (#56772) 2026-05-14 17:33:59 +00:00