Skip to content

Make Regex, Fuzzy and prefixed Glob column filters work - #354

Merged
matt-edmondson merged 2 commits into
mainfrom
fix/319-column-filter-types
Oct 7, 2026
Merged

matt-edmondson merged 2 commits into
mainfrom
fix/319-column-filter-types

Conversation

@matt-edmondson

@matt-edmondson matt-edmondson commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #319

Before: every column filter (Owner, Repository, Build, Branch, Status, and ShouldShowEmptyRepository) built its pattern as "*" + filter.ToUpperInvariant() + "*", whatever filter type the column used. Only a single plain Glob word worked:

  • Regex: *MAIN* doesn't parse, so it matched every row. Uppercasing also turned \d into \D.
  • Fuzzy: the pattern included the two literal *, so no row matched.
  • Glob prefixes: -main started with *, so the exclusion was ignored.

After: all seven call sites go through one helper, ColumnFilter.IsMatch:

  • Glob: each word without a prefix is wrapped in *…*, so typing mai still finds main. Words starting with -, !, ^ or + are left as typed.
  • Regex and Fuzzy patterns are passed through unchanged.
  • Matching is case-insensitive through TextFilterCaseSensitivity.CaseInsensitive, not by uppercasing the pattern.

ShouldShowBuildBranch and ShouldShowEmptyRepository are now internal instead of private, so tests can drive them.

Context: the triage comment suggests fixing #318 first, because a Fuzzy filter that matches nothing also stopped polling. That is a separate fix. This PR makes the filter types themselves behave.

Tests

ColumnFilterTests test the helper directly:

  • Regex ^main$ matches only main. ^\d+$ matches 1234 but not main.
  • Fuzzy mn matches main.
  • Glob -main hides main and shows develop.
  • A plain Glob word still matches anywhere, ignoring case. An empty filter shows everything.
  • MakeGlobMatchAnywhere wraps only words without a prefix.

ColumnFilterRowTests go through the table's own row checks, with filters set on AppData and the default ByWordAny match options a new install starts with:

  • On the Branch column: Regex ^main$ shows only main, Fuzzy mn matches main, and Glob -main hides main.
  • Owner, Repository, Build and Status each filter on their own value, using a mix of Glob, Regex and Fuzzy.
  • An empty repository is filtered by Owner and Repository.

Each fix was checked by reverting it:

  • With ColumnFilter.IsMatch reverted to the old wrap-and-uppercase pattern, the four acceptance-criteria tests in ColumnFilterTests fail.
  • With the seven call sites reverted to the old inline code, all five ColumnFilterRowTests fail.

Full suite: 103/103 passing locally on Linux.

🤖 Generated with Claude Code

https://claude.ai/code/session_0118yDY82foMMXSZ6XaQmc4c

claude added 2 commits October 7, 2026 09:36
Every column filter wrapped the typed text in *...* and uppercased both
sides, whatever filter type the column was set to. Only a plain Glob
word survived that: a Regex such as *MAIN* failed to parse and matched
everything, uppercasing turned \d into \D, a Fuzzy filter had to find
the literal asterisks and matched nothing, and a Glob token like -main
lost its prefix to the leading *.

All five columns and ShouldShowEmptyRepository now go through
ColumnFilter.IsMatch. It wraps only unprefixed Glob words, passes Regex
and Fuzzy patterns through unchanged, and matches case-insensitively
through TextFilterCaseSensitivity instead of uppercasing.

Fixes #319

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0118yDY82foMMXSZ6XaQmc4c
The quality gate failed on coverage of new code: the seven call sites in
ShouldShowBuildBranch and ShouldShowEmptyRepository were never executed
by a test. Both are now internal, and the new tests set each column's
filter on AppData, with the default ByWordAny match options a new
install starts with, and check which rows are shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0118yDY82foMMXSZ6XaQmc4c
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 933e1b0 into main Oct 7, 2026
14 checks passed
@matt-edmondson
matt-edmondson deleted the fix/319-column-filter-types branch October 7, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants