Add faceted search with operators and saved searches - #2431
Open
ramiadavid wants to merge 1 commit into
Open
ramiadavid wants to merge 1 commit into
ramiadavid wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 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.
Fixes #1536
Description of changes:
Search boxes now build facets: type text, pick a field from the dropdown, and it
becomes a removable chip inside the field. Values within a facet are OR-ed and
separate facets are AND-ed, which covers the
and/or/notcombinations theissue asks for.
Six operators:
:contains,=equals,=~matches regex,!:does not contain,!=not equals,!~does not match regex. Picking one re-filters immediately;committing a chip freezes it, so a chip keeps meaning what it meant when it was
added.
The issue suggested Slack's syntax as a possible pattern. This goes with visible
chips instead of modifiers typed into the query, so the active filter is always on
screen and there is no syntax to learn. Happy to revisit if you would rather have the
Slack style.
Named saved searches per view, persisted with the user's preferences. Applying one
restores the whole query.
Eight views expose named fields: Pods, Deployments, Services, Events, Nodes, Secrets,
Config Maps and Namespaces. Every other view keeps exactly its current behaviour,
offering only "All fields".
Design notes worth a reviewer's attention:
A facet naming a field the current view does not have is skipped and shown struck
through, not applied. Applying it would empty the list for a positive operator and
filter nothing for a negative one, so the same chip would look broken or lie about
being applied depending on its operator. It is kept, so it applies again on a view
that does have the field - which matters because the linked search carries facets
across views. The label travels with the facet, so the chip still reads properly
where the field is unknown.
searchkeeps its meaning;searchOpandfacetsare new params beside it, soexisting links and
searchUrlParam.set(...)callers (the catalog's label badges,for one) behave exactly as before. A malformed
facetsparam degrades to "nofacets" rather than breaking the view.
=~ nginhas to findmy-nginx. Anchor explicitly with^...$.be true for almost everything.
Inputgains acontentLeftprop, symmetric to the existingcontentRight, so thechips render inside the field. It is the only change here touching a shared
component, and it is purely additive.
only the text turned a faceted search into a bare query when navigating away and
back, since routing pushes a path with no query string.
Testing:
the filtering through
ItemListLayout.type:check,biome checkandbuild:diclean.