Skip to content

feat(site): count each filter option against the other filters - #322

Merged
Mearman merged 2 commits into
mainfrom
feat/site-relative-filter-counts
Nov 11, 2026
Merged

Mearman merged 2 commits into
mainfrom
feat/site-relative-filter-counts

Conversation

@Mearman

@Mearman Mearman commented Nov 11, 2026

Copy link
Copy Markdown
Owner

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.

facetValueCounts in site/listing-query.ts does 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.

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.
@Mearman
Mearman merged commit bad2bdd into main Nov 11, 2026
10 checks passed
@Mearman
Mearman deleted the feat/site-relative-filter-counts branch November 11, 2026 08:31
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.137.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant