fix(graph-ui): keep filter sidebar visible when all nodes are filtered out#727
Open
rarepops wants to merge 1 commit into
Open
fix(graph-ui): keep filter sidebar visible when all nodes are filtered out#727rarepops wants to merge 1 commit into
rarepops wants to merge 1 commit into
Conversation
…d out Clicking "None" (disable all filters) clears every label and edge type, making filteredData.nodes empty. The early return then replaced the whole layout — including the left filter sidebar — with a centered "All nodes filtered out / Reset Filters" message, leaving no way to re-enable individual filters without resetting everything. Narrow the early return to the genuinely-empty / no-data case and render the "all filtered out" state inside the graph area instead, so the FilterPanel and Sidebar stay mounted. As a side effect, a project with zero nodes now correctly reads "No nodes in this project" rather than "All nodes filtered out". Add a regression test that disables all filters via "None" and asserts the Filters sidebar remains in the document. Signed-off-by: Zadak <rarepops@protonmail.com>
53eea0a to
a0e970d
Compare
Owner
|
Huge thanks for opening this PR and for the work you put into it. The maintainer shop is currently full, so this may sit for a bit before it gets a proper review. We will come back to this as soon as possible with real feedback; I wanted to make sure it did not sit unacknowledged in the meantime. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In the Graph view, clicking None in the Filters panel (disable all filters) made the entire view, including the filter sidebar itself — collapse to a centered "All nodes filtered out / Reset Filters" message. With the sidebar gone, the only way back was Reset Filters, which re-enables everything; there was no way to toggle individual filters back on.
Root cause: an early
returninGraphTabfired wheneverfilteredData.nodes.length === 0and replaced the whole layout (left sidebar included).Fix
FilterPanel+Sidebarstay mounted. Users can now re-enable individual filters (or hit Reset Filters) without losing the panel.Before / After
Before — clicking None hides the sidebar and replaces the whole view:
After — the filter sidebar stays; the message shows only in the graph area:
Testing
graph-ui/src/components/GraphTab.filters.test.tsx: disables all filters via the None shortcut and asserts the Filters sidebar (plus the All/None controls) remain in the document.npx vitest run→ 9/9 passing.tsc -b→ clean.