diff --git a/surfsense_web/components/documents/DocumentNode.tsx b/surfsense_web/components/documents/DocumentNode.tsx index e55512e96..4acdcf662 100644 --- a/surfsense_web/components/documents/DocumentNode.tsx +++ b/surfsense_web/components/documents/DocumentNode.tsx @@ -1,7 +1,7 @@ "use client"; import { AlertCircle, Clock, Eye, MoreHorizontal, Move, PenLine, Trash2 } from "lucide-react"; -import React, { useCallback, useRef } from "react"; +import React, { useCallback, useRef, useState } from "react"; import { useDrag } from "react-dnd"; import { getDocumentTypeIcon } from "@/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentTypeIcon"; import { Button } from "@/components/ui/button"; @@ -78,6 +78,7 @@ export const DocumentNode = React.memo(function DocumentNode({ ); const isProcessing = statusState === "pending" || statusState === "processing"; + const [dropdownOpen, setDropdownOpen] = useState(false); const rowRef = useRef(null); const attachRef = useCallback( @@ -95,9 +96,9 @@ export const DocumentNode = React.memo(function DocumentNode({ type="button" ref={attachRef} className={cn( - "group flex h-8 w-full items-center gap-2.5 rounded-md px-1 text-sm hover:bg-accent/50 cursor-pointer select-none text-left", - isMentioned && "bg-accent/30", - isDragging && "opacity-40" + "group flex h-8 w-full items-center gap-2.5 rounded-md px-1 text-sm hover:bg-accent/50 cursor-pointer select-none text-left", + isMentioned && "bg-accent/30", + isDragging && "opacity-40" )} style={{ paddingLeft: `${depth * 16 + 4}px` }} onClick={handleCheckChange} @@ -160,14 +161,17 @@ export const DocumentNode = React.memo(function DocumentNode({ )} - - - diff --git a/surfsense_web/components/layout/ui/sidebar/AllPrivateChatsSidebar.tsx b/surfsense_web/components/layout/ui/sidebar/AllPrivateChatsSidebar.tsx index fc5fb3873..65a24208b 100644 --- a/surfsense_web/components/layout/ui/sidebar/AllPrivateChatsSidebar.tsx +++ b/surfsense_web/components/layout/ui/sidebar/AllPrivateChatsSidebar.tsx @@ -396,10 +396,13 @@ export function AllPrivateChatsSidebarContent({ variant="ghost" size="icon" className={cn( - "h-6 w-6 shrink-0", + "h-6 w-6 shrink-0 hover:bg-transparent", isMobile ? "opacity-0 pointer-events-none absolute" - : "md:opacity-0 md:group-hover:opacity-100 md:focus:opacity-100", + : openDropdownId === thread.id + ? "opacity-100" + : "md:opacity-0 md:group-hover:opacity-100 md:focus:opacity-100", + openDropdownId === thread.id && "bg-accent hover:bg-accent", "transition-opacity" )} disabled={isBusy} diff --git a/surfsense_web/components/layout/ui/sidebar/AllSharedChatsSidebar.tsx b/surfsense_web/components/layout/ui/sidebar/AllSharedChatsSidebar.tsx index 03673955a..ce0e45e81 100644 --- a/surfsense_web/components/layout/ui/sidebar/AllSharedChatsSidebar.tsx +++ b/surfsense_web/components/layout/ui/sidebar/AllSharedChatsSidebar.tsx @@ -396,10 +396,13 @@ export function AllSharedChatsSidebarContent({ variant="ghost" size="icon" className={cn( - "h-6 w-6 shrink-0", + "h-6 w-6 shrink-0 hover:bg-transparent", isMobile ? "opacity-0 pointer-events-none absolute" - : "md:opacity-0 md:group-hover:opacity-100 md:focus:opacity-100", + : openDropdownId === thread.id + ? "opacity-100" + : "md:opacity-0 md:group-hover:opacity-100 md:focus:opacity-100", + openDropdownId === thread.id && "bg-accent hover:bg-accent", "transition-opacity" )} disabled={isBusy} diff --git a/surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx b/surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx index fc0520745..7f3089a89 100644 --- a/surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx +++ b/surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx @@ -79,14 +79,21 @@ export function ChatListItem({ : "bg-gradient-to-l from-sidebar from-60% to-transparent group-hover/item:from-accent", isMobile ? "opacity-0" - : isActive + : isActive || dropdownOpen ? "opacity-100" : "opacity-0 group-hover/item:opacity-100" )} > -