diff --git a/memento-note/components/sidebar.tsx b/memento-note/components/sidebar.tsx index 824cc0d..21838a1 100644 --- a/memento-note/components/sidebar.tsx +++ b/memento-note/components/sidebar.tsx @@ -547,6 +547,8 @@ export function Sidebar({ className, user }: { className?: string; user?: any }) const next = new Set(prev) if (next.has(id)) { next.delete(id) + // Also collapse the notebook when unpinning + setExpandedIds(e => { const ne = new Set(e); ne.delete(id); return ne }) } else { next.add(id) // Ensure it's also expanded when pinned