diff --git a/src/ui/components/graph/GraphExplorer.tsx b/src/ui/components/graph/GraphExplorer.tsx index c2b38a60d..bfd63b225 100644 --- a/src/ui/components/graph/GraphExplorer.tsx +++ b/src/ui/components/graph/GraphExplorer.tsx @@ -3,13 +3,19 @@ import GraphVisualization from './Visualization.tsx'; import type { KnowledgeGraph } from '../../../core/graph/types.ts'; interface GraphExplorerProps { - graph: KnowledgeGraph | null; + graph: KnowledgeGraph; isLoading: boolean; + onNodeSelect?: (nodeId: string | null) => void; } -export default function GraphExplorer({ graph, isLoading }: GraphExplorerProps) { +export default function GraphExplorer({ graph, isLoading, onNodeSelect }: GraphExplorerProps) { const [selectedNode, setSelectedNode] = useState(null); + const handleNodeSelect = (nodeId: string | null) => { + setSelectedNode(nodeId); + onNodeSelect?.(nodeId); // Notify parent component + }; + const containerStyle: React.CSSProperties = { width: '100%', height: '100%', @@ -39,7 +45,7 @@ export default function GraphExplorer({ graph, isLoading }: GraphExplorerProps)
diff --git a/src/ui/pages/HomePage.tsx b/src/ui/pages/HomePage.tsx index 32161ac7f..409872d2f 100644 --- a/src/ui/pages/HomePage.tsx +++ b/src/ui/pages/HomePage.tsx @@ -74,6 +74,10 @@ const HomePage: React.FC = () => { setState(prev => ({ ...prev, ...updates })); }, []); + const handleNodeSelect = (nodeId: string | null) => { + updateState({ selectedNodeId: nodeId }); + }; + // Save LLM settings to localStorage useEffect(() => { if (state.llmApiKey) { @@ -819,6 +823,7 @@ const HomePage: React.FC = () => {