From fa5b0297e49dc95f67f77c398242f70065c3e270 Mon Sep 17 00:00:00 2001 From: Adin Schmidt <9936213+adinschmidt@users.noreply.github.com> Date: Sun, 22 Mar 2026 18:19:28 -0400 Subject: [PATCH] Confirm before initializing git repos --- apps/web/src/components/GitActionsControl.tsx | 52 ++++++++++++++++--- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index 0771875135..ebc1c1bfc4 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 ? (