diff --git a/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentsTableShell.tsx b/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentsTableShell.tsx index e933621cd..94c0626e6 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentsTableShell.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentsTableShell.tsx @@ -144,10 +144,7 @@ export function DocumentsTableShell({ Get started by uploading your first document.

- diff --git a/surfsense_web/components/assistant-ui/document-upload-popup.tsx b/surfsense_web/components/assistant-ui/document-upload-popup.tsx index c1a2512fb..f522b57dc 100644 --- a/surfsense_web/components/assistant-ui/document-upload-popup.tsx +++ b/surfsense_web/components/assistant-ui/document-upload-popup.tsx @@ -1,7 +1,15 @@ "use client"; import { useAtomValue } from "jotai"; -import { type FC, createContext, useContext, useState, useCallback, useRef, type ReactNode } from "react"; +import { + type FC, + createContext, + useContext, + useState, + useCallback, + useRef, + type ReactNode, +} from "react"; import { useRouter } from "next/navigation"; import { activeSearchSpaceIdAtom } from "@/atoms/search-spaces/search-space-query.atoms"; import { Dialog, DialogContent } from "@/components/ui/dialog"; @@ -45,19 +53,22 @@ export const DocumentUploadDialogProvider: FC<{ children: ReactNode }> = ({ chil }, 300); }, []); - const handleOpenChange = useCallback((open: boolean) => { - if (!open) { - // Only close if not already in closing state - if (!isClosingRef.current) { - closeDialog(); + const handleOpenChange = useCallback( + (open: boolean) => { + if (!open) { + // Only close if not already in closing state + if (!isClosingRef.current) { + closeDialog(); + } + } else { + // Only open if not in the middle of closing + if (!isClosingRef.current) { + setIsOpen(true); + } } - } else { - // Only open if not in the middle of closing - if (!isClosingRef.current) { - setIsOpen(true); - } - } - }, [closeDialog]); + }, + [closeDialog] + ); return ( @@ -98,4 +109,3 @@ const DocumentUploadPopupContent: FC<{ ); }; - diff --git a/surfsense_web/components/sources/DocumentUploadTab.tsx b/surfsense_web/components/sources/DocumentUploadTab.tsx index 5676f21a9..e3328b9bd 100644 --- a/surfsense_web/components/sources/DocumentUploadTab.tsx +++ b/surfsense_web/components/sources/DocumentUploadTab.tsx @@ -9,7 +9,12 @@ import { useCallback, useMemo, useState, useRef } from "react"; import { useDropzone } from "react-dropzone"; import { toast } from "sonner"; import { uploadDocumentMutationAtom } from "@/atoms/documents/document-mutation.atoms"; -import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion"; +import { + Accordion, + AccordionContent, + AccordionItem, + AccordionTrigger, +} from "@/components/ui/accordion"; import { Alert, AlertDescription } from "@/components/ui/alert"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; @@ -201,8 +206,8 @@ export function DocumentUploadTab({ searchSpaceId, onSuccess }: DocumentUploadTa {...getRootProps()} className="flex flex-col items-center justify-center min-h-[200px] sm:min-h-[300px] border-2 border-dashed border-border rounded-lg hover:border-primary/50 transition-colors cursor-pointer" > - )}
-
- @@ -352,14 +363,22 @@ export function DocumentUploadTab({ searchSpaceId, onSuccess }: DocumentUploadTa )} - +
-
{t("supported_file_types")}
-
{t("file_types_desc")}
+
+ {t("supported_file_types")} +
+
+ {t("file_types_desc")} +