mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-19 06:59:22 +01:00
git_ui: Allow collapsing the commit editor and commit details (#63236)
## Summary - The commit message editor in the Git panel is pinned to six lines and its only two controls both make it *larger* — one fills the panel, the other opens the modal. Anyone who commits from a terminal pays for an input they never use, and the Changes list is what gets squeezed. - In the Git Graph detail panel, the author metadata and the commit message render at a fixed size above the changed-files list, so shortening the panel (e.g. dragging the terminal up) hides the file list entirely. ## Changes **Git panel — collapsible commit editor** - New `git::ToggleCommitEditor` action. - A chevron beside the commit button hides the editor down to a thin bar; the commit button row stays available. - State persists per workspace via `SerializedGitPanel`, seeded from a new `git_panel.commit_editor` setting (`expanded` | `collapsed`, default `expanded`). - Collapsing clears the fill state — a hidden editor cannot also fill the panel. - `activation_focus_handle` no longer focuses an editor that isn't rendered. **Git Graph — collapsible commit details** - A disclosure folds the author metadata (avatar, refs, email, SHA, provider link) down to a single author + short-sha line. - A second disclosure folds the commit message body. - The changed-files container is already `flex_1().min_h_0()`, so it reclaims the freed space with no other layout change. **Settings plumbing** - `GitPanelCommitEditor` in `settings_content`, wired through `GitPanelSettings`, `assets/settings/default.json`, the settings UI, and `docs/src/reference/all-settings.md`. ## Test plan - [x] `test_toggle_commit_editor_collapsed` added, covering the toggle, persistence of the flag, and the fill/collapse exclusion. - [x] Manually verified in a dev build: chevron hides and restores the editor, Changes list expands into the freed space, action appears in the command palette, state survives a restart, and the `collapsed` setting seeds a new workspace. - [x] Manually verified both disclosures in the Git Graph detail panel with the panel shortened, including that the collapse state survives selecting a different commit. Release Notes: - Improved the Git panel by allowing the commit message editor to be collapsed, and the Git Graph commit details by making the metadata and commit message sections collapsible. ### Evidance Test | Expand | Collapse | Settings Git Panel | | ------- | --------- | ------------------ | | <img width="675" height="965" alt="Screenshot 2026-08-26 at 15 00 46" src="https://github.com/user-attachments/assets/70c56d02-35fc-45ac-988c-24ccd6d1a19e" /> | <img width="661" height="962" alt="Screenshot 2026-08-26 at 15 00 57" src="https://github.com/user-attachments/assets/2c32fa5d-30fc-4f35-8323-afbc2a031210" /> | <img width="1041" height="956" alt="Screenshot 2026-08-26 at 16 50 40" src="https://github.com/user-attachments/assets/67f166b6-5cd9-4430-bba3-fa765715c557" /> | --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
This commit is contained in:
@@ -6124,6 +6124,7 @@ See the [debugger page](../debugger.md) for more information about debugging sup
|
||||
- `tree_view`: Whether to show entries in tree or flat view in the panel
|
||||
- `scrollbar`: When to show the scrollbar in the git panel
|
||||
- `starts_open`: Whether the git panel should open on startup
|
||||
- `commit_editor`: Whether the commit message editor is shown in the git panel by default. Can be `expanded` or `collapsed`
|
||||
- `show_count_badge`: Whether to show a badge on the git panel icon with the count of uncommitted changes
|
||||
- `diff_stats`: Whether to show the addition/deletion change count next to each file in the git panel
|
||||
- `commit_title_max_length`: Maximum length of the commit message title before a warning is shown. Set to `0` to disable
|
||||
|
||||
Reference in New Issue
Block a user