mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 06:42:03 +00:00
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:
@@ -50,7 +50,7 @@ export function useInitScriptEvents(projectPath: string | null) {
|
||||
switch (event.type) {
|
||||
case 'worktree:init-started': {
|
||||
const startPayload = payload as InitScriptStartedPayload;
|
||||
setInitScriptState(projectPath, {
|
||||
setInitScriptState(projectPath, startPayload.branch, {
|
||||
status: 'running',
|
||||
branch: startPayload.branch,
|
||||
output: [],
|
||||
@@ -60,12 +60,12 @@ export function useInitScriptEvents(projectPath: string | null) {
|
||||
}
|
||||
case 'worktree:init-output': {
|
||||
const outputPayload = payload as InitScriptOutputPayload;
|
||||
appendInitScriptOutput(projectPath, outputPayload.content);
|
||||
appendInitScriptOutput(projectPath, outputPayload.branch, outputPayload.content);
|
||||
break;
|
||||
}
|
||||
case 'worktree:init-completed': {
|
||||
const completePayload = payload as InitScriptCompletedPayload;
|
||||
setInitScriptState(projectPath, {
|
||||
setInitScriptState(projectPath, completePayload.branch, {
|
||||
status: completePayload.success ? 'success' : 'failed',
|
||||
error: completePayload.error,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user