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

Report tab count changes to screen readers #6128

Merged
merged 2 commits into from
Jan 22, 2024
Merged

Conversation

robertknight
Copy link
Member

In the new search UI there is no longer a status message which tries to describe the search result counts in detail. Instead we rely on the existing counts that are displayed on tab titles.

Add a hidden status message with role="status", aria-live="polite" to communicate changes in these counts to assistive technology users.

Part of #6006


Testing:

  1. Activate screen reader
  2. Toggle focus filters or enter or clear search queries. When the number of matching threads changes and the tab counts update, the screen reader will (politely) announce this as eg. "10 annotations, 12 notes".

In the new search UI there is no longer a status message which tries to describe
the search result counts in detail. Instead we rely on the existing counts that
are displayed on tab titles.

Add a hidden status message with `role="status", aria-live="polite"` to
communicate changes in these counts to assistive technology users.

Part of #6006
Copy link
Contributor

@acelaya acelaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and works as expected. Just added a suggestion on handling plural forms.

Comment on lines 129 to 137
if (annotationCount > 0) {
tabCountsSummaryPieces.push(`${annotationCount} annotations`);
}
if (noteCount > 0) {
tabCountsSummaryPieces.push(`${noteCount} notes`);
}
if (orphanCount > 0) {
tabCountsSummaryPieces.push(`${orphanCount} orphans`);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's worth handling singular/plural forms for annotation/s, note/s and orphan/s, depending on the values being 1 or greater than 1.

I reckon you created a simple pluralization function some time ago that could be used here, but an inline ternary would be also fine, I think.

Copy link

codecov bot commented Jan 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9fa607e) 99.45% compared to head (ac4aec6) 99.45%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6128   +/-   ##
=======================================
  Coverage   99.45%   99.45%           
=======================================
  Files         265      265           
  Lines       10225    10239   +14     
  Branches     2475     2481    +6     
=======================================
+ Hits        10169    10183   +14     
  Misses         56       56           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@robertknight robertknight merged commit 2f6b57b into main Jan 22, 2024
4 checks passed
@robertknight robertknight deleted the selection-tabs-sr-status branch January 22, 2024 14:10
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.

2 participants