From 1ed7839334d8645a30dcf2464ef2b8f45cd371a8 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Sun, 3 May 2026 19:43:57 +0000 Subject: [PATCH] fix: notebook name overflows sidebar on hover with bold + opaque background instead of tooltip overlay --- memento-note/components/notebooks-list.tsx | 40 ++++++---------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/memento-note/components/notebooks-list.tsx b/memento-note/components/notebooks-list.tsx index b6a05f9..460a537 100644 --- a/memento-note/components/notebooks-list.tsx +++ b/memento-note/components/notebooks-list.tsx @@ -18,34 +18,14 @@ import { useLabels } from '@/context/LabelContext' import { LabelManagementDialog } from '@/components/label-management-dialog' import { Notebook } from '@/lib/types' import { getNotebookIcon } from '@/lib/notebook-icon' -import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' - -function NotebookNameTooltip({ name, children }: { name: string; children: React.ReactNode }) { - const spanRef = useRef(null) - const [isTruncated, setIsTruncated] = useState(false) - - const checkTruncation = useCallback((node: HTMLSpanElement | null) => { - if (!node) return - setIsTruncated(node.scrollWidth > node.clientWidth) - }, []) +function NotebookName({ children }: { name: string; children: React.ReactNode }) { return ( - - - { spanRef.current = el; checkTruncation(el) }} - onMouseEnter={() => checkTruncation(spanRef.current)} - className="truncate min-w-0" - > - {children} - - - {isTruncated && ( - - {name} - - )} - + + + {children} + + ) } @@ -182,14 +162,14 @@ export function NotebooksList() { className={cn("w-5 h-5 flex-shrink-0 fill-current", !notebook.color && "text-primary dark:text-primary-foreground")} style={notebook.color ? { color: notebook.color } : undefined} /> - + {notebook.name} - +
{/* Actions menu for active notebook */} @@ -273,11 +253,11 @@ export function NotebooksList() { )} > - + {notebook.name} - + {(notebook as any).notesCount > 0 && ( ({new Intl.NumberFormat(language).format((notebook as any).notesCount)}) )}