Skip to content

Highlight active search constraints on results pages (LMFDB#2770) - #23

Open
roed-math wants to merge 1 commit into
mainfrom
ai/t31-active-constraints
Open

Highlight active search constraints on results pages (LMFDB#2770)#23
roed-math wants to merge 1 commit into
mainfrom
ai/t31-active-constraints

Conversation

@roed-math

Copy link
Copy Markdown
Owner

On search results pages, inputs that actively constrain the query are now visually distinguished with a subtle yellow background tint (text/select) or ring (checkbox), so users can see at a glance why the results are filtered. Marking happens server-side in the shared search_boxes.py machinery (is_constraint flag + _classes(info)), so it works across every section; a small JS hook keeps the highlight live as the user edits, pairing with the existing stale/fresh "Search again" signal. Display controls — result count, sort/column selectors, DynStats variable boxes, and diagram axis/color selectors — are explicitly excluded, and hidden inputs are untouched. The tint uses a new search_active_background color-scheme key (#FFF9C4), so the exact shade stays overridable per scheme. Verified with the Flask test client across elliptic curves, number fields, abstract groups, abelian varieties (checkbox), diagram search, and dynamic statistics, with browse pages unchanged; existing diagram-search and dynamic-stats tests pass. The precise colors (and the subtle checkbox ring in particular) are a maintainer taste call and easy to tune via the single color key. Addresses LMFDB#2770.

🤖 Generated with Claude Code

On search results pages, inputs that constrain the displayed query are now
visually distinguished with a subtle yellow tint so users can see at a glance
why results are filtered.

What/why: constraint-eligible search boxes render a `search_constraint` class
on results pages, plus `search_active` when their value in `info` is non-empty;
CSS tints active text/select backgrounds and rings active checkboxes. Display
controls (count, sort/column selectors, DynStats variable boxes, and diagram
axis/color selectors) set `is_constraint = False` so they are never
highlighted. Hidden inputs are untouched. A small JS hook keeps the highlight
live as the user edits, pairing with the existing stale/fresh button signal.

How verified: flask test client across elliptic curves, number fields, abstract
groups, abvar/Fq (checkbox), modular-curve/groups diagram search, and DynStats;
browse pages render unchanged; direct unit checks of every box subclass; all 19
color schemes resolve the new `search_active_background` key; /style.css renders;
ECQ diagram-search and CMF dynamic-stats tests pass; pyflakes clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants