Highlight active search constraints on results pages (LMFDB#2770) - #23
Open
roed-math wants to merge 1 commit into
Open
Highlight active search constraints on results pages (LMFDB#2770)#23roed-math wants to merge 1 commit into
roed-math wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pymachinery (is_constraintflag +_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 newsearch_active_backgroundcolor-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