diff --git a/portal/src/components/NodePanel.tsx b/portal/src/components/NodePanel.tsx index 7b8573c..63d7c7a 100644 --- a/portal/src/components/NodePanel.tsx +++ b/portal/src/components/NodePanel.tsx @@ -90,6 +90,18 @@ export default function NodePanel({ + {node.metadata?.sections?.length > 0 && ( +
+ + {node.metadata.sections.map((s: { label: string; body: string }, i: number) => ( +
+
{s.label}
+
{s.body}
+
+ ))} +
+ )} +
{node.connections.outgoing.length === 0 && node.connections.incoming.length === 0 && ( diff --git a/src/mcp/index.ts b/src/mcp/index.ts index 09a20b6..7314abf 100644 --- a/src/mcp/index.ts +++ b/src/mcp/index.ts @@ -160,7 +160,9 @@ server.tool( const allTags = [...new Set(validNodes.flatMap(n => n.tags))]; const mergedKind = (kind as NodeKind) ?? validNodes[0].kind; - const merged = await addNode({ kind: mergedKind, title, content, tags: allTags }); + // Merge metadata from all nodes (last wins for conflicting keys) + const mergedMetadata = validNodes.reduce((acc, n) => ({ ...acc, ...n.metadata }), {} as Record); + const merged = await addNode({ kind: mergedKind, title, content, tags: allTags, metadata: mergedMetadata }); const oldIds = new Set(validNodes.map(n => n.id)); // Relink edges from old nodes to merged node