Skip to content

Fix topology sidebar counts when a namespace is selected #1647

Closed

Description

@nadaverell

Problem

When a user selects one or more namespaces in Topology, the graph is filtered to that scope but the adjacent Filters sidebar still receives the raw topology. Its kind rows and counts therefore describe the cluster-wide stream rather than what is on the canvas — for example, it can show Ingress (12) even when the selected namespace has no Ingresses.

Expected behavior

The sidebar should describe the same namespace-scoped topology the user is viewing.

  • Count and list kinds from the namespace-filtered node set.
  • Retain cluster-scoped nodes with no namespace (for example Nodes, PersistentVolumes, and Namespaces), because they remain visible in every namespace scope.
  • Use the pause-buffered displayedTopology, so sidebar counts stay frozen while the graph is paused.
  • Filter by namespace only before passing nodes to the sidebar. Do not pass the already kind-filtered graph nodes: the sidebar needs the full scoped set to calculate its visible/hidden counts correctly.

Where to look

  • web/src/App.tsx: filteredTopology already demonstrates the required namespace carve-out; TopologyFilterSidebar is currently passed raw topology?.nodes.
  • packages/k8s-ui/src/components/topology/TopologyFilterSidebar.tsx: derives the displayed kinds and counts solely from its nodes prop.

Acceptance criteria

With a namespace selected, the graph and sidebar agree on which kinds exist and their counts. Changing the selected namespace updates the sidebar accordingly; pause freezes both surfaces consistently. Add focused coverage for this data flow.

Activity

  1. added a commit that references this issue on Sep 12, 2026
    a710e8c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions