Skip to content

feat(datagrid): per-column local value filter (Excel-style) #1454

@shouwang0527

Description

@shouwang0527

Problem

The current filter system (Filter Panel) generates SQL WHERE clauses and re-queries the server. There is no way to quickly filter the already-loaded result set by selecting specific values in a column.

When browsing a table with hundreds of rows, I often want to narrow down to rows where a column matches one of a few values I can see. Today this requires: open Filter Panel, pick the column, type the value, apply, wait for re-query. For exploring loaded data, this is too many steps.

Proposed behavior

Each column header shows a small filter/funnel icon (similar to Excel, Google Sheets, or DataGrip). Clicking it opens a popover:

  • Search box at the top for filtering the value list
  • A list of all distinct values in that column (from the currently loaded rows), with a count of occurrences
  • Checkboxes to select/deselect values
  • "Select All" / "Deselect All" toggle
  • Apply button

When applied, the data grid hides rows that don't match the checked values. This is a client-side filter on loaded data, not a new SQL query. Multiple columns can have active filters simultaneously (intersected).

The column header should visually indicate when a filter is active (e.g., highlight the funnel icon, show a badge).

Use cases

  • Browsing a users table, quickly show only rows where status = 'active'
  • Exploring query results, isolate rows matching specific enum values without modifying the query
  • Data exploration: see distinct value distribution per column at a glance (the count column in the popover)

Scope

  • Client-side only: operates on already-loaded rows, no additional queries
  • Non-destructive: original data stays intact, filtering only hides rows from view
  • Clear filter: either uncheck values or click a "clear" button to restore all rows

Existing architecture notes

The data grid currently flows through displayRow(at:) which resolves via sortedIDs. A client-side filter could insert between the sort step and the display step, maintaining a filteredIDs index that displayRow consults. The existing FilterCoordinator handles the SQL-based filter panel and is separate from this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions