feat: replace Unicode diagram icons with lucide SVG icons
Each of the ~40 node types now has a distinct, semantically meaningful lucide icon rendered as crisp SVG paths. Compound node headers also show their icon left-aligned in the header bar. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { DiagramNode as DiagramNodeType } from '../../api/queries/diagrams';
|
||||
import type { NodeConfig } from './types';
|
||||
import type { NodeExecutionState } from '../ExecutionDiagram/types';
|
||||
import { colorForType, iconForType } from './node-colors';
|
||||
import { colorForType, iconForType, type IconElement } from './node-colors';
|
||||
import { ConfigBadge } from './ConfigBadge';
|
||||
|
||||
const TOP_BAR_HEIGHT = 6;
|
||||
@@ -37,7 +37,7 @@ export function DiagramNode({
|
||||
const w = node.width ?? 120;
|
||||
const h = node.height ?? 40;
|
||||
const color = colorForType(node.type);
|
||||
const icon = iconForType(node.type);
|
||||
const iconElements = iconForType(node.type);
|
||||
|
||||
// Extract label parts: type name and detail
|
||||
const typeName = node.type?.replace(/^EIP_/, '').replace(/_/g, ' ') ?? '';
|
||||
@@ -116,10 +116,14 @@ export function DiagramNode({
|
||||
<rect x={TEXT_LEFT} y={TOP_BAR_HEIGHT} width={w - TEXT_LEFT - TEXT_RIGHT_PAD} height={h - TOP_BAR_HEIGHT} />
|
||||
</clipPath>
|
||||
|
||||
{/* Icon */}
|
||||
<text x={14} y={h / 2 + 4} fill={statusColor ?? color} fontSize={14}>
|
||||
{icon}
|
||||
</text>
|
||||
{/* Icon (lucide 24×24 scaled to 14px) */}
|
||||
<g transform={`translate(6, ${h / 2 - 7}) scale(0.583)`}>
|
||||
{iconElements.map((el: IconElement, i: number) =>
|
||||
'd' in el
|
||||
? <path key={i} d={el.d} fill="none" stroke={statusColor ?? color} strokeWidth={2} strokeLinecap="round" strokeLinejoin="round" />
|
||||
: <circle key={i} cx={el.cx} cy={el.cy} r={el.r} fill="none" stroke={statusColor ?? color} strokeWidth={2} />
|
||||
)}
|
||||
</g>
|
||||
|
||||
{/* Type name + detail (clipped to available width) */}
|
||||
<g clipPath={`url(#clip-${node.id})`}>
|
||||
|
||||
Reference in New Issue
Block a user