Skip to content

fix(graph-ui): keep filter sidebar visible when all nodes are filtered out#727

Open
rarepops wants to merge 1 commit into
DeusData:mainfrom
rarepops:fix/graph-filters-keep-sidebar
Open

fix(graph-ui): keep filter sidebar visible when all nodes are filtered out#727
rarepops wants to merge 1 commit into
DeusData:mainfrom
rarepops:fix/graph-filters-keep-sidebar

Conversation

@rarepops

@rarepops rarepops commented Jun 30, 2026

Copy link
Copy Markdown

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 return in GraphTab fired whenever filteredData.nodes.length === 0 and replaced the whole layout (left sidebar included).

Fix

  • Narrow the early return to the genuinely-empty / no-data case (no data, or the project has zero nodes — where there are no filters to interact with anyway).
  • Render the "All nodes filtered out" state inside the graph area instead, so the FilterPanel + Sidebar stay mounted. Users can now re-enable individual filters (or hit Reset Filters) without losing the panel.
  • Side effect: a project that genuinely has zero nodes now correctly reads "No nodes in this project" rather than the misleading "All nodes filtered out".

Before / After

Before — clicking None hides the sidebar and replaces the whole view:

Before_Fix

After — the filter sidebar stays; the message shows only in the graph area:

After_Fix

Testing

  • Added 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.
@rarepops rarepops requested a review from DeusData as a code owner June 30, 2026 19:25
…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>
@rarepops rarepops force-pushed the fix/graph-filters-keep-sidebar branch from 53eea0a to a0e970d Compare June 30, 2026 19:27
@DeusData DeusData added bug Something isn't working ux/behavior Display bugs, docs, adoption UX priority/normal Standard review queue; useful PR with ordinary maintainer urgency. labels Jul 1, 2026
@DeusData

DeusData commented Jul 1, 2026

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority/normal Standard review queue; useful PR with ordinary maintainer urgency. ux/behavior Display bugs, docs, adoption UX

2 participants