From 18ed0a82e99b9c31fc555152a7c5665a27d7df06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20MANSUY?= Date: Thu, 4 Dec 2025 19:18:14 +0800 Subject: [PATCH] cherry-pick 0aef6a16 --- lightrag_webui/src/components/graph/GraphControl.tsx | 8 ++++++-- lightrag_webui/src/lib/constants.ts | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lightrag_webui/src/components/graph/GraphControl.tsx b/lightrag_webui/src/components/graph/GraphControl.tsx index 55864789..a1477217 100644 --- a/lightrag_webui/src/components/graph/GraphControl.tsx +++ b/lightrag_webui/src/components/graph/GraphControl.tsx @@ -302,6 +302,10 @@ const GraphControl = ({ disableHoverEffect }: { disableHoverEffect?: boolean }) if (!disableHoverEffect) { const _focusedNode = focusedNode || selectedNode + // Choose edge highlight color based on theme + const edgeHighlightColor = isDarkTheme + ? Constants.edgeColorHighlightedDarkTheme + : Constants.edgeColorHighlightedLightTheme if (_focusedNode && graph.hasNode(_focusedNode)) { try { @@ -311,7 +315,7 @@ const GraphControl = ({ disableHoverEffect }: { disableHoverEffect?: boolean }) } } else { if (graph.extremities(edge).includes(_focusedNode)) { - newData.color = Constants.edgeColorHighlighted + newData.color = edgeHighlightColor } } } catch (error) { @@ -326,7 +330,7 @@ const GraphControl = ({ disableHoverEffect }: { disableHoverEffect?: boolean }) if (edge === _selectedEdge) { newData.color = Constants.edgeColorSelected } else if (edge === _focusedEdge) { - newData.color = Constants.edgeColorHighlighted + newData.color = edgeHighlightColor } else if (hideUnselectedEdges) { newData.hidden = true } diff --git a/lightrag_webui/src/lib/constants.ts b/lightrag_webui/src/lib/constants.ts index d1efcc2e..1e7846f8 100644 --- a/lightrag_webui/src/lib/constants.ts +++ b/lightrag_webui/src/lib/constants.ts @@ -14,7 +14,8 @@ export const nodeBorderColorSelected = '#F57F17' export const edgeColorDarkTheme = '#888888' export const edgeColorSelected = '#F57F17' -export const edgeColorHighlighted = '#FFFFFF' +export const edgeColorHighlightedDarkTheme = '#F57F17' +export const edgeColorHighlightedLightTheme = '#F57F17' export const searchResultLimit = 50 export const labelListLimit = 100