From 7b63c16b1ce8dfd25955a7c3944ea088b137afc8 Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 23 Sep 2025 22:41:31 +0800 Subject: [PATCH] Set empty query labels to wildcard '*' for proper graph display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Handle empty/whitespace query labels • Auto-set to '*' when label is blank • Ensure consistent graph behavior • Prevent invalid query states --- lightrag_webui/src/components/graph/GraphLabels.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lightrag_webui/src/components/graph/GraphLabels.tsx b/lightrag_webui/src/components/graph/GraphLabels.tsx index 0310e9f7..76a7757b 100644 --- a/lightrag_webui/src/components/graph/GraphLabels.tsx +++ b/lightrag_webui/src/components/graph/GraphLabels.tsx @@ -94,7 +94,13 @@ const GraphLabels = () => { useGraphStore.getState().setTypeColorMap(new Map()) try { - const currentLabel = label + let currentLabel = label + + // If queryLabel is empty, set it to '*' + if (!currentLabel || currentLabel.trim() === '') { + useSettingsStore.getState().setQueryLabel('*') + currentLabel = '*' + } if (currentLabel && currentLabel !== '*') { // Scenario 1: Has specific label, try to refresh current label