Implement fact check filters#32
Merged
Merged
Conversation
* This feels snappier and more natural. It also prevents an empty
listing when all filters are removed manually i.e. without using the
"Clear Filters" option
* Clicking anywhere outside the filter dropdown now closes the
dropdown. Previously, you had to click outside the actual filter bar
to dismiss a filter dropdown which was annoying
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
* Selecting a filter now fetches and filters the listing immediately
instead of requiring the user to click on "Apply Filters"
kelvinkipruto
approved these changes
Jun 29, 2026
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.
Summary
/fact-checksgrid filter server-side (region/topic/language) instead of the prior placeholder client-side-on-current-page filtering, which narrowed live results to empty. Filters map to real Superdesk taxonomy — region →countries, topic →01harm, language →swp_article_metadata.language— and are folded into the sameswp_article_bool_expwhere+ aggregate as the existing pagination, so counts/pages stay correct (AND across dimensions, OR within one).?region=…&topic=…&language=…&page=), so it's shareable and survives reload/back-forward. Options are editorial{code,label}maps: the normalized subject relation exposes no display name, no reverse relation, and no tenant scope, so a scoped/labeled option list can't be queried (documented intrack-a-tasks.md).mapStorynow populatesregion/topic/languagelabels from the jsonb, andTaxonomyRowrenders only present dimensions (no more "Topic · Region · Language" placeholder leak on live cards).?page=clamps to the last valid page instead of showing a false "no matches"; dropdowns close on any click outside their options.Test plan
/fact-checks→ full grid, no filters applied.?topic=polit_harm, count/pagination reflect the filtered total.?topic=…&page=99→ shows last valid page, not an empty "no matches".pnpm test,tsc,biomeclean (70 tests; new coverage forbuildFactCheckWhere, URL helpers, andmapStorytaxonomy).Closes #30