- {/* Direction arrow: → if current node is FROM (outgoing), ← if current node is TO (incoming) */}
-
+ {list.map((connection) => (
+
+ {/* Row 1: arrow + ID + icon + title + delete */}
+
+
+ {connection.edge.from_node_id === activeTab ? '→' : '←'}
+
+
+ {connection.connected_node.id}
+
+
+ {getNodeIcon(connection.connected_node, dimensionIcons, 12)}
+
+ onNodeClick?.(connection.connected_node.id)}
+ style={{
fontSize: '12px',
- color: connection.edge.from_node_id === activeTab ? '#22c55e' : '#f59e0b',
- fontWeight: 600,
- width: '16px',
- textAlign: 'center'
- }}>
- {connection.edge.from_node_id === activeTab ? '→' : '←'}
-
-
- {connection.connected_node.id}
-
-
- {getNodeIcon(connection.connected_node, dimensionIcons, 12)}
-
- {connection.connected_node.title}
-
- {edgeEditingId === connection.edge.id ? (
-
- setEdgeEditingValue(e.target.value)}
- onKeyDown={(e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- saveEdgeExplanation(connection.edge.id, connection.edge.context);
- } else if (e.key === 'Escape') {
- e.preventDefault();
- cancelEditEdgeExplanation();
- }
- }}
- style={{
- flex: 1,
- fontSize: '11px',
- color: '#ddd',
- background: 'transparent',
- border: '1px solid #1a1a1a',
- borderRadius: '0',
- padding: '4px',
- outline: 'none',
- fontFamily: 'inherit'
- }}
- placeholder="Add explanation…"
- autoFocus
- />
-
-
-
- ) : (
-
- {typeof connection.edge.context?.type === 'string' && (
-
- {String(connection.edge.context.type).replace(/_/g, ' ')}
-
- )}
- {connection.edge.context?.explanation ? (
-
- — {connection.edge.context.explanation}
-
- ) : (
- No explanation
- )}
-
-
- )}
+ color: '#e5e5e5',
+ fontWeight: 500,
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ whiteSpace: 'nowrap',
+ flex: 1,
+ minWidth: 0,
+ cursor: 'pointer',
+ }}
+ onMouseEnter={(e) => { e.currentTarget.style.color = '#22c55e'; }}
+ onMouseLeave={(e) => { e.currentTarget.style.color = '#e5e5e5'; }}
+ >
+ {connection.connected_node.title}
+
+
-
+ {/* Row 2: type chip + explanation (compact, single line) */}
+ {edgeEditingId === connection.edge.id ? (
+
+ setEdgeEditingValue(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter') {
+ e.preventDefault();
+ saveEdgeExplanation(connection.edge.id, connection.edge.context);
+ } else if (e.key === 'Escape') {
+ e.preventDefault();
+ cancelEditEdgeExplanation();
+ }
+ }}
+ style={{
+ flex: 1,
+ fontSize: '11px',
+ color: '#ddd',
+ background: '#111',
+ border: '1px solid #2a2a2a',
+ borderRadius: '4px',
+ padding: '3px 6px',
+ outline: 'none',
+ fontFamily: 'inherit',
+ minWidth: 0,
+ }}
+ placeholder="Add explanation…"
+ autoFocus
+ />
+
+
+
+ ) : (
+ startEditEdgeExplanation(connection.edge.id, connection.edge.context?.explanation)}
+ style={{
+ display: 'flex',
+ alignItems: 'center',
+ gap: '6px',
+ paddingLeft: '20px',
+ cursor: 'pointer',
+ minWidth: 0,
+ }}
+ onMouseEnter={(e) => { e.currentTarget.style.opacity = '0.8'; }}
+ onMouseLeave={(e) => { e.currentTarget.style.opacity = '1'; }}
+ >
+ {typeof connection.edge.context?.type === 'string' && (
+
+ {String(connection.edge.context.type).replace(/_/g, ' ')}
+
+ )}
+
+ {(connection.edge.context?.explanation as string) || 'Add explanation...'}
+
+
+ )}