From ebe2c3af7e1b0abd622f4c8f20a94af5ca8e6076 Mon Sep 17 00:00:00 2001 From: Fringg Date: Sun, 22 Mar 2026 10:26:16 +0300 Subject: [PATCH] fix: use dark label color on hover (white bg), light on normal (dark bg) Switch labelColor to attribute-based mode so hovered/highlighted nodes get dark text (#111827) readable on the white hover background, while normal labels stay light (#e5e7eb) readable on the dark canvas. --- src/pages/ReferralNetwork/components/NetworkGraph.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/ReferralNetwork/components/NetworkGraph.tsx b/src/pages/ReferralNetwork/components/NetworkGraph.tsx index 56efc40..7b3dafb 100644 --- a/src/pages/ReferralNetwork/components/NetworkGraph.tsx +++ b/src/pages/ReferralNetwork/components/NetworkGraph.tsx @@ -342,7 +342,7 @@ export function NetworkGraph({ data, className }: NetworkGraphProps) { defaultNodeColor: NODE_COLORS.regular, nodeProgramClasses: { bordered: BorderedNodeProgram }, defaultNodeType: 'bordered', - labelColor: { color: '#e5e7eb' }, + labelColor: { attribute: 'labelColor', color: '#e5e7eb' }, labelFont: 'Inter, system-ui, sans-serif', labelSize: 11, stagePadding: 40, @@ -361,6 +361,7 @@ export function NetworkGraph({ data, className }: NetworkGraphProps) { if (highlighted.size > 0) { if (highlighted.has(node)) { res.highlighted = true; + res.labelColor = '#111827'; res.zIndex = 2; } else { res.color = `${attrs.color}33`; @@ -372,9 +373,11 @@ export function NetworkGraph({ data, className }: NetworkGraphProps) { if (hovered) { if (node === hovered) { res.highlighted = true; + res.labelColor = '#111827'; res.zIndex = 2; } else if (graph.hasNode(hovered) && graph.areNeighbors(node, hovered)) { res.highlighted = true; + res.labelColor = '#111827'; res.zIndex = 1; } else if (!highlighted.has(node)) { res.color = `${attrs.color}33`;