diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index 077187513..ebc1c1bfc 100644 --- a/apps/web/src/components/GitActionsControl.tsx +++ b/apps/web/src/components/GitActionsControl.tsx @@ -18,6 +18,15 @@ import { import { useAppSettings } from "~/appSettings"; import { Button } from "~/components/ui/button"; import { Checkbox } from "~/components/ui/checkbox"; +import { + AlertDialog, + AlertDialogClose, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogPopup, + AlertDialogTitle, +} from "~/components/ui/alert-dialog"; import { Dialog, DialogDescription, @@ -161,6 +170,7 @@ export default function GitActionsControl({ gitCwd, activeThreadId }: GitActions [activeThreadId], ); const queryClient = useQueryClient(); + const [confirmInitOpen, setConfirmInitOpen] = useState(false); const [isCommitDialogOpen, setIsCommitDialogOpen] = useState(false); const [dialogCommitMessage, setDialogCommitMessage] = useState(""); const [excludedFiles, setExcludedFiles] = useState>(new Set()); @@ -632,19 +642,45 @@ export default function GitActionsControl({ gitCwd, activeThreadId }: GitActions [gitCwd, threadToastData], ); + const confirmGitInit = useCallback(() => { + if (initMutation.isPending) return; + setConfirmInitOpen(false); + initMutation.mutate(); + }, [initMutation]); + if (!gitCwd) return null; return ( <> {!isRepo ? ( - + <> + + + + + Initialize Git repository? + + This will run{" "} + git init in{" "} + {gitCwd} + + + + }>Cancel + + + + + ) : ( {quickActionDisabledReason ? (