Skip to content

Commit ce910e3

Browse files
committed
feat(hooks): differentiate edge colors for event vs data conditions
Use purple color for event-based conditions and yellow for data-based conditions to improve visual distinction
1 parent caf7378 commit ce910e3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib/src/hooks/useEdgeConnection.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ export const useEdgeConnection = (edges, updateEdges, setHistoryState, nodes, wo
3030
} else {
3131
edgeType = 'condition';
3232
edgeClass = 'edge-condition';
33-
strokeColor = '#f59e0b'; // warning color
33+
// Use purple for event-based switch conditions, yellow for data-based
34+
if (sourceNode?.data?.conditionType === 'event') {
35+
strokeColor = '#8b5cf6'; // purple color for event conditions
36+
} else {
37+
strokeColor = '#f59e0b'; // yellow color for data conditions
38+
}
3439
}
3540
} else if (targetNode?.type === 'end') {
3641
edgeType = 'end';

0 commit comments

Comments
 (0)