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

Search fields: announce suggestion count #7330

Closed
josephsl opened this issue Jun 28, 2017 · 13 comments · Fixed by #12791
Closed

Search fields: announce suggestion count #7330

josephsl opened this issue Jun 28, 2017 · 13 comments · Fixed by #12791
Milestone

Comments

@josephsl
Copy link
Collaborator

Steps to reproduce:

A list of the steps you take to demonstrate the problem.

Example:

  1. Open Chrome
  2. Browse to www.google.com
  3. Type "Hello"
  4. Notice an error sound when enter is pressed.

Please also remember to attach a zip of any files required to reproduce the issue.

Expected behavior:

Tell us what should happen.

Actual behavior:

Tell us what happens instead.

System configuration:

NVDA version:

Example: next-14027,c80e529f

NVDA Installed or portable:

Other information:

Example: Running in a VM

Windows version:

Example: Windows 10 Version 1607 Build 14393.1066

Name and version of other software in use when reproducing the issue:

Other questions:

Does the issue still occur after restarting your PC?

Have you tried any other versions of NVDA?

Please list them and the result
Hi,

Building on #6241: in some cases (such as search box in Settings app in Windows 10), it is possible to know how many suggestions are there. Thus allow NVDA to announce suggestion count.

One big question: should this be tied to position info setting or create a new setting for this? I'm leaning towards former.

Technical: because controllerFor returns a list of objects and because the first object is a list, it is possible to use list.childCount. In other words, this is yet another Windows 10 App Essentials code being donated to NV Access.

Thanks.

josephsl added a commit to josephsl/nvda that referenced this issue Jun 28, 2017
…xes. re nvaccess#7330.

In some search fields, because one needs to use arrow keys to go through suggestions, it is important that people know how many suggestions are out there. Thus suggestionsOpened event in SearchField will announce this provided that report position information checkbox is checked in Object Presentation dialog.
@jcsteh
Copy link
Contributor

jcsteh commented Jun 28, 2017 via email

@josephsl
Copy link
Collaborator Author

josephsl commented Jun 28, 2017 via email

@jcsteh
Copy link
Contributor

jcsteh commented Jun 28, 2017 via email

@Qchristensen
Copy link
Member

I agree with Jamie that reading the number of results while typing is distracting, and the information is readily available by down arrowing. I started wondering if we could play say a high pitched tone when suggestions first appear and get lower as they narrow down. The problem with that idea is that unlike say progress bars, which have defined start and end points, who is to say how many search results might be the upper limit?

So then I thought, what if we play a tone, like now when the search suggestions first appear, and a lower tone when the number of suggestions drops below say 10. It's not too many to arrow through, but getting small enough that it should have what you want without you needing to type the whole thing. Some places have set upper limits of how many they will show (Chrome shows up to 6, Firefox and Edge 10, Windows Store 11). I wonder if fields disclose their maximum results? In those cases, max - 1 might be more useful than an arbitrary number?

Otherwise, I was wondering whether a command like NVDA+numpad delete / NVDA+delete could be used to give the exact count? That would avoid the user needing to down arrow. Down arrow is definitely the easiest way to get an exact count, but there are places, such as the address bar in Chrome or Firefox, where using the down arrow will move through the suggestions and change the original text, so you can't keep typing where you left off if what you want isn't yet among the suggestions.

@derekriemer
Copy link
Collaborator

derekriemer commented Jun 28, 2017 via email

@jcsteh
Copy link
Contributor

jcsteh commented Jun 29, 2017 via email

@derekriemer
Copy link
Collaborator

derekriemer commented Jul 1, 2017

@jcsteh commented on Jun 28, 2017, 8:07 PM MDT:

  1. I kinda like the idea of having the report location command provide this
    info, though it doesn't quite "fit" the idea of "location". Report focus
    might be a better fit, but there's no way currently to provide arbitrary
    info with that command.

Isn't that what overriding reportFocus does?

@jcsteh
Copy link
Contributor

jcsteh commented Jul 1, 2017 via email

@Qchristensen
Copy link
Member

Re this code not being used in Chrome / Firefox, would adding extra functionality to some autocomplete fields (Start menu search etc) but not others then cause confusion. As hard as it is with every single program feeling the need to re-invent every type of control, as a user, I get used to the way a particular type of control works (announcing number of suggestions, or not, for instance), and then I ideally like all controls that do the same thing to work the same.

@jcsteh
Copy link
Contributor

jcsteh commented Jul 11, 2017 via email

@derekriemer
Copy link
Collaborator

@jcsteh commented on Jul 1, 2017, 5:24 AM MDT:

Nope. reportFocus is used by focus events, not by NVDA+tab.

My latex-access code uses reportFocus in this way, and gets called.

@derekriemer
Copy link
Collaborator

never mind, I have a script_reportFocus I forgot about there which calls reportFocus for nvda+tab.

@josephsl
Copy link
Collaborator Author

Hi,

August 2021 update: the implementation is being tested. Turns out the overall mechanism comes from UIA layout invalidated event, which is quite separate from UIA controller for/suggestions event.

To (finally) answer Quentin's question and to provide an update for Jamie: as I hinted earlier, Windows 10/11 Start menu implementation is part of NVDA, and a related concept was merged into NVDA 2021.2 (to deal with Windows Search found in File Explorer since Windows 10 Version 1909). The current implementation (suggestion sound and auto-suggest announcement) is possible in Start menu because NVDA will automatically announce the first result. For ones coded with layout invalidated event (because that's the other auto-suggest implementation that is under discussion here), suggestion sound is played but no suggestion count is announced, and that's the crux of #12758. I think, for consistency and to provide better experience, I vote to implement this issue, whjich involves donating parts of Windows App Essentials code to NVDA Core.

Looks like a more generic issue might be in order (to mention layout invalidated event)...

Thanks.

seanbudd added a commit that referenced this issue Sep 27, 2021
… modern apps on Windows 10 and later (#12791)

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).

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.

Commits:

* UIA handler: add layout invalidated event constant. Re #12790.

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.

* NVDAObjects.UIA: introduce SuggestionsList class to handle UIA layout invalidated event. Re #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.

* NVDAObjects.UIA: detect suggestions list views with layout invalidated event. Re #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.

* NVDAObjects.UIA: clarify the difference between existing suggestion list item and new suggestions list. Re #12790.

Clarify that suggestion list item class handles top suggestion being selected automatically.

* UIA handler and UIA objects: lint bonus.

* 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.

* update changes

Co-authored-by: buddsean <sean@nvaccess.org>
@nvaccessAuto nvaccessAuto added this to the 2021.3 milestone Sep 27, 2021
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