conhost: Make screen readers announce search results - #20532
conhost: Make screen readers announce search results#20532Carlos Zamora (carlos-zamora) wants to merge 2 commits into
Conversation
|
Ok. I've been trying to replicate the UX from Windows Terminal. Here's my findings. Windows Terminal UXSteps:
Using Narrator results in the experience described above. Using NVDA, however, DOES NOT. Specifically, NVDA suppresses the announcements due to nvaccess/nvda#13261. Conhost UX
Using Narrator results in the experience described above. The tricky part here is that we're missing the "X selected" announcement after we close the search box. From some testing and investigation, it looks like the issue is that the Find dialog has its own HWND, so it suppresses the UIA events from the underlying terminal control. Narrator does have some weird behavior here too. Specifically, consider these two cases before the find dialog is opened:
Normally, the way that last "X selected" announcement is made is not through a UIA notification, but actually a simple UIA UX when using NVDAAs mentioned above, NVDA suppresses UIA notifications from conhost and Terminal due to nvaccess/nvda#13261. As such, the approach of using UIA notifications as a whole doesn't work, full stop. That said, this is consistent across both terminals, so I think that's ok. If they want to opt-in to the new notification, it will require changes on their side, and I think that's fair (though I'm open to feedback here). Adding the missing "X selected" announcement in Conhost when using NarratorWe're able to "fake it" using a UIA notification with a simple When no selection exists before opening the find dialog, this works as expected and fixes the issue! Upon closing the find dialog, you'll hear a However, if a selection did exist on, for example, The fix is stashed on my machine at home. It's pretty small and easy, but I want to make sure this is an approach we want before committing it. |
Summary of the Pull Request
Fixes a bug in console host where search results weren't being announced by the screen reader.
Adds 2 localized resources for announcements:
ID_CONSOLE_MSGFINDRESULT:"%1!d! of %2!d!"ID_CONSOLE_MSGFINDNORESULT:"No results"Updates the
AccessibilityNotifierwith a newAnnounceSearchResults()which handles making the announcements above usingUiaRaiseNotificationEvent()(similar to how we make similar announcements in Windows Terminal).The user experience itself is similar to Windows Terminal. The main difference being that Terminal announces the selection state after closing the search box (" selected"), and console host does not.
References and Relevant Issues
Validation Steps Performed
Opened the search box and performed a search with...
✅ results --> "<1-indexed num> of "
✅no results --> "no results"
PR Checklist
Closes https://dev.azure.com/microsoft/OS/_workitems/edit/37170192/?view=edit