From b82efea88e113f651c38b5a97377d9698e8dec8b Mon Sep 17 00:00:00 2001 From: Lum1104 Date: Mon, 16 Mar 2026 14:34:11 +0800 Subject: [PATCH] fix(dashboard): enable click and expand for all node types (function, class, etc.) Previously only FILE nodes responded to clicks with the code viewer overlay. Now all node types open the detail viewer on click. Also added a direct click handler on CustomNode to fix click events not firing for child nodes inside group layers on Windows. Bump version to 1.0.4. --- .claude-plugin/marketplace.json | 2 +- understand-anything-plugin/package.json | 2 +- .../dashboard/src/components/CustomNode.tsx | 5 ++++- .../dashboard/src/components/GraphView.tsx | 16 +++++++++++----- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index c1d1868..a4a7e1a 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -9,7 +9,7 @@ { "name": "understand-anything", "description": "Multi-agent codebase analysis with interactive dashboard, guided tours, and skill commands", - "version": "1.0.3", + "version": "1.0.4", "source": "./understand-anything-plugin" } ] diff --git a/understand-anything-plugin/package.json b/understand-anything-plugin/package.json index 0aa2376..3b632ae 100644 --- a/understand-anything-plugin/package.json +++ b/understand-anything-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@understand-anything/skill", - "version": "1.0.3", + "version": "1.0.4", "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/understand-anything-plugin/packages/dashboard/src/components/CustomNode.tsx b/understand-anything-plugin/packages/dashboard/src/components/CustomNode.tsx index 57199e9..369105c 100644 --- a/understand-anything-plugin/packages/dashboard/src/components/CustomNode.tsx +++ b/understand-anything-plugin/packages/dashboard/src/components/CustomNode.tsx @@ -32,11 +32,13 @@ export interface CustomNodeData extends Record { searchScore?: number; isSelected: boolean; isTourHighlighted: boolean; + onNodeClick?: (nodeId: string) => void; } export type CustomFlowNode = Node; export default function CustomNode({ + id, data, }: NodeProps) { const barColor = typeColors[data.nodeType] ?? typeColors.file; @@ -65,8 +67,9 @@ export default function CustomNode({ return (
data.onNodeClick?.(id)} > {/* Left color bar */}
s.tourHighlightedNodeIds); const persona = useDashboardStore((s) => s.persona); + const handleNodeSelect = useCallback( + (nodeId: string) => { + selectNode(nodeId); + openCodeViewer(nodeId); + }, + [selectNode, openCodeViewer], + ); + const { initialNodes, initialEdges } = useMemo(() => { if (!graph) return { @@ -70,6 +78,7 @@ export default function GraphView() { searchScore: matchResult?.score, isSelected: selectedNodeId === node.id, isTourHighlighted: tourHighlightedNodeIds.includes(node.id), + onNodeClick: handleNodeSelect, }, }; }); @@ -181,7 +190,7 @@ export default function GraphView() { ]; return { initialNodes: allNodes, initialEdges: laid.edges }; - }, [graph, searchResults, selectedNodeId, showLayers, tourHighlightedNodeIds, persona]); + }, [graph, searchResults, selectedNodeId, showLayers, tourHighlightedNodeIds, persona, handleNodeSelect]); const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); @@ -200,10 +209,7 @@ export default function GraphView() { const isGroupNode = graph?.layers?.some((l) => l.id === node.id); if (isGroupNode) return; selectNode(node.id); - const graphNode = graph?.nodes.find((n) => n.id === node.id); - if (graphNode?.type === 'file') { - openCodeViewer(node.id); - } + openCodeViewer(node.id); }, [selectNode, openCodeViewer, graph], );