Allow user-defined worktree names in title bar and platform windows (#36713)

Closes #36637 

Release Notes:
- Adds the ability to specify a human-readable project name for each
worktree.


https://github.com/user-attachments/assets/ce980fa6-65cf-46d7-9343-d08c800914fd
This commit is contained in:
Warpten
2025-09-09 11:50:58 -06:00
committed by GitHub
parent a2edd56587
commit d81479ee57
4 changed files with 44 additions and 11 deletions
+9
View File
@@ -9,6 +9,7 @@ use util::paths::PathMatcher;
#[derive(Clone, PartialEq, Eq)]
pub struct WorktreeSettings {
pub project_name: Option<String>,
pub file_scan_inclusions: PathMatcher,
pub file_scan_exclusions: PathMatcher,
pub private_files: PathMatcher,
@@ -34,6 +35,13 @@ impl WorktreeSettings {
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema, SettingsUi, SettingsKey)]
#[settings_key(None)]
pub struct WorktreeSettingsContent {
/// The displayed name of this project. If not set, the root directory name
/// will be displayed.
///
/// Default: none
#[serde(default)]
pub project_name: Option<String>,
/// Completely ignore files matching globs from `file_scan_exclusions`. Overrides
/// `file_scan_inclusions`.
///
@@ -93,6 +101,7 @@ impl Settings for WorktreeSettings {
&parsed_file_scan_inclusions,
"file_scan_inclusions",
)?,
project_name: result.project_name,
})
}