diff --git a/surfsense_web/components/documents/DocumentNode.tsx b/surfsense_web/components/documents/DocumentNode.tsx index 33ce2bf26..92a211277 100644 --- a/surfsense_web/components/documents/DocumentNode.tsx +++ b/surfsense_web/components/documents/DocumentNode.tsx @@ -12,6 +12,7 @@ import { Trash2, } from "lucide-react"; import React, { useCallback, useRef, useState } from "react"; +import { useIsMobile } from "@/hooks/use-mobile"; import { useDrag } from "react-dnd"; import { getDocumentTypeIcon } from "@/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentTypeIcon"; import { ExportContextItems, ExportDropdownItems } from "@/components/shared/ExportMenuItems"; @@ -106,7 +107,10 @@ export const DocumentNode = React.memo(function DocumentNode({ const isProcessing = statusState === "pending" || statusState === "processing"; const [dropdownOpen, setDropdownOpen] = useState(false); const [exporting, setExporting] = useState(null); + const [titleTooltipOpen, setTitleTooltipOpen] = useState(false); const rowRef = useRef(null); + const titleRef = useRef(null); + const isMobile = useIsMobile(); const handleExport = useCallback( (format: string) => { @@ -118,6 +122,18 @@ export const DocumentNode = React.memo(function DocumentNode({ [doc, onExport] ); + const handleTitleTooltipOpenChange = useCallback( + (open: boolean) => { + if (isMobile) return; + if (open && titleRef.current) { + setTitleTooltipOpen(titleRef.current.scrollWidth > titleRef.current.clientWidth); + } else { + setTitleTooltipOpen(false); + } + }, + [isMobile] + ); + const attachRef = useCallback( (node: HTMLDivElement | null) => { (rowRef as React.MutableRefObject).current = node; @@ -197,7 +213,14 @@ export const DocumentNode = React.memo(function DocumentNode({ ); })()} - {doc.title} + + + {doc.title} + + + {doc.title} + + {getDocumentTypeIcon( doc.document_type as DocumentTypeEnum, diff --git a/surfsense_web/components/new-chat/chat-share-button.tsx b/surfsense_web/components/new-chat/chat-share-button.tsx index 82e8c6a78..4fc35aba1 100644 --- a/surfsense_web/components/new-chat/chat-share-button.tsx +++ b/surfsense_web/components/new-chat/chat-share-button.tsx @@ -163,21 +163,16 @@ export function ChatShareButton({ thread, onVisibilityChange, className }: ChatS )} - - - - - - - Share settings - + + +