Skip to content

appModules/searchui: add support for Search Highlights announcement in Windows 11#14221

Merged
seanbudd merged 3 commits into
nvaccess:masterfrom
josephsl:i13841searchuiSearchHighlights
Oct 10, 2022
Merged

appModules/searchui: add support for Search Highlights announcement in Windows 11#14221
seanbudd merged 3 commits into
nvaccess:masterfrom
josephsl:i13841searchuiSearchHighlights

Conversation

@josephsl

@josephsl josephsl commented Oct 8, 2022

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #13841

Summary of the issue:

In Windows 11, NVDA does not announce search highlights when entering Start menu.

Description of user facing changes

In Windows 11 21H2 and 22H2, NVDA will announce search highlights as part of the search box description (example: search box edit type here to search, search highlight text).

Description of development approach

_get_description method is introduced in appModules.searchui.StartMenuSearchField class that will obtain search highlights text (last child of the search box element with a unique UIA Automation Id) and treat it as the description text for the search field. To account for Windows 10 and to handle search results display (when search highlights text is unavailable), return the description provided by base UIA object if search highlights element is gone. With this change, if no search term is entered, NVDA will announce search highlights as part of search field description in speech and braille.

Testing strategy:

Manual testing (cannot be tested with Appveyor as it uses Windows Server 2019 so no search highlights there):

Requirements: Windows 11 Version 21H2 build 22000.800 or above, Version 22H2 build 22621.521 and later:

  1. Open Start menu.
  2. Prior to the pull request, NVDA will say, "search box edit". With the PR, NVDA will say, "search box edit" followed by the name of the last element (search highlights text) if present.
  3. Without entering search terms, press NVDA+Tab to read focused element properties. NVDA will announce search highlights if present.
  4. Type something (say, NVDA) to the search field. NVDA will announce the top search result.
  5. Press NVDA+Tab, and NVDA will announce "search box" followed by the terms entered (no search highlights text).
  6. Clear search terms.
  7. Press NVDA+Tab and NVDA will announce search highlights text again.

Known issues with pull request:

Braille is not updated when search terms are entered into Start menu search field, more towards a limitation of not refreshing element properties when it changes. This may require a fix from braille output side unless the PR approach is the cause.

Change log entries:

Can be both a new feature and a bug fix, will leave it up to NV Access to decide what's better (sensitive to Windows 10 Version 22H2 feature set as Search Highlights may or may not be backported to Vibranium):

In Windows 11, NVDA will announce search highlights when opening Start menu. (#13841)

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • Security precautions taken.

Additional context:

https://blogs.windows.com/windows-insider/2022/06/16/releasing-windows-11-build-22000-766-to-the-release-preview-channel/

… Windows 11 . Re nvaccess#13841.

In Windows 11 (21H2 and 22H2), Search Highlights was added - a text with top search suggestion of the day. The highlight text lives in the last child of search box element with a specific UIA Automation Id, so try detecting this and incorporate its name as search field description, allowing search highlight text to be announced when entering Start menu. Of course if search highlights is not present (Windows 10), return whatever description the base UIA object provides.
@josephsl josephsl requested a review from a team as a code owner October 8, 2022 20:26
@josephsl josephsl requested a review from seanbudd October 8, 2022 20:26
Comment thread source/appModules/searchui.py Outdated
# #7370: do not announce text when start menu (searchui) closes.
announceNewLineText = False

def _get_description(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the correct type?

Suggested change
def _get_description(self):
def _get_description(self) -> str:

@josephsl

josephsl commented Oct 9, 2022 via email

Copy link
Copy Markdown
Contributor Author

…s#13841.

Comment from Sean Budd (NV Access): add type hint please (returns str).
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit e0ecd4f1da

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit e0ecd4f1da

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit e0ecd4f1da

@seanbudd seanbudd merged commit 8929dd0 into nvaccess:master Oct 10, 2022
@nvaccessAuto nvaccessAuto added this to the 2023.1 milestone Oct 10, 2022
@josephsl josephsl deleted the i13841searchuiSearchHighlights branch December 21, 2022 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

enable search highlights support

4 participants