git_ui: Add Git Panel settings (#23132)

This PR adds settings for the Git Panel.

The new settings include:

| Setting | Description | Default |
|---------|-------------|---------|
| `git_panel.button` | Toggle visibility of the Git Panel button in the
status bar | `true` |
| `git_panel.dock` | Choose where to dock the Git Panel | `"left"` |
| `git_panel.default_width` | Set the default width of the Git Panel in
pixels | `360` |
| `git_panel.status_style` | Select how Git status is displayed |
`"icon"` |
| `git_panel.scrollbar.show` | Configure scrollbar behavior | Inherits
from editor settings |

Example usage:

```json
"git_panel": {
  "button": true,
  "dock": "left",
  "default_width": 360,
  "status_style": "icon",
  "scrollbar": {
    "show": "auto"
  }
}
```

Release Notes:

- N/A
This commit is contained in:
Nate Butler 2025-01-14 10:40:45 -05:00 committed by GitHub
parent a67709629b
commit 78fd5b5f02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 166 additions and 73 deletions

View file

@ -2,9 +2,9 @@ use ::settings::Settings;
use collections::HashMap;
use futures::{future::FusedFuture, select, FutureExt};
use git::repository::{GitFileStatus, GitRepository, RepoPath};
use git_panel_settings::GitPanelSettings;
use gpui::{actions, AppContext, Context, Global, Hsla, Model, ModelContext};
use project::{Project, WorktreeId};
use settings::GitPanelSettings;
use std::sync::mpsc;
use std::{
pin::{pin, Pin},
@ -16,7 +16,7 @@ use ui::{Color, Icon, IconName, IntoElement, SharedString};
use worktree::RepositoryEntry;
pub mod git_panel;
mod settings;
mod git_panel_settings;
const GIT_TASK_DEBOUNCE: Duration = Duration::from_millis(50);