Skip to content

UIA: use layout invalidated event to announce suggestion count across modern apps on Windows 10 and later#12791

Merged
seanbudd merged 7 commits into
nvaccess:masterfrom
josephsl:i12790suggestionsList
Sep 27, 2021
Merged

UIA: use layout invalidated event to announce suggestion count across modern apps on Windows 10 and later#12791
seanbudd merged 7 commits into
nvaccess:masterfrom
josephsl:i12790suggestionsList

Conversation

@josephsl

Copy link
Copy Markdown
Contributor

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.

  1. Open Start menu.
  2. Type something. NVDA will announce the top suggestion.
  3. Open Settings app (Windows+I).
  4. Type something. NVDA will only play suggestion sound without this pull request, it will also announce suggestion count as user types more terms with the PR applied.

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:

  • Pull Request description is up to date.
  • Unit tests.
  • System (end to end) tests.
  • Manual testing.
  • User Documentation.
  • Change log entry.
  • Context sensitive help for GUI changes.
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers

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.

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.
@josephsl josephsl requested a review from a team as a code owner August 29, 2021 03:02
@AppVeyorBot

This comment has been minimized.

@josephsl

Copy link
Copy Markdown
Contributor Author

Hi,

I'm not too worried about system tests failing (winsock error 10061).

@seanbudd seanbudd merged commit 7865227 into nvaccess:master Sep 27, 2021
@nvaccessAuto nvaccessAuto added this to the 2021.3 milestone Sep 27, 2021
@josephsl josephsl deleted the i12790suggestionsList branch October 17, 2021 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants