Repository navigation
feat(site): count each filter option against the other filters - #322
Merged
Merged
Conversation
An option's count was its total over every record, so with several filters set it promised rows the listing did not hold. It now shows how many records the option adds given the other filters, and how many hold it in all when that differs.
|
🎉 This PR is included in version 0.137.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
A filter option's count was its total over every record. With other filters set it promised rows the listing did not hold: with a domain and a subject chosen that together match nothing, the subject option still read "(1)" while the listing said "0 of 1333".
Each option now shows how many records it would add given the other filters, and "n of total" when that differs from its total across the catalogue, so "audio-signal-processing (0 of 1)" says both. An attribute's own choices do not narrow its own options, since several values of one attribute are alternatives; the free text and the entity bounds do apply. Options keep their order from the totals, so one does not move as the other filters change.
facetValueCountsinsite/listing-query.tsdoes the counting and is unit tested. The e2e test narrows by kind and expects every subject count to be well formed, some to be partial, and none to exceed what the page holds.