Skip to content

Show the dismiss X for facets applied as ?column__exact=value - #2869

Open
cycsmail wants to merge 1 commit into
simonw:mainfrom
cycsmail:facet-exact-selected-2011
Open

Show the dismiss X for facets applied as ?column__exact=value#2869
cycsmail wants to merge 1 commit into
simonw:mainfrom
cycsmail:facet-exact-selected-2011

Conversation

@cycsmail

@cycsmail cycsmail commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Closes #2011.

The filter form always redirects to ?column__exact=value (filters_should_redirect defaults the op to exact), but ColumnFacet only looked for ?column=value when deciding if a facet value was selected, so a facet applied that way rendered as a plain link with no X to remove it. That matches the screenshot on the issue: Sole Source was applied by clicking the facet, so it gets an X, while Contract Type came from the filter form and doesn't. The spaces and punctuation in the value turned out to be a red herring.

Facet values now match either form of the querystring, and the toggle link removes whichever key is actually in the URL. One thing I left alone: when a __exact filter is present, the links for the other values in that facet still append ?column=value next to it, same as before this change.

Added a regression test, the 19 tests in tests/test_facets.py pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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.

Applied facet did not result in an "x" icon to dismiss it

1 participant