From eef0dc5bfd9aefe0efccacae164b661bff3b7cac Mon Sep 17 00:00:00 2001 From: viettranx Date: Fri, 10 Apr 2026 23:19:38 +0700 Subject: [PATCH] =?UTF-8?q?fix(ui):=20redesign=20vault=20create=20dialog?= =?UTF-8?q?=20=E2=80=94=20larger=20modal,=20Radix=20components,=20overflow?= =?UTF-8?q?=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace native radio/select with Radix RadioGroup and Select components. Widen modal from max-w-md to max-w-lg, add scroll constraint for long content, fix element overflow on mobile. --- ui/web/src/components/ui/radio-group.tsx | 45 +++++++ .../src/pages/vault/vault-create-dialog.tsx | 113 +++++++++++------- 2 files changed, 112 insertions(+), 46 deletions(-) create mode 100644 ui/web/src/components/ui/radio-group.tsx diff --git a/ui/web/src/components/ui/radio-group.tsx b/ui/web/src/components/ui/radio-group.tsx new file mode 100644 index 00000000..923d3f9f --- /dev/null +++ b/ui/web/src/components/ui/radio-group.tsx @@ -0,0 +1,45 @@ +"use client" + +import * as React from "react" +import { CircleIcon } from "lucide-react" +import { RadioGroup as RadioGroupPrimitive } from "radix-ui" + +import { cn } from "@/lib/utils" + +function RadioGroup({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function RadioGroupItem({ + className, + ...props +}: React.ComponentProps) { + return ( + + + + + + ) +} + +export { RadioGroup, RadioGroupItem } diff --git a/ui/web/src/pages/vault/vault-create-dialog.tsx b/ui/web/src/pages/vault/vault-create-dialog.tsx index 1c7657ad..9ba89841 100644 --- a/ui/web/src/pages/vault/vault-create-dialog.tsx +++ b/ui/web/src/pages/vault/vault-create-dialog.tsx @@ -6,6 +6,10 @@ import { Label } from "@/components/ui/label"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, } from "@/components/ui/dialog"; +import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; +import { + Select, SelectContent, SelectItem, SelectTrigger, SelectValue, +} from "@/components/ui/select"; import { useAgents } from "@/pages/agents/hooks/use-agents"; import { useTeams } from "@/pages/teams/hooks/use-teams"; import { useVaultUpload } from "./hooks/use-vault-upload"; @@ -52,10 +56,8 @@ export function VaultCreateDialog({ open, onOpenChange, onUploaded, defaultAgent const [files, setFiles] = useState([]); const [dragging, setDragging] = useState(false); - // Load teams on first open useEffect(() => { if (open) loadTeams(); }, [open, loadTeams]); - // Reset state when dialog opens; pre-select destination from parent filters useEffect(() => { if (!open) return; setFiles([]); @@ -114,52 +116,71 @@ export function VaultCreateDialog({ open, onOpenChange, onUploaded, defaultAgent return ( - + {t("upload.title", "Upload to Vault")} -
- {/* Destination radio group */} -
+
+ {/* Destination */} +
-
-
+
+ + {destination === "team" && ( +
+ +
+ )} +
+
{/* Drop zone */} @@ -168,7 +189,7 @@ export function VaultCreateDialog({ open, onOpenChange, onUploaded, defaultAgent onDragLeave={() => setDragging(false)} onDrop={onDrop} onClick={() => inputRef.current?.click()} - className={`flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-6 cursor-pointer transition-colors ${ + className={`flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-8 cursor-pointer transition-colors ${ dragging ? "border-primary bg-primary/5" : "border-muted-foreground/25 hover:border-primary/50" }`} > @@ -181,18 +202,18 @@ export function VaultCreateDialog({ open, onOpenChange, onUploaded, defaultAgent {/* File list */} {files.length > 0 && ( -
+
-
+
{files.map((f, i) => ( -
+
{f.name} - {formatBytes(f.size)} -