Skip to content

[Jamie] Graph Explorer: auto re-run search on node-type filter change - #5181

Open
fayekelmith wants to merge 4 commits into
masterfrom
swarm/swarm-change-22b70e9e
Open

[Jamie] Graph Explorer: auto re-run search on node-type filter change#5181
fayekelmith wants to merge 4 commits into
masterfrom
swarm/swarm-change-22b70e9e

Conversation

@fayekelmith

Copy link
Copy Markdown
Collaborator

Problem

In Graph Explorer's search panel, changing the node-type filter (or the query text) does not automatically re-run the search — the user has to manually click "Search" again to see filtered results, even though a query is already active.

Fix

Make the node-type filter and query input behave like live search:

  • Changing selectedTypes (checkbox toggle or "clear") while a non-empty query exists auto re-runs the search.
  • Typing in the query box debounces (~300ms) before auto-firing, to avoid a request per keystroke.
  • Empty query never triggers an automatic fetch.
  • In-flight requests are guarded against out-of-order responses so a slow older request can't overwrite a newer result set.
  • Manual "Search" button and Enter-key trigger remain as an explicit, immediate option.

Source

Confirmed via code read of src/components/graph-explorer/GraphExplorer.tsx: toggleType/onClear only call setSelectedTypes; runSearch is only invoked by the Search button's onClick and the Enter-key handler — no effect currently watches selectedTypes or searchQuery.

@fayekelmith fayekelmith added jamie Automated PR opened by Jamie system labels Aug 27, 2026 — with Hive Chat PM
@fayekelmith
fayekelmith force-pushed the swarm/swarm-change-22b70e9e branch 2 times, most recently from 160ab63 to 7027565 Compare August 27, 2026 23:36
## Problem
In Graph Explorer's search panel, changing the node-type filter (or the query text) does not automatically re-run the search — the user has to manually click "Search" again to see filtered results, even though a query is already active.

## Fix
Make the node-type filter and query input behave like live search:
- Changing `selectedTypes` (checkbox toggle or "clear") while a non-empty query exists auto re-runs the search.
- Typing in the query box debounces (~300ms) before auto-firing, to avoid a request per keystroke.
- Empty query never triggers an automatic fetch.
- In-flight requests are guarded against out-of-order responses so a slow older request can't overwrite a newer result set.
- Manual "Search" button and Enter-key trigger remain as an explicit, immediate option.

## Source
Confirmed via code read of `src/components/graph-explorer/GraphExplorer.tsx`: `toggleType`/`onClear` only call `setSelectedTypes`; `runSearch` is only invoked by the Search button's `onClick` and the Enter-key handler — no effect currently watches `selectedTypes` or `searchQuery`.
@fayekelmith
fayekelmith force-pushed the swarm/swarm-change-22b70e9e branch from 5438aa8 to d7a6e1b Compare August 28, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jamie Automated PR opened by Jamie system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants