git_ui: Add starts_open setting to git panel (#51601)
Matt Van Horn
,
Matt Van Horn
, and
Claude Opus 4.6 (1M context)
created
Fixes #51542
Adds a `git_panel.starts_open` setting for parity with `project_panel`.
When set to `true`, the git panel opens automatically in new workspaces
that don't have saved panel state.
The default is `false`, matching current behavior (non-breaking).
### Usage
```json
{
"git_panel": {
"starts_open": true
}
}
```
### Implementation
Follows the same pattern as `project_panel.starts_open`:
1. `GitPanelSettingsContent` - added `starts_open: Option<bool>` to the
settings schema
2. `GitPanelSettings` - added `starts_open: bool` field
3. `GitPanel` Panel impl - overrides `starts_open()` to read from
settings
Release Notes:
- Added `git_panel.starts_open` setting to control whether the git panel
opens automatically in new workspaces (default: false)
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@@ -922,6 +922,10 @@
///
/// Default: false
"tree_view": false,
+ // Whether the git panel should open on startup.
+ //
+ // Default: false
+ "starts_open": false,
// Whether to show a badge on the git panel icon with the count of uncommitted changes.
//
// Default: false
@@ -5097,7 +5097,8 @@ See the [debugger page](../debugger.md) for more information about debugging sup
"collapse_untracked_diff": false,
"scrollbar": {
"show": null
- }
+ },
+ "starts_open": false
}
}
```
@@ -5112,6 +5113,7 @@ See the [debugger page](../debugger.md) for more information about debugging sup
- `sort_by_path`: Whether to sort entries in the panel by path or by status (the default)
- `collapse_untracked_diff`: Whether to collapse untracked files in the diff panel
- `scrollbar`: When to show the scrollbar in the git panel
+- `starts_open`: Whether the git panel should open on startup
## Git Worktree Directory