Skip to content

Web grid: filter a column by number, text operator or empty cell - #5255

Merged
erikdarlingdata merged 1 commit into
devfrom
feat/5248-numeric-column-filters
Oct 5, 2026
Merged

erikdarlingdata merged 1 commit into
devfrom
feat/5248-numeric-column-filters

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Fixes #5248
Part of #4843

What users see change

Typing in a column filter works exactly as before (case-insensitive substring of the cell text). Beside the box there is now a "Match" list with the desktop's operators, chosen only when wanted:

  • number columns: Contains, Equals, Not equals, >, >=, <, <=, Is empty, Is not empty
  • text columns: Contains, Equals, Not equals, Starts with, Ends with, Is empty, Is not empty (a comma separates alternatives, as on the desktop)
  • time columns: Contains, Is empty, Is not empty

The chip names the choice ("CPU: > 900"). The operator is kept at module scope with the text, so the 60 s repaint keeps it. Is empty / Is not empty hide the text box.

What changed

panels.js only. The column's numeric value comes from the same path the sort uses: a new columnValue (sortValue, else the row key) feeds both the sort and the filter, and sortKeyOf turns it into a number. The column kind is sortKindOf, the same decision the sort makes. > 900 therefore matches a cell showing "1,000". The typed number drops , % $ and spaces, as the desktop does. If the cell or the typed text is not a number, an ordering matches nothing; Equals/Not equals fall back to text.

Empty vs zero: a cell is empty when its raw value is null, undefined, "", blank, NaN or an empty list. 0, false and a literal "-" are values. A column drawn by display() or render() with no raw value is empty when it shows nothing or the dash.

Not changed

No service or MCP read changes; the rows are already on the page.

Verified at the head

  • GridFilterBehaviourTests 15/15 (7 new). RED against unmodified panels.js: all 7 new tests fail (no operator list exists, so the operator harness cannot find it); the 8 existing pass.
  • GridAdoptionBehaviourTests 7/7, GridToolsBehaviourTests 9/9.
  • 132 classes (guard family, grid/panel/page classes, every class naming panels.js or a web harness): all pass except the expected platform ones (LivePostgresCollectionHygieneTests, RawWindowFloorViewerPortTests which needs WPF COM).
  • hygiene-scan: 0 offenders. node --check on panels.js: clean.

CHANGELOG entry

SECTION: Added
ENTRY: - Filter web grid columns by number, text operator or empty cell ([#PR]) - a column filter can now match greater/less than, equals, not equals, starts with, ends with, is empty and is not empty, comparing the real numbers rather than the formatted text; plain typing still does a contains match.
REF: [#PR]: https://github.com/erikdarlingdata/PerformanceMonitor/pull/PR

Why a time column offers no ordering operators

Checked against the desktop rather than assumed. ColumnFilterMatcher.cs:97 implements the
four ordering operators through CompareNumeric, which parses decimals only — so > on a
DateTime column parses nothing and matches nothing in the desktop either. The desktop's popup
still lists those operators for such a column, so choosing one there silently returns no rows.

The web omits them on time columns instead. That is a deliberate, narrow divergence: it removes
an operator that cannot work rather than reproducing a dead control. If date ordering is wanted
later it needs a real date comparison in both apps, which is its own change.

@erikdarlingdata erikdarlingdata added the merge-train In a merge train: its CI ran on the train PR label Oct 5, 2026
@erikdarlingdata
erikdarlingdata marked this pull request as ready for review October 5, 2026 14:51
@erikdarlingdata
erikdarlingdata merged commit c08f621 into dev Oct 5, 2026
11 of 14 checks passed
@erikdarlingdata
erikdarlingdata deleted the feat/5248-numeric-column-filters branch October 5, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-train In a merge train: its CI ran on the train PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant