feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
import type { DiagramNode as DiagramNodeType } from '../../api/queries/diagrams';
|
2026-03-29 23:32:42 +02:00
|
|
|
|
import type { NodeConfig, LatencyHeatmapEntry } from './types';
|
2026-03-27 18:44:16 +01:00
|
|
|
|
import type { NodeExecutionState } from '../ExecutionDiagram/types';
|
2026-03-29 11:56:19 +02:00
|
|
|
|
import { colorForType, iconForType, type IconElement } from './node-colors';
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
import { ConfigBadge } from './ConfigBadge';
|
|
|
|
|
|
|
|
|
|
|
|
const TOP_BAR_HEIGHT = 6;
|
2026-03-28 17:16:36 +01:00
|
|
|
|
const TEXT_LEFT = 32;
|
|
|
|
|
|
const TEXT_RIGHT_PAD = 24;
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
const CORNER_RADIUS = 4;
|
|
|
|
|
|
|
|
|
|
|
|
interface DiagramNodeProps {
|
|
|
|
|
|
node: DiagramNodeType;
|
|
|
|
|
|
isHovered: boolean;
|
|
|
|
|
|
isSelected: boolean;
|
|
|
|
|
|
config?: NodeConfig;
|
2026-03-27 18:44:16 +01:00
|
|
|
|
executionState?: NodeExecutionState;
|
|
|
|
|
|
overlayActive?: boolean;
|
2026-03-29 23:32:42 +02:00
|
|
|
|
heatmapEntry?: LatencyHeatmapEntry;
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
onClick: () => void;
|
2026-03-27 16:58:35 +01:00
|
|
|
|
onDoubleClick?: () => void;
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
onMouseEnter: () => void;
|
|
|
|
|
|
onMouseLeave: () => void;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-29 23:32:42 +02:00
|
|
|
|
/** Interpolate green (120°) → yellow (60°) → red (0°) based on pctOfRoute */
|
|
|
|
|
|
function heatmapColor(pct: number): string {
|
|
|
|
|
|
const clamped = Math.max(0, Math.min(100, pct));
|
|
|
|
|
|
// 0% → hue 120 (green), 50% → hue 60 (yellow), 100% → hue 0 (red)
|
|
|
|
|
|
const hue = 120 - (clamped / 100) * 120;
|
|
|
|
|
|
return `hsl(${Math.round(hue)}, 70%, 92%)`;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function heatmapBorderColor(pct: number): string {
|
|
|
|
|
|
const clamped = Math.max(0, Math.min(100, pct));
|
|
|
|
|
|
const hue = 120 - (clamped / 100) * 120;
|
|
|
|
|
|
return `hsl(${Math.round(hue)}, 60%, 50%)`;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-27 18:44:16 +01:00
|
|
|
|
function formatDuration(ms: number): string {
|
|
|
|
|
|
if (ms < 1000) return `${ms}ms`;
|
|
|
|
|
|
return `${(ms / 1000).toFixed(1)}s`;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
export function DiagramNode({
|
2026-03-27 18:44:16 +01:00
|
|
|
|
node, isHovered, isSelected, config,
|
2026-03-29 23:32:42 +02:00
|
|
|
|
executionState, overlayActive, heatmapEntry,
|
2026-03-27 18:44:16 +01:00
|
|
|
|
onClick, onDoubleClick, onMouseEnter, onMouseLeave,
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
}: DiagramNodeProps) {
|
|
|
|
|
|
const x = node.x ?? 0;
|
|
|
|
|
|
const y = node.y ?? 0;
|
|
|
|
|
|
const w = node.width ?? 120;
|
|
|
|
|
|
const h = node.height ?? 40;
|
|
|
|
|
|
const color = colorForType(node.type);
|
2026-03-29 11:56:19 +02:00
|
|
|
|
const iconElements = iconForType(node.type);
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
|
|
|
|
|
|
// Extract label parts: type name and detail
|
|
|
|
|
|
const typeName = node.type?.replace(/^EIP_/, '').replace(/_/g, ' ') ?? '';
|
|
|
|
|
|
const detail = node.label || '';
|
2026-03-29 16:30:11 +02:00
|
|
|
|
const resolvedUri = executionState?.resolvedEndpointUri;
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
|
2026-03-27 18:44:16 +01:00
|
|
|
|
// Overlay state derivation
|
|
|
|
|
|
const isCompleted = executionState?.status === 'COMPLETED';
|
|
|
|
|
|
const isFailed = executionState?.status === 'FAILED';
|
|
|
|
|
|
const isSkipped = overlayActive && !executionState;
|
|
|
|
|
|
|
2026-03-29 23:32:42 +02:00
|
|
|
|
// Colors based on execution state (heatmap takes priority when no execution overlay)
|
2026-03-27 18:44:16 +01:00
|
|
|
|
let cardFill = isHovered ? '#F5F0EA' : 'white';
|
|
|
|
|
|
let borderStroke = isHovered || isSelected ? color : '#E4DFD8';
|
|
|
|
|
|
let borderWidth = isHovered || isSelected ? 1.5 : 1;
|
|
|
|
|
|
let topBarColor = color;
|
|
|
|
|
|
let labelColor = '#1A1612';
|
|
|
|
|
|
|
|
|
|
|
|
if (isCompleted) {
|
|
|
|
|
|
cardFill = isHovered ? '#E4F5E6' : '#F0F9F1';
|
|
|
|
|
|
borderStroke = '#3D7C47';
|
|
|
|
|
|
borderWidth = 1.5;
|
|
|
|
|
|
topBarColor = '#3D7C47';
|
|
|
|
|
|
} else if (isFailed) {
|
|
|
|
|
|
cardFill = isHovered ? '#F9E4E1' : '#FDF2F0';
|
|
|
|
|
|
borderStroke = '#C0392B';
|
|
|
|
|
|
borderWidth = 2;
|
|
|
|
|
|
topBarColor = '#C0392B';
|
|
|
|
|
|
labelColor = '#C0392B';
|
2026-03-29 23:32:42 +02:00
|
|
|
|
} else if (heatmapEntry && !overlayActive) {
|
|
|
|
|
|
cardFill = heatmapColor(heatmapEntry.pctOfRoute);
|
|
|
|
|
|
borderStroke = heatmapBorderColor(heatmapEntry.pctOfRoute);
|
|
|
|
|
|
borderWidth = 1.5;
|
|
|
|
|
|
topBarColor = heatmapBorderColor(heatmapEntry.pctOfRoute);
|
2026-03-27 18:44:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const statusColor = isCompleted ? '#3D7C47' : isFailed ? '#C0392B' : undefined;
|
|
|
|
|
|
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
return (
|
|
|
|
|
|
<g
|
|
|
|
|
|
data-node-id={node.id}
|
|
|
|
|
|
transform={`translate(${x}, ${y})`}
|
|
|
|
|
|
onClick={(e) => { e.stopPropagation(); onClick(); }}
|
2026-03-27 16:58:35 +01:00
|
|
|
|
onDoubleClick={(e) => { e.stopPropagation(); onDoubleClick?.(); }}
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
onMouseEnter={onMouseEnter}
|
|
|
|
|
|
onMouseLeave={onMouseLeave}
|
|
|
|
|
|
style={{ cursor: 'pointer' }}
|
2026-03-27 18:44:16 +01:00
|
|
|
|
opacity={isSkipped ? 0.35 : undefined}
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
>
|
|
|
|
|
|
{/* Selection ring */}
|
|
|
|
|
|
{isSelected && (
|
|
|
|
|
|
<rect
|
|
|
|
|
|
x={-2}
|
|
|
|
|
|
y={-2}
|
|
|
|
|
|
width={w + 4}
|
|
|
|
|
|
height={h + 4}
|
|
|
|
|
|
rx={CORNER_RADIUS + 2}
|
|
|
|
|
|
fill="none"
|
|
|
|
|
|
stroke="#C6820E"
|
|
|
|
|
|
strokeWidth={2.5}
|
|
|
|
|
|
/>
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
{/* Card background */}
|
|
|
|
|
|
<rect
|
|
|
|
|
|
x={0}
|
|
|
|
|
|
y={0}
|
|
|
|
|
|
width={w}
|
|
|
|
|
|
height={h}
|
|
|
|
|
|
rx={CORNER_RADIUS}
|
2026-03-27 18:44:16 +01:00
|
|
|
|
fill={cardFill}
|
|
|
|
|
|
stroke={borderStroke}
|
|
|
|
|
|
strokeWidth={borderWidth}
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
{/* Colored top bar */}
|
2026-03-27 18:44:16 +01:00
|
|
|
|
<rect x={0} y={0} width={w} height={TOP_BAR_HEIGHT} rx={CORNER_RADIUS} fill={topBarColor} />
|
|
|
|
|
|
<rect x={CORNER_RADIUS} y={0} width={w - CORNER_RADIUS * 2} height={TOP_BAR_HEIGHT} fill={topBarColor} />
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
|
2026-03-28 17:16:36 +01:00
|
|
|
|
{/* Clip path for text area */}
|
|
|
|
|
|
<clipPath id={`clip-${node.id}`}>
|
|
|
|
|
|
<rect x={TEXT_LEFT} y={TOP_BAR_HEIGHT} width={w - TEXT_LEFT - TEXT_RIGHT_PAD} height={h - TOP_BAR_HEIGHT} />
|
|
|
|
|
|
</clipPath>
|
|
|
|
|
|
|
2026-03-29 11:56:19 +02:00
|
|
|
|
{/* 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>
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
|
2026-03-29 16:30:11 +02:00
|
|
|
|
{/* Type name + detail + resolved URI (clipped to available width) */}
|
2026-03-28 17:16:36 +01:00
|
|
|
|
<g clipPath={`url(#clip-${node.id})`}>
|
2026-03-29 16:30:11 +02:00
|
|
|
|
{resolvedUri ? (
|
|
|
|
|
|
<>
|
|
|
|
|
|
<text x={TEXT_LEFT} y={TOP_BAR_HEIGHT + 12} fill={labelColor} fontSize={11} fontWeight={600}>
|
|
|
|
|
|
{typeName}
|
|
|
|
|
|
</text>
|
|
|
|
|
|
{detail && detail !== typeName && (
|
|
|
|
|
|
<text x={TEXT_LEFT} y={TOP_BAR_HEIGHT + 24} fill={isFailed ? '#C0392B' : '#5C5347'} fontSize={10}>
|
|
|
|
|
|
{detail}
|
|
|
|
|
|
</text>
|
|
|
|
|
|
)}
|
|
|
|
|
|
<text x={TEXT_LEFT} y={h - 5} fill="#1A7F8E" fontSize={9} fontStyle="italic">
|
|
|
|
|
|
→ {resolvedUri.split('?')[0]}
|
|
|
|
|
|
</text>
|
|
|
|
|
|
</>
|
|
|
|
|
|
) : (
|
|
|
|
|
|
<>
|
|
|
|
|
|
<text x={TEXT_LEFT} y={h / 2 - 1} fill={labelColor} fontSize={11} fontWeight={600}>
|
|
|
|
|
|
{typeName}
|
|
|
|
|
|
</text>
|
|
|
|
|
|
{detail && detail !== typeName && (
|
|
|
|
|
|
<text x={TEXT_LEFT} y={h / 2 + 12} fill={isFailed ? '#C0392B' : '#5C5347'} fontSize={10}>
|
|
|
|
|
|
{detail}
|
|
|
|
|
|
</text>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</>
|
2026-03-28 17:16:36 +01:00
|
|
|
|
)}
|
|
|
|
|
|
</g>
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
|
|
|
|
|
|
{/* Config badges */}
|
2026-03-29 13:08:58 +02:00
|
|
|
|
{(config || executionState?.hasTraceData) && (
|
|
|
|
|
|
<ConfigBadge nodeWidth={w} config={config ?? {}} hasTraceData={executionState?.hasTraceData} />
|
|
|
|
|
|
)}
|
2026-03-27 18:44:16 +01:00
|
|
|
|
|
2026-03-27 19:29:30 +01:00
|
|
|
|
{/* Execution overlay: status badge inside card, top-right corner */}
|
2026-03-27 18:44:16 +01:00
|
|
|
|
{isCompleted && (
|
|
|
|
|
|
<>
|
2026-03-27 19:29:30 +01:00
|
|
|
|
<circle cx={w - 10} cy={TOP_BAR_HEIGHT + 8} r={6} fill="#3D7C47" />
|
2026-03-27 23:16:39 +01:00
|
|
|
|
<path
|
|
|
|
|
|
d={`M${w - 13} ${TOP_BAR_HEIGHT + 8} l2 2 4-4`}
|
|
|
|
|
|
fill="none" stroke="white" strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round"
|
|
|
|
|
|
/>
|
2026-03-27 18:44:16 +01:00
|
|
|
|
</>
|
|
|
|
|
|
)}
|
|
|
|
|
|
{isFailed && (
|
|
|
|
|
|
<>
|
2026-03-27 19:29:30 +01:00
|
|
|
|
<circle cx={w - 10} cy={TOP_BAR_HEIGHT + 8} r={6} fill="#C0392B" />
|
2026-03-27 23:16:39 +01:00
|
|
|
|
<path
|
|
|
|
|
|
d={`M${w - 10} ${TOP_BAR_HEIGHT + 5} v4 M${w - 10} ${TOP_BAR_HEIGHT + 10.5} v0.5`}
|
|
|
|
|
|
fill="none" stroke="white" strokeWidth={1.5} strokeLinecap="round"
|
|
|
|
|
|
/>
|
2026-03-27 18:44:16 +01:00
|
|
|
|
</>
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
{/* Execution overlay: duration text at bottom-right */}
|
|
|
|
|
|
{executionState && statusColor && (
|
|
|
|
|
|
<text
|
|
|
|
|
|
x={w - 6}
|
|
|
|
|
|
y={h - 4}
|
|
|
|
|
|
textAnchor="end"
|
|
|
|
|
|
fill={statusColor}
|
|
|
|
|
|
fontSize={9}
|
|
|
|
|
|
fontWeight={500}
|
|
|
|
|
|
>
|
|
|
|
|
|
{formatDuration(executionState.durationMs)}
|
|
|
|
|
|
</text>
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
2026-03-29 23:32:42 +02:00
|
|
|
|
{/* Heatmap: avg duration label at bottom-right */}
|
|
|
|
|
|
{heatmapEntry && !overlayActive && !executionState && (
|
|
|
|
|
|
<text
|
|
|
|
|
|
x={w - 6}
|
|
|
|
|
|
y={h - 4}
|
|
|
|
|
|
textAnchor="end"
|
|
|
|
|
|
fill={heatmapBorderColor(heatmapEntry.pctOfRoute)}
|
|
|
|
|
|
fontSize={9}
|
|
|
|
|
|
fontWeight={600}
|
|
|
|
|
|
>
|
|
|
|
|
|
{formatDuration(heatmapEntry.avgDurationMs)}
|
|
|
|
|
|
</text>
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
2026-03-27 18:44:16 +01:00
|
|
|
|
{/* Sub-route failure: drill-down arrow at bottom-left */}
|
|
|
|
|
|
{isFailed && executionState?.subRouteFailed && (
|
2026-03-27 23:16:39 +01:00
|
|
|
|
<g transform={`translate(4, ${h - 14})`}>
|
|
|
|
|
|
<path
|
|
|
|
|
|
d="M2 2 v5 a3 3 0 003 3 h5"
|
|
|
|
|
|
fill="none" stroke="#C0392B" strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<path d="M8 8 l2 2 -2 2" fill="none" stroke="#C0392B" strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round" />
|
|
|
|
|
|
</g>
|
2026-03-27 18:44:16 +01:00
|
|
|
|
)}
|
feat: add interactive ProcessDiagram SVG component (sub-project 1/3)
New interactive route diagram component with SVG rendering using
server-computed ELK layout coordinates. TIBCO BW5-inspired top-bar
card node style with zoom/pan, hover toolbars, config badges, and
error handler sections below the main flow.
Backend: add direction query parameter (LR/TB) to diagram render
endpoints, defaulting to left-to-right layout.
Frontend: 14-file ProcessDiagram component in ui/src/components/
with DiagramNode, CompoundNode, DiagramEdge, ConfigBadge, NodeToolbar,
ErrorSection, ZoomControls, and supporting hooks. Dev test page at
/dev/diagram for validation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:55:29 +01:00
|
|
|
|
</g>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|