Skip to main content

Module filter

Module filter 

Source
Expand description

Rich per-column filter model plus the pure matching pipeline.

A ColumnFilter combines two independent, AND-composed mechanisms that mirror the Numbers-style filter popover:

  • an optional operator predicate (the “Choose One” rule) — a text “like” operation (contains / begins with / regex …) for string columns, or a numeric/date comparison (greater than / between …) for numeric and date columns; and
  • an optional value set (the searchable checkbox list) — the exact set of formatted values that are allowed through.

Either half is inert when unset (FilterPredicate::None and values == None respectively), so an empty ColumnFilter passes every row. This module is intentionally GPUI-free: it operates on CellValue/ResolvedColumnFormat and is reusable from exports, tests, and server-side previews.

Structs§

ColumnFilter
A single column’s committed filter: an optional operator predicate ANDed with an optional allow-list of formatted values.

Enums§

FilterPredicate
The operator-rule half of a ColumnFilter.
NumberOp
Numeric / date comparison operators offered for ColumnKind::Integer, ColumnKind::Decimal, and ColumnKind::Date columns.
TextOp
Text (“like”) operators offered for string-like columns (ColumnKind::Text, ColumnKind::Boolean, ColumnKind::None).

Functions§

cell_passes_filter
Evaluate a cell against a column filter. Empty/inert filters pass.
parse_ymd_to_unix
Parse a YYYY-MM-DD calendar date into Unix seconds (UTC midnight). Returns None for malformed input. Used to interpret date operands typed into the filter panel’s range fields.
uses_number_ops
true when a column of kind uses numeric/date operators rather than the text “like” operator set.