Improve screen reader announcements for search box #19726
+42
−16
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 of the Pull Request
Improves the notification read out by a screen reader when a search is done in the terminal. This is done across several scenarios:
if (results.SearchInvalidated)fixes that.In order to maintain consistency with the written status message,
_FormatText()now takes anisAccessibleparameter to output a more accessible version of the text. Specifically...CurrentIndexTooHighStatus(aka?) would not be read, so we replace it withTermControl_UnknownSearchResultIndex(akaunknown)TermControl_TooManySearchResults(aka999+) would drop the+when read, so we replace it withTermControl_TooManySearchResults(akaover 999)TermControl_NumResults(aka{0}/{1}``) would be read as a fraction, so we replace it withTermControl_NumResultsAccessible(aka{0} of {1}`).Validation Steps Performed
✅ Announcements are read out when interacting with search box (i.e. next, prev, regex toggle, etc.)
✅ "4 of 5" read out by screen reader (or something similar) when search is performed
Closes #19691