UIA: use layout invalidated event to announce suggestion count across modern apps on Windows 10 and later#12791
Merged
Conversation
Recent Windows releases include better support for auto-suggest accessibility. So far there are two lists: one that raises item selected event on the first suggestion (Windows 10/11 Start menu, for example), and ones that uses layout invalidated event instead of selecting the first suggestion (Settings suggestion, for example). The first type was implemented years ago, but the second type isn't. Therefore introduce support for these kinds of suggestions lists, starting with adding UIA layout invalidated event constant (20008) to UIA events map.
… invalidated event. Re nvaccess#12790. Introduce an overlay class for suggestions list view which does not select the top suggestion but instead fires layout invalidated event. Examples include modern apps such as Windows 10/11 Settings app, Microsoft Store, and Maps app. Inside the new suggestions list class, layout invalidated event handler will simly announce child (suggestions) count whenever this event is fired.
…d event. Re nvaccess#12790. Suggestions list views with layout invalidated event have UI Automation Id of 'SuggestionsList', not to be confused with Edge-based suggestions list (lowercase s). The overlay class chooser code layout resembles search field -> suggestions list -> suggestion list item to help explain the overall flow of how auto-suggest typically works.
…ist item and new suggestions list. Re nvaccess#12790. Clarify that suggestion list item class handles top suggestion being selected automatically.
* UIA events: the map was (finally) tagged with annotations, a space was (finally) added between event Id's and names, finally resolve Flake8 F405 on event Id's. * NVDAObjects.UIA.SuggestionListItem: spacing.
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
Hi, I'm not too worried about system tests failing (winsock error 10061). |
seanbudd
approved these changes
Sep 20, 2021
michaelDCurran
approved these changes
Sep 24, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Link to issue number:
Fixes #12790
Fixes #7330
Fixes #12758
Summary of the issue:
Some suggestions list views do not select top suggestion automatically. Instead, UIA layout invalidated event is fired whenever list count and/or content changes.
Description of how this pull request fixes the issue:
Introduce a dedicated UIA overlay class for suggestions list views firing layout invalidated event, with the event handler told to announce suggestion count across modern apps on Windows 10 and later. Although layout invalidated event is supported on Windows 8.x, limit this to Windows 10 and later at first. At the same time, perform bonus lint to (finally) fix Flake8 issues in UIA events map and add annotations (at last).
Testing strategy:
Manual testing:
Prerequisites: Windows App Essentials add-on must be disabled.
Known issues with pull request:
There might be other suggestions list views that were not detected, and these should be added when encountering them later.
Change log entries:
New features:
In Windows 10 and later, NVDA will announce suggestion count when entering search terms in apps such as Settings and Microsoft Store. (#7330, #12758, #12790)
Code Review Checklist:
Additional context:
Initial discussion took place in #7330, a definitive use case is the crux of #12758, and implementation strategy was discussed in #12790. If folks believe a setting to toggle suggestion count announcement is useful, it can be done - the pull request left room for it. Lint is a bonus feature and could be reverted if requested.
Thanks.