From 83c8c46f310a8b504b278ca46d665f4c52af0208 Mon Sep 17 00:00:00 2001 From: Neo <54811660+neooriginal@users.noreply.github.com> Date: Wed, 21 Jan 2026 23:21:05 +0100 Subject: [PATCH 1/2] Update FolderDialog.tsx --- .../components/conversations/FolderDialog.tsx | 501 +++++++++--------- 1 file changed, 262 insertions(+), 239 deletions(-) diff --git a/web/app/src/components/conversations/FolderDialog.tsx b/web/app/src/components/conversations/FolderDialog.tsx index b906f36248..a40a0a2eac 100644 --- a/web/app/src/components/conversations/FolderDialog.tsx +++ b/web/app/src/components/conversations/FolderDialog.tsx @@ -1,6 +1,8 @@ 'use client'; import { useState, useEffect } from 'react'; +import { createPortal } from 'react-dom'; + import { motion, AnimatePresence } from 'framer-motion'; import { X, Loader2, FolderPlus, Pencil } from 'lucide-react'; import { cn } from '@/lib/utils'; @@ -60,7 +62,15 @@ export function FolderDialog({ const isValid = name.trim().length > 0; - return ( + // Handle hydration + const [mounted, setMounted] = useState(false); + useEffect(() => { + setMounted(true); + }, []); + + if (!mounted) return null; + + return createPortal( {isOpen && ( <> @@ -73,200 +83,203 @@ export function FolderDialog({ className="fixed inset-0 z-50 bg-black/60 backdrop-blur-sm" /> - {/* Dialog */} - - {/* Close button */} - + {/* Close button */} + - {/* Icon */} -
- {isEditing ? ( - - ) : ( - - )} -
+ {/* Icon */} +
+ {isEditing ? ( + + ) : ( + + )} +
- {/* Title */} -

- {isEditing ? 'Edit Folder' : 'Create Folder'} -

+ {/* Title */} +

+ {isEditing ? 'Edit Folder' : 'Create Folder'} +

-
- {/* Folder name input */} -
- -
- {emoji} - setName(e.target.value)} - placeholder="Enter folder name..." + + {/* Folder name input */} +
+ +
+ {emoji} + setName(e.target.value)} + placeholder="Enter folder name..." + disabled={isLoading} + maxLength={100} + className={cn( + 'flex-1 px-3 py-2 rounded-lg', + 'bg-bg-tertiary border border-bg-quaternary', + 'text-text-primary placeholder:text-text-quaternary', + 'focus:outline-none focus:ring-2 focus:ring-purple-primary/50', + 'disabled:opacity-50' + )} + autoFocus + /> +
+
+ + {/* Description input */} +
+ +