Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displaying results counts for facet options in Instant Results #2563

Merged
merged 3 commits into from
Feb 24, 2022

Conversation

JakePT
Copy link
Contributor

@JakePT JakePT commented Jan 20, 2022

Description of the Change

Adds result counts for facet options in Instant Results.

Closes #2526.

Alternate Designs

Design-wise there could be any number of variations, but as the default I stuck with simple numbers in parentheses. To support users and themes styling the counts differently, such as in a bubble or similar, the counts have their own element, and parentheses are added with CSS so that they can be removed with CSS. From testing with VoiceOver there was no difference in accessibility in using CSS for the parentheses.

With this PR the counts are enabled by default, with no setting to choose to enable or disable them, however they occupy their own element so they can be easily hidden with a single line of CSS.

Possible Drawbacks

N/A

Verification Process

With this PR checked out the counts should be visible next to filter options in Instant Results. Selecting filter options should narrow down the number of results to the number next to each option, and the counts next to any remaining options should be updated to reflect the number of matching results in the current result set.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Displaying results counts for facet options in Instant Results.

Credits

Props @JakePT

@JakePT JakePT self-assigned this Jan 20, 2022
@JakePT JakePT linked an issue Jan 20, 2022 that may be closed by this pull request
@felipeelia felipeelia self-assigned this Feb 23, 2022
@felipeelia
Copy link
Member

@JakePT , the code overall looks good but the linter is giving a warning: Expected JSDoc block lines to be aligned. Do you mind fixing that one?

@JakePT
Copy link
Contributor Author

JakePT commented Feb 24, 2022

@felipeelia I've pushed fixes for the JSDoc warnings.

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.

Support displaying results counts for facet options in Instant Results
2 participants