aws / aws/graph-explorer

Misleading "No more neighbors to expand" message when filters exclude all neighbors

Open Beginner friendly
#2,060 0 comments 0 reactions 0 assignees View on GitHub
help wanted needs-triage
Dominant language
TypeScript
Stars
481
Forks
108
Avg merge
8d 9h
Merged PRs (30d)
7

Description

## Description

When expanding a node's neighbors with attribute filters, if the filters match nothing, the app shows the toast **"No more neighbors to expand"** — which implies the node is fully expanded. The truth is the opposite: the node has neighbors, but the applied filters excluded all of them. A user would reasonably conclude there is nothing left and stop, when relaxing the filter would reveal neighbors.

This is connector-agnostic — the toast lives in the shared expand hook (`useExpandNode`), so it affects Gremlin, openCypher, and SPARQL alike.

## Environment

- OS: N/A
- Browser: N/A
- Graph Explorer Version: current `main`
- Graph Database & Version: any (Gremlin / openCypher / SPARQL)

## Steps to Reproduce

1. Open the expand-neighbors sidebar for a node that has neighbors.
2. Add an attribute filter whose value matches none of them (e.g. a value no neighbor's property contains).
3. Expand.
4. See the toast "No more neighbors to expand".

## Expected Behavior

When the expansion request carried attribute filters and returned no results, the message should attribute the empty result to the filters — e.g. **"No neighbors matched your filters"** — rather than implying the node is exhausted. When no filters were applied, keep "No more neighbors to expand".

## Fix Path

The toast fires from two shared sites in `packages/graph-explorer/src/hooks/useExpandNode.tsx` (line 97, single-node `expandNode`; line 169, multi-node `expandNodes`), based purely on an empty result set with no inspection of the request. At both sites, check whether the request carried non-empty `attributeFilters`; if so, show the filter-specific message. Today only the single-node sidebar path supplies filters, but writing it at both sites keeps them correct if the multi path ever gains filters.

> [!IMPORTANT]
> If you are interested in working on this issue, please leave a comment.

> [!TIP]
> Please use a 👍 reaction to provide a +1/vote. This helps the community and maintainers prioritize this request.

Contributor guide

Open the contributing guide

Research direction

Start in packages/graph-explorer/src/hooks/useExpandNode.tsx at the empty-result handling around lines 97 and 169. Compare the expandNode and expandNodes requests, inspect whether attributeFilters is non-empty, and verify the toast differs for filtered versus unfiltered requests. Done means filtered empty results explain that no neighbors matched the filters while unfiltered results retain the existing message.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.