From f2ede26af7649b42a917a2ad99270e66c84b251f Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Mon, 2 Feb 2026 20:34:37 +0100 Subject: [PATCH] fix(create-repo): directory selection --- .../local-repository-form.tsx | 156 ++++++++++-------- 1 file changed, 83 insertions(+), 73 deletions(-) diff --git a/app/client/modules/repositories/components/repository-forms/local-repository-form.tsx b/app/client/modules/repositories/components/repository-forms/local-repository-form.tsx index ecc1122b..b310c8eb 100644 --- a/app/client/modules/repositories/components/repository-forms/local-repository-form.tsx +++ b/app/client/modules/repositories/components/repository-forms/local-repository-form.tsx @@ -3,7 +3,7 @@ import type { UseFormReturn } from "react-hook-form"; import { Check, Pencil, X, AlertTriangle } from "lucide-react"; import { REPOSITORY_BASE } from "~/client/lib/constants"; import { Button } from "../../../../components/ui/button"; -import { FormItem, FormLabel, FormDescription } from "../../../../components/ui/form"; +import { FormItem, FormLabel, FormDescription, FormField, FormControl } from "../../../../components/ui/form"; import { DirectoryBrowser } from "../../../../components/directory-browser"; import { AlertDialog, @@ -26,79 +26,89 @@ export const LocalRepositoryForm = ({ form }: Props) => { const [showPathWarning, setShowPathWarning] = useState(false); return ( - <> - - Repository Directory -
-
- {form.watch("path") || REPOSITORY_BASE} -
- -
- The directory where the repository will be stored. -
+ ( + <> + + Repository Directory + +
+
+ {field.value || REPOSITORY_BASE} +
+ +
+
+ The directory where the repository will be stored. +
- - - - - - Important: Host mount required - - -

When selecting a custom path, ensure it is mounted from the host machine into the container.

-

- If the path is not a host mount, you will lose your repository data when the container restarts. -

-

- The default path {REPOSITORY_BASE} is safe to use if you - followed the recommended Docker Compose setup. -

-
-
- - Cancel - { - setShowPathBrowser(true); - setShowPathWarning(false); - }} - > - I Understand, Continue - - -
-
+ + + + + + Important: Host mount required + + +

When selecting a custom path, ensure it is mounted from the host machine into the container.

+

+ If the path is not a host mount, you will lose your repository data when the container restarts. +

+

+ The default path {REPOSITORY_BASE} is safe to use if + you followed the recommended Docker Compose setup. +

+
+
+ + Cancel + { + setShowPathBrowser(true); + setShowPathWarning(false); + }} + > + I Understand, Continue + + +
+
- - - - Select Repository Directory - - Choose a directory from the filesystem to store the repository. - - -
- form.setValue("path", path)} - selectedPath={form.watch("path") || REPOSITORY_BASE} - /> -
- - - - Cancel - - setShowPathBrowser(false)}> - - Done - - -
-
- + + + + Select Repository Directory + + Choose a directory from the filesystem to store the repository. + + +
+ { + field.onChange(path); + }} + selectedPath={field.value || REPOSITORY_BASE} + /> +
+ + + + Cancel + + setShowPathBrowser(false)}> + + Done + + +
+
+ + )} + /> ); };