feat: Introduce default delete branch option for worktrees

This commit adds a new feature allowing users to set a default value for the "delete branch" checkbox when deleting a worktree. Key changes include:

1. **State Management**: Introduced `defaultDeleteBranchByProject` to manage the default delete branch setting per project.
2. **UI Components**: Updated the WorktreesSection to include a toggle for the default delete branch option, enhancing user control during worktree deletion.
3. **Dialog Updates**: Modified the DeleteWorktreeDialog to respect the default delete branch setting, improving the user experience by streamlining the deletion process.

These enhancements provide users with more flexibility and control over worktree management, improving overall project workflows.
This commit is contained in:
Kacper
2026-01-10 23:18:39 +01:00
parent aeb5bd829f
commit e902e8ea4c
7 changed files with 204 additions and 63 deletions

View File

@@ -598,6 +598,10 @@ export interface ProjectSettings {
/** Whether to show the init script indicator panel (default: true) */
showInitScriptIndicator?: boolean;
// Worktree Behavior
/** Default value for "delete branch" checkbox when deleting a worktree (default: false) */
defaultDeleteBranchWithWorktree?: boolean;
// Session Tracking
/** Last chat session selected in this project */
lastSelectedSessionId?: string;