Repository: nvaccess/nvda

Issue:
enable search highlights support
### Steps to reproduce:
Search highlights functionality is available in windows 11 22 h2 and I believe it is coming to other windows versions (EG 11 21 h2) and maybe in the future Windows 10 22 h2 .

Using Windows 11 22H2 (build 22621.160)
- Run narrator.
- Press the start menu.
  - Note, Narrator should read the search box plus also read today's highlight.
  - In Brazil today's highlight is viva São João.
- Exit Narrator and start NVDA.
- Press the start menu.
  -  Note NVDA speech
  
### Actual behavior:
NVDA reports: "search edit"

### Expected behavior:
Report "edit search viva São João"

### System configuration
#### NVDA installed/portable/running from source:
installed

#### NVDA version:
nvda.exe, NVDA alpha-25684,ac7215b1

#### Windows version:
11 22621.160
#### Name and version of other software in use when reproducing the issue:

#### Other information about your system:

### Other questions
#### Does the issue still occur after restarting your computer?
yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
no
#### If add-ons are disabled, is your problem still occurring?
yes
#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
yes


Discussion:
Hi,

Three months later... I see what's going on.

Technical: a new child element (Automation Id: PlaceholderTextContentPresenter) was added to Start search box control in Windows 11 Version 22H2 (subsequently backported to Windows 11 Version 21H2), containing "today's search" (search highlights) text as described above. It appears Narrator is using this text as part of an element property, and if NVDA can detect it, it becomes possible to implement the resolution for this issue (ideally as part of SearchUI app module's Start search field class).

In the meantime, I will take care of it in a slightly different form as part of Windows App Essentials add-on - when focus moves to Start search box, NVDA will queue search highlights text announcement. It would be great if someone takes care of this in NVDA Core, both as a learning experience and for me to do more important things in life; I might look into it if no-one steps up by say, late December 2022 or early January 2023 (too late for 2022.4, I think).

Thanks.
Hi,

Found it - while I haven't found the actual property for it, using object description would provide a similar experience. In short, this involes adding a "get_description" method to Start search field class in SearchUI app module, which involves looking for an element with a specific Automation Id, then pulling it as the search field description.

As 2022.4 beta release is quite close at hand, I'm debating whether or not to queue this for the upcoming release or wait until 2023.1 development is in full swing. In the meantime, I'll post a pull request to resolve this issue.

Thanks.

Resolving patch:
diff --git a/source/appModules/searchui.py b/source/appModules/searchui.py
--- a/source/appModules/searchui.py
+++ b/source/appModules/searchui.py
@@ -20,6 +20,12 @@ class StartMenuSearchField(SearchField):
 	# #7370: do not announce text when start menu (searchui) closes.
 	announceNewLineText = False
 
+	def _get_description(self) -> str:
+		# #13841: detect search highlights and anounce it.
+		if self.lastChild.UIAAutomationId == "PlaceholderTextContentPresenter":
+			return self.lastChild.name
+		return super().description
+
 
 class AppModule(appModuleHandler.AppModule):
 


Test patch: