diff --git a/lightrag_webui/src/features/DocumentManager.tsx b/lightrag_webui/src/features/DocumentManager.tsx index 7f308610..962ed90b 100644 --- a/lightrag_webui/src/features/DocumentManager.tsx +++ b/lightrag_webui/src/features/DocumentManager.tsx @@ -147,16 +147,6 @@ export default function DocumentManager() { const cardContent = cardContentRef.current; if (!cardContent) return; - const cardRect = cardContent.getBoundingClientRect(); - const cardMiddleY = cardRect.top + cardRect.height / 2; - - // Get table element to check its height - const tableElement = cardContent.querySelector('table'); - const tableHeight = tableElement?.offsetHeight || 0; - - // Determine if table is small (less than 3 rows approximately) - const isSmallTable = tableHeight < 150; - // Get all visible tooltips const visibleTooltips = document.querySelectorAll('.group:hover > div[class*="invisible group-hover:visible absolute"]'); @@ -167,45 +157,29 @@ export default function DocumentManager() { const triggerRect = triggerElement.getBoundingClientRect(); - // If table is small, use fixed positioning - if (isSmallTable) { - tooltip.classList.add('tooltip-fixed'); + // Use fixed positioning for all tooltips + tooltip.classList.add('tooltip-fixed'); - // Calculate position based on trigger element and mouse - const tooltipHeight = tooltip.offsetHeight; - const viewportHeight = window.innerHeight; + // Calculate position based on trigger element and mouse + const tooltipHeight = tooltip.offsetHeight; + const viewportHeight = window.innerHeight; - // Check if tooltip would go off the bottom of the viewport - const wouldOverflowBottom = event.clientY + tooltipHeight > viewportHeight; - - if (wouldOverflowBottom) { - // Position above the trigger - tooltip.style.top = `${triggerRect.top - tooltipHeight - 5}px`; - tooltip.style.bottom = 'auto'; - } else { - // Position below the trigger - tooltip.style.top = `${triggerRect.bottom + 5}px`; - tooltip.style.bottom = 'auto'; - } - - // Horizontal positioning - tooltip.style.left = `${triggerRect.left}px`; - tooltip.style.maxWidth = '800px'; + // Check if tooltip would go off the bottom of the viewport + const wouldOverflowBottom = event.clientY + tooltipHeight > viewportHeight; + if (wouldOverflowBottom) { + // Position above the trigger + tooltip.style.top = `${triggerRect.top - tooltipHeight - 5}px`; + tooltip.style.bottom = 'auto'; } else { - // For normal sized tables, use the original logic - tooltip.classList.remove('tooltip-fixed'); - tooltip.style.top = ''; - tooltip.style.left = ''; - tooltip.style.bottom = ''; - - // If mouse is in the bottom half of the card, show tooltip above - if (event.clientY > cardMiddleY) { - tooltip.classList.add('tooltip-top'); - } else { - tooltip.classList.remove('tooltip-top'); - } + // Position below the trigger + tooltip.style.top = `${triggerRect.bottom + 5}px`; + tooltip.style.bottom = 'auto'; } + + // Horizontal positioning + tooltip.style.left = `${triggerRect.left}px`; + tooltip.style.maxWidth = '600px'; }); }; @@ -384,14 +358,14 @@ export default function DocumentManager() { {Object.entries(docs.statuses).map(([status, documents]) => documents.map((doc) => ( - + {showFileName ? ( <>
- {getDisplayFileName(doc, 35)} + {getDisplayFileName(doc, 25)}
-
+
{doc.file_path}
@@ -402,18 +376,18 @@ export default function DocumentManager() {
{doc.id}
-
+
{doc.file_path}
)} - +
{doc.content_summary}
-
+
{doc.content_summary}