From 8b7bda30fa4b4d6a4018a206d49eddf492c464cf Mon Sep 17 00:00:00 2001 From: Sreeram Date: Mon, 23 Mar 2026 16:59:43 +0530 Subject: [PATCH] feat: improve dashboard navigation for large graphs - Enable touchpad panning (panOnScroll) so two-finger scroll pans instead of zooming - Color-code layer groups with distinct colors (blue, green, purple, gold, pink, teal, slate) instead of identical gold for all layers - Show NodeInfo panel alongside LearnPanel when a node is clicked, so connections are always accessible regardless of persona mode - Add clickable connections in NodeInfo sidebar that navigate and zoom to the target node - Add edge highlighting on node selection: connected edges glow, unrelated nodes/edges dim to 20% opacity - Add focus mode to isolate a node's 1-hop neighborhood - Set minZoom=0.05, maxZoom=4, and scale dagre spacing for 50+ nodes --- .../packages/dashboard/src/App.tsx | 23 +-- .../dashboard/src/components/CustomNode.tsx | 9 ++ .../dashboard/src/components/GraphView.tsx | 133 ++++++++++++++---- .../dashboard/src/components/LayerLegend.tsx | 68 ++++----- .../dashboard/src/components/NodeInfo.tsx | 24 +++- .../packages/dashboard/src/store.ts | 13 ++ .../packages/dashboard/src/utils/layout.ts | 7 +- 7 files changed, 199 insertions(+), 78 deletions(-) diff --git a/understand-anything-plugin/packages/dashboard/src/App.tsx b/understand-anything-plugin/packages/dashboard/src/App.tsx index 50df460..f64a293 100644 --- a/understand-anything-plugin/packages/dashboard/src/App.tsx +++ b/understand-anything-plugin/packages/dashboard/src/App.tsx @@ -1,4 +1,5 @@ import { useEffect, useState } from "react"; +import { ReactFlowProvider } from "@xyflow/react"; import { validateGraph } from "@understand-anything/core/schema"; import { useDashboardStore } from "./store"; import GraphView from "./components/GraphView"; @@ -68,13 +69,15 @@ function App() { }, [setDiffOverlay]); // Determine sidebar content - // Learn persona always shows LearnPanel; tour active overrides everything - const sidebarContent = tourActive || persona === "junior" ? ( - - ) : selectedNodeId ? ( - - ) : ( - + // Learn mode shows LearnPanel + NodeInfo when a node is selected + // Other modes show NodeInfo when selected, ProjectOverview otherwise + const isLearnMode = tourActive || persona === "junior"; + const sidebarContent = ( + <> + {isLearnMode && } + {selectedNodeId && } + {!selectedNodeId && !isLearnMode && } + ); return ( @@ -108,11 +111,13 @@ function App() {
{/* Graph area */}
- + + +
{/* Right sidebar */} -