Skip to content

Commit 55c01c3

Browse files
committed
fix: interactive decision flow arrows
1 parent 4d964bb commit 55c01c3

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

apps/web/components/decision-flow/index.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ConnectionMode,
66
Controls,
77
type Edge,
8+
MarkerType,
89
type Node,
910
ReactFlow,
1011
useEdgesState,
@@ -28,13 +29,13 @@ const nodeTypes = {
2829

2930
// Custom edge style
3031
const edgeStyles = {
31-
stroke: "var(--edge-stroke)",
32+
stroke: "#6b7280", // gray-500
3233
strokeWidth: 2,
3334
};
3435

3536
// Custom edge label style
3637
const edgeLabelStyles = {
37-
fill: "var(--edge-label-text)",
38+
fill: "#374151", // gray-700
3839
fontWeight: 500,
3940
fontSize: 12,
4041
};
@@ -91,13 +92,20 @@ const getLayoutedElements = (nodes: Node[], edges: Edge[]) => {
9192
style: edgeStyles,
9293
labelStyle: edgeLabelStyles,
9394
labelBgStyle: {
94-
fill: "var(--edge-label-bg)",
95+
fill: "#ffffff", // white background for labels
9596
rx: 4, // rounded corners
9697
ry: 4,
9798
},
9899
labelBgPadding: [8, 4],
99100
labelBgBorderRadius: 4,
100101
type: "default", // Use smooth default edges instead of smoothstep
102+
// Add markerEnd configuration for arrows
103+
markerEnd: {
104+
type: MarkerType.ArrowClosed,
105+
width: 20,
106+
height: 20,
107+
color: "#6b7280", // gray-500 - same as edge stroke
108+
},
101109
})) as Edge[];
102110

103111
return { nodes: layoutedNodes, edges: styledEdges };
@@ -138,7 +146,7 @@ export function DecisionFlow({
138146
defaultViewport={{ x: 0, y: 0, zoom: 0.7 }}
139147
attributionPosition="bottom-left"
140148
>
141-
<Background color="var(--flow-background-dots)" gap={16} />
149+
<Background color="#9ca3af" gap={16} />
142150
<Controls className="bg-white dark:bg-gray-800" />
143151
<DownloadButton title={title} />
144152
</ReactFlow>

0 commit comments

Comments
 (0)