appModules/searchui: add support for Search Highlights announcement in Windows 11 (#14221)
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.
* appModules/searchui: add support for Search HIghlights anouncement in Windows 11 . Re #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.
* appModules/searchui: add type hint for description getter. Re #13841.
Comment from Sean Budd (NV Access): add type hint please (returns str).
* update changes
Co-authored-by: Sean Budd <sean@nvaccess.org>