feat: implement worktree session creation and management

- Added `createWorktreeSession` utility to handle the creation of new sessions with auto-generated worktrees.
- Introduced branch name generation utilities for creating unique and friendly branch names.
- Updated `CommandPalette` to trigger worktree session creation via a command.
- Refactored keyboard shortcuts to support new worktree session creation with Shift + Cmd/Ctrl + N.
- Enhanced project settings to include worktree defaults (branch prefix, base branch, auto-create option).
- Updated persistence logic to preserve worktree defaults when saving project settings.
- Modified menu actions to initiate new worktree sessions.
- Ensured proper handling of existing branches to avoid conflicts during worktree creation.
This commit is contained in:
Bohdan Triapitsyn
2026-01-07 22:06:28 +02:00
parent 4f6eea9ea5
commit d92a1ab297
14 changed files with 1004 additions and 883 deletions
+7
View File
@@ -334,12 +334,19 @@ export interface FilesAPI {
execCommands?(commands: string[], cwd: string): Promise<{ success: boolean; results: CommandExecResult[] }>;
}
export interface WorktreeDefaults {
branchPrefix?: string; // e.g. "feature", "bugfix" (no trailing slash)
baseBranch?: string; // e.g. "main", "develop", or "HEAD"
autoCreateWorktree?: boolean; // future: skip dialog, create worktree automatically
}
export interface ProjectEntry {
id: string;
path: string;
label?: string;
addedAt?: number;
lastOpenedAt?: number;
worktreeDefaults?: WorktreeDefaults;
}
export interface SettingsPayload {