feat: render EIP_CIRCUIT_BREAKER as compound container with main/fallback lanes
Follow the DO_TRY pattern: virtual _CB_MAIN wrapper for main path children, onFallback rendered as _CB_FALLBACK section with purple dashed border. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -65,8 +65,8 @@ export function CompoundNode({
|
||||
onNodeClick, onNodeDoubleClick, onNodeEnter, onNodeLeave,
|
||||
};
|
||||
|
||||
// _TRY_BODY: transparent wrapper — no header, no border, just layout
|
||||
if (node.type === '_TRY_BODY') {
|
||||
// _TRY_BODY / _CB_MAIN: transparent wrapper — no header, no border, just layout
|
||||
if (node.type === '_TRY_BODY' || node.type === '_CB_MAIN') {
|
||||
return (
|
||||
<g transform={`translate(${x}, ${y})`}>
|
||||
{renderInternalEdges(internalEdges, absX, absY, executionOverlay)}
|
||||
@@ -75,6 +75,24 @@ export function CompoundNode({
|
||||
);
|
||||
}
|
||||
|
||||
// _CB_FALLBACK: section styling with EIP purple
|
||||
if (node.type === '_CB_FALLBACK') {
|
||||
const fallbackColor = '#7C3AED'; // EIP purple
|
||||
return (
|
||||
<g data-node-id={node.id} transform={`translate(${x}, ${y})`}>
|
||||
<rect x={0} y={0} width={w} height={h} rx={CORNER_RADIUS}
|
||||
fill={fallbackColor} fillOpacity={0.06} />
|
||||
<rect x={0} y={0} width={w} height={h} rx={CORNER_RADIUS}
|
||||
fill="none" stroke={fallbackColor} strokeWidth={1} strokeOpacity={0.4} strokeDasharray="4 2" />
|
||||
<text x={8} y={12} fill={fallbackColor} fontSize={10} fontWeight={600}>
|
||||
fallback
|
||||
</text>
|
||||
{renderInternalEdges(internalEdges, absX, absY, executionOverlay)}
|
||||
{renderChildren(node, absX, absY, childProps)}
|
||||
</g>
|
||||
);
|
||||
}
|
||||
|
||||
// DO_CATCH / DO_FINALLY: section-like styling (tinted bg, thin border, label)
|
||||
if (node.type === 'DO_CATCH' || node.type === 'DO_FINALLY') {
|
||||
const sectionLabel = node.type === 'DO_CATCH'
|
||||
|
||||
Reference in New Issue
Block a user