Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(ui): preset filter buttons via QUICK_FILTERS - #24

Merged
Upellift99 merged 2 commits into
mainfrom
feat/quick-filters
Sep 12, 2026
Merged

feat(ui): preset filter buttons via QUICK_FILTERS#24
Upellift99 merged 2 commits into
mainfrom
feat/quick-filters

Conversation

@Upellift99

@Upellift99 Upellift99 commented Sep 12, 2026

Copy link
Copy Markdown
Owner

What

A QUICK_FILTERS setting (Label=needle;…) renders preset buttons under the search box. Clicking one fills the search with its needle; clicking the active one clears it. The active preset is highlighted and persisted with the other UI preferences.

A needle may hold several |-separated terms matched as OR, and the search box now accepts the same syntax (desktop|laptop), so one button can cover a family of clients.

Example, for a fleet mixing workstations and servers:

QUICK_FILTERS=Workstations=desktop|laptop;Servers=web

How

  • Settings.quick_filters + quick_filter_list (labels default to the needle, blanks and duplicate labels dropped, at most 20 entries, labels ≤ 40 chars, validated at startup).
  • View model passes the list to index.html; buttons are plain <button aria-pressed> styled in the existing inline stylesheet (no Tailwind rebuild needed).
  • JS: filterTerms() splits the filter on |, renderQuickFilters() syncs the highlight with the search box, a click handler toggles the preset.

Tests

  • tests/test_quick_filters.py: parsing edge cases, validation errors, rendering and HTML escaping of labels/needles, block omitted when unset.
  • tests/e2e/test_dashboard.py::test_quick_filter_buttons_filter_rows_and_toggle: OR matching, highlight, toggle, and manual typing highlighting the matching button. _serve gained **overrides for such fixtures.
  • ruff, ruff format, mypy --strict, pytest (173) and the e2e suite (5) all pass locally.

CI

The first run failed before collecting a single test: anyio 4.15.1 (released after main's last CI run) deprecates anyio.abc.BlockingPortal, which starlette's TestClient still imports, and filterwarnings = error turned that into an ImportError of tests/conftest.py (exit code 4). Unrelated to this feature, but it blocks every PR: a second commit adds a warning filter scoped to that one message, to drop once starlette catches up.

Docs

README: new row in the configuration table and a "Quick filters" section; QUICK_FILTERS added to compose.example.yml and compose.oidc.example.yml. CHANGELOG untouched (release-please).

🤖 Generated with Claude Code

https://claude.ai/code/session_0113DEa3m359srdD3TtkNm2n

Add a QUICK_FILTERS setting ("Label=needle;…") that renders preset buttons
under the search box. Clicking one fills the search with its needle;
clicking the active one clears it. The active preset is highlighted and
persisted with the other UI preferences.

A needle may hold several |-separated terms matched as OR, and the search
box now accepts the same syntax ("desktop|laptop"), so a single button can
cover a family of clients.

Parsing lives in Settings.quick_filter_list (labels default to the needle,
blanks and duplicate labels dropped, at most 20 entries, labels ≤ 40 chars,
validated at startup). Covered by tests/test_quick_filters.py (parsing,
rendering, HTML escaping) and a Playwright e2e test that exercises the
OR matching, the highlight and the toggle. The e2e `_serve` helper now
accepts Settings overrides for such fixtures.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_0113DEa3m359srdD3TtkNm2n
@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ovispect/config.py 94.44% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

…ette ships #3498

anyio 4.15 (2026-09-02) deprecates the `anyio.abc.BlockingPortal` alias,
which starlette's TestClient still imports at module load in its latest
release (1.6.0, 2026-08-08). With `filterwarnings = ["error"]` the warning
aborts conftest import: pytest exits with code 4 before running a single
test, on every fresh install since the anyio release. Reproduced locally
by pinning anyio==4.15.1.

Dependencies are current; the fix simply is not published yet: starlette
switched to `anyio.from_thread.BlockingPortal` on master on 2026-09-05
(Kludex/starlette#3498). The ignore is scoped to that one message and
marked to be removed at the first starlette release after 1.6.0.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_0113DEa3m359srdD3TtkNm2n
@Upellift99
Upellift99 merged commit b857bdd into main Sep 12, 2026
13 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 12, 2026
Upellift99 added a commit that referenced this pull request Sep 12, 2026
The setting shipped in #24 with README and compose examples, but the
.env.example that compose.example.yml tells users to copy was left out.


Claude-Session: https://claude.ai/code/session_0113DEa3m359srdD3TtkNm2n

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant