diff --git a/surfsense_web/components/layout/ui/sidebar/DocumentsSidebar.tsx b/surfsense_web/components/layout/ui/sidebar/DocumentsSidebar.tsx index fc8db0386..990a4eb99 100644 --- a/surfsense_web/components/layout/ui/sidebar/DocumentsSidebar.tsx +++ b/surfsense_web/components/layout/ui/sidebar/DocumentsSidebar.tsx @@ -205,7 +205,6 @@ function AuthenticatedDocumentsSidebar({ const [filesystemSettings, setFilesystemSettings] = useState(null); const [localTrustDialogOpen, setLocalTrustDialogOpen] = useState(false); const [pendingLocalPath, setPendingLocalPath] = useState(null); - const [draggedLocalRootPath, setDraggedLocalRootPath] = useState(null); const [watchedFolderIds, setWatchedFolderIds] = useState>(new Set()); const [folderWatchOpen, setFolderWatchOpen] = useAtom(folderWatchDialogOpenAtom); const [watchInitialFolder, setWatchInitialFolder] = useAtom(folderWatchInitialFolderAtom); @@ -260,26 +259,6 @@ function AuthenticatedDocumentsSidebar({ [electronAPI, localRootPaths] ); - const handleReorderFilesystemRoots = useCallback( - async (draggedPath: string, targetPath: string) => { - if (!electronAPI?.setAgentFilesystemSettings) return; - if (draggedPath === targetPath) return; - const fromIndex = localRootPaths.indexOf(draggedPath); - const toIndex = localRootPaths.indexOf(targetPath); - if (fromIndex < 0 || toIndex < 0) return; - const nextLocalRootPaths = [...localRootPaths]; - const [movedPath] = nextLocalRootPaths.splice(fromIndex, 1); - if (!movedPath) return; - nextLocalRootPaths.splice(toIndex, 0, movedPath); - const updated = await electronAPI.setAgentFilesystemSettings({ - mode: "desktop_local_folder", - localRootPaths: nextLocalRootPaths, - }); - setFilesystemSettings(updated); - }, - [electronAPI, localRootPaths] - ); - const runPickLocalRoot = useCallback(async () => { if (!electronAPI?.pickAgentFilesystemRoot) return; const picked = await electronAPI.pickAgentFilesystemRoot(); @@ -1230,30 +1209,7 @@ function AuthenticatedDocumentsSidebar({ event.preventDefault()} - draggable - onDragStart={(event) => { - event.dataTransfer.setData("text/plain", rootPath); - event.dataTransfer.effectAllowed = "move"; - setDraggedLocalRootPath(rootPath); - }} - onDragOver={(event) => { - event.preventDefault(); - event.dataTransfer.dropEffect = "move"; - }} - onDrop={(event) => { - event.preventDefault(); - const sourcePath = - event.dataTransfer.getData("text/plain") || draggedLocalRootPath; - if (!sourcePath) return; - void handleReorderFilesystemRoots(sourcePath, rootPath); - setDraggedLocalRootPath(null); - }} - onDragEnd={() => { - setDraggedLocalRootPath(null); - }} - className={`group h-8 gap-1.5 px-1.5 text-sm text-foreground ${ - draggedLocalRootPath === rootPath ? "bg-muted/60" : "" - }`} + className="group h-8 gap-1.5 px-1.5 text-sm text-foreground" >