Overview
Introduce a query builder system that allows users to define complex filtering conditions using a structured interface instead of isolated dialogs.
This is the long-term UI and UX layer for the filtering system introduced in #215.
Motivation
Current filtering mechanisms are:
- dialog-based
- single-condition
- not composable
Users need to express richer queries such as:
(type = "investor") AND (degree > 5) AND (weight ≥ 10)
This requires a unified and extensible query system.
Prerequisite: Arbitrary chip removal in the filter bar (#219)
The filter bar (#219) currently only allows ×-close on the most recently applied chip, because the snapshot/restore stack stores full visibility snapshots without recording which filter produced each entry. Closing an arbitrary chip would require replaying filters.
To fix this, the snapshot stack must associate a filter descriptor with each entry:
- Extend
GraphVisibilitySnapshot to store the FilterCondition (or a generic descriptor) that produced the snapshot.
- When arbitrary chip removal is requested: pop all snapshots above the target, then re-apply the remaining filters in order using the stored descriptors.
- This enables the filter bar to support true per-chip removal regardless of order.
This is a prerequisite for meaningful AND/OR logical composition.
Scope
Phase 0 — Arbitrary chip removal (prerequisite)
- Extend
GraphVisibilitySnapshot with a filter descriptor field
- Implement replay-based removal: pop to target, re-apply remainder
- Enable × on all filter bar chips (not just the most recent)
Phase 1 — Visual Query Builder (no-code)
- UI to define conditions:
- attribute / metric selector
- operator (=, >, <, etc.)
- value input
- Support logical operators:
Phase 2 — Internal Query Representation
- Define a query model (tree or expression-based)
- Reusable across:
- filtering
- subgraph extraction
- future features
Phase 3 — Optional DSL (advanced)
- Simple textual query language
Example:
degree > 5 AND type = "investor"
Behavior
- Queries act on:
- Results update graph visibility (non-destructive)
UI Suggestions
- Dedicated "Filter / Query Panel"
- Ability to:
- add/remove conditions
- group conditions
- preview results
Implementation Notes
- Build on top of:
- Avoid duplicating logic already implemented in dialogs
- Query system should evaluate against current graph state
Edge Cases
- Invalid queries
- Type mismatches (string vs numeric)
- Empty results
Relation to Feature
Part of:
#215 Graph filtering, querying & subgraph extraction
Overview
Introduce a query builder system that allows users to define complex filtering conditions using a structured interface instead of isolated dialogs.
This is the long-term UI and UX layer for the filtering system introduced in #215.
Motivation
Current filtering mechanisms are:
Users need to express richer queries such as:
(type = "investor") AND (degree > 5) AND (weight ≥ 10)
This requires a unified and extensible query system.
Prerequisite: Arbitrary chip removal in the filter bar (#219)
The filter bar (#219) currently only allows ×-close on the most recently applied chip, because the snapshot/restore stack stores full visibility snapshots without recording which filter produced each entry. Closing an arbitrary chip would require replaying filters.
To fix this, the snapshot stack must associate a filter descriptor with each entry:
GraphVisibilitySnapshotto store theFilterCondition(or a generic descriptor) that produced the snapshot.This is a prerequisite for meaningful AND/OR logical composition.
Scope
Phase 0 — Arbitrary chip removal (prerequisite)
GraphVisibilitySnapshotwith a filter descriptor fieldPhase 1 — Visual Query Builder (no-code)
Phase 2 — Internal Query Representation
Phase 3 — Optional DSL (advanced)
Example:
degree > 5 AND type = "investor"
Behavior
UI Suggestions
Implementation Notes
Edge Cases
Relation to Feature
Part of:
#215 Graph filtering, querying & subgraph extraction