From 1b90ee3fb5778eb7624e926e3144fc6044fa81e3 Mon Sep 17 00:00:00 2001 From: Ani2828 Date: Mon, 14 Sep 2026 21:28:06 +0530 Subject: [PATCH] fix: clarify empty neighbor expansion with filters --- .../graph-explorer/src/hooks/useExpandNode.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/graph-explorer/src/hooks/useExpandNode.tsx b/packages/graph-explorer/src/hooks/useExpandNode.tsx index 955720533a..86e9d47fe3 100644 --- a/packages/graph-explorer/src/hooks/useExpandNode.tsx +++ b/packages/graph-explorer/src/hooks/useExpandNode.tsx @@ -94,7 +94,13 @@ export default function useExpandNode() { // No neighbors to add if (result.vertices.length + result.edges.length <= 0) { - toast.info("No more neighbors to expand"); + const hasAttributeFilters = (request.attributeFilters?.length ?? 0) > 0; + + toast.info( + hasAttributeFilters + ? "No neighbors matched your filters" + : "No more neighbors to expand", + ); return; } @@ -166,7 +172,14 @@ export default function useExpandNode() { const combined = await expandPromise; if (combined.vertices.length + combined.edges.length <= 0) { - toast.info("No more neighbors to expand"); + const hasAttributeFilters = (filters.attributeFilters?.length ?? 0) > 0; + + toast.info( + hasAttributeFilters + ? "No neighbors matched your filters" + : "No more neighbors to expand", + ); + return; }