diff --git a/frontend/src/components/tasks/TaskDetailsToolbar.tsx b/frontend/src/components/tasks/TaskDetailsToolbar.tsx index b4ba8ff8..4040e920 100644 --- a/frontend/src/components/tasks/TaskDetailsToolbar.tsx +++ b/frontend/src/components/tasks/TaskDetailsToolbar.tsx @@ -130,6 +130,7 @@ export function TaskDetailsToolbar({ const [rebasing, setRebasing] = useState(false); const [rebaseSuccess, setRebaseSuccess] = useState(false); const [showUncommittedWarning, setShowUncommittedWarning] = useState(false); + const [showMergeConfirmDialog, setShowMergeConfirmDialog] = useState(false); const [creatingPR, setCreatingPR] = useState(false); const [showCreatePRDialog, setShowCreatePRDialog] = useState(false); const [prTitle, setPrTitle] = useState(''); @@ -186,7 +187,8 @@ export function TaskDetailsToolbar({ return; } - await performMerge(); + // Show confirmation dialog for regular merge + setShowMergeConfirmDialog(true); }; const performMerge = async () => { @@ -228,6 +230,15 @@ export function TaskDetailsToolbar({ setShowUncommittedWarning(false); }; + const handleConfirmMerge = async () => { + setShowMergeConfirmDialog(false); + await performMerge(); + }; + + const handleCancelMerge = () => { + setShowMergeConfirmDialog(false); + }; + const handleRebaseClick = async () => { if (!projectId || !task.id || !selectedAttempt?.id) return; @@ -923,6 +934,43 @@ export function TaskDetailsToolbar({ )} + {/* Merge Confirmation Dialog */} + handleCancelMerge()} + > + + + Confirm Merge + + Are you sure you want to merge the changes from this task branch + into {branchStatus?.base_branch_name || 'the base branch'}? + + + + + + This will merge all committed changes from the task branch into{' '} + {branchStatus?.base_branch_name || 'the base branch'}. This + action cannot be undone. + + + + + + Cancel + + + {merging ? 'Merging...' : 'Confirm Merge'} + + + + + {/* Uncommitted Changes Warning Dialog */}
+ This will merge all committed changes from the task branch into{' '} + {branchStatus?.base_branch_name || 'the base branch'}. This + action cannot be undone. +