diff --git a/memento-note/app/(main)/insights/page.tsx b/memento-note/app/(main)/insights/page.tsx index 296e9dc..6c2ebeb 100644 --- a/memento-note/app/(main)/insights/page.tsx +++ b/memento-note/app/(main)/insights/page.tsx @@ -298,8 +298,8 @@ export default function InsightsPage() {
diff --git a/memento-note/components/network-graph.tsx b/memento-note/components/network-graph.tsx index 9bd868e..82fc8ac 100644 --- a/memento-note/components/network-graph.tsx +++ b/memento-note/components/network-graph.tsx @@ -362,22 +362,27 @@ export function NetworkGraph({ return (
- {/* Pastilles de cluster — cliquables pour activer le focus */} -
- {clusters.map(c => { + {/* Pastilles de cluster — triées par taille, avec compteurs */} +
+ {[...clusters] + .sort((a, b) => b.noteIds.length - a.noteIds.length) + .map(c => { const isSelected = String(c.id) === selectedClusterId return ( ) })} diff --git a/memento-note/components/sidebar.tsx b/memento-note/components/sidebar.tsx index 1c6767d..6169248 100644 --- a/memento-note/components/sidebar.tsx +++ b/memento-note/components/sidebar.tsx @@ -703,6 +703,27 @@ export function Sidebar({ className, user }: { className?: string; user?: any }) const isRemindersRoute = pathname === '/home' && searchParams.get('reminders') === '1' const isSharedRoute = pathname === '/home' && searchParams.get('shared') === '1' const isImmersiveRoute = pathname === '/insights' + + // Sur /insights : sidebar visible par défaut, user peut le cacher via toggle + const [userCollapsed, setUserCollapsed] = useState(false) + useEffect(() => { + if (isImmersiveRoute) { + const stored = localStorage.getItem('insights-sidebar-collapsed') + setUserCollapsed(stored === 'true') + } + }, [isImmersiveRoute]) + + useEffect(() => { + const onToggle = () => { + setUserCollapsed(prev => { + const next = !prev + if (isImmersiveRoute) localStorage.setItem('insights-sidebar-collapsed', String(next)) + return next + }) + } + window.addEventListener('toggle-insights-sidebar', onToggle) + return () => window.removeEventListener('toggle-insights-sidebar', onToggle) + }, [isImmersiveRoute]) const isNotebooksRoute = (pathname === '/home' || pathname.startsWith('/notes')) && !pathname.startsWith('/settings') && @@ -1158,15 +1179,13 @@ export function Sidebar({ className, user }: { className?: string; user?: any })