Add Node Type Filter for ONNX Models in Search Sidebar #1531
+130
−2
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.
Problem
When working with large ONNX models, the search sidebar can list thousands of nodes. Filtering by name works, but it's hard to focus on specific operation types (e.g., finding all Conv, MatMul, or GroupQueryAttention nodes). Users had to scroll through many results or type exact names, which is slow for exploratory work.
Solution
Add a node type filter in the search sidebar for ONNX models. A filter icon button appears next to the search input, matching the existing toggle button style. Clicking it opens a dropdown with all unique node types found in the model. Selecting a type filters the results to show only nodes of that type, and it works together with text search for more precise filtering.
Implementation Details
Key Features:
Filter icon button: A filter icon (three horizontal lines) appears in the search bar for ONNX models, styled like the existing toggle buttons
Dynamic node type collection: Automatically collects and lists all unique node types from the model (e.g., Conv, MatMul, Add, GroupQueryAttention, Cast, Concat, etc.)
Dropdown menu: Clicking the filter icon opens a dropdown with:
Combined filtering: Works with the existing text search — users can filter by type and search by name simultaneously
ONNX-only: Only appears when viewing ONNX models (detected by checking if model format starts with "ONNX")
State persistence: Selected filter state is preserved when the sidebar is reopened
Technical Changes:
nodeTypeto the search state object_collectNodeTypes()method to extract unique node types from the model graph_node()filtering logic to respect the node type filtersidebar-icon-filter) to match existing icon style@lutzroeder , long time user, first PR, please help review.