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

NVDA is not announcing Item Status property changed events in WPF #13973

Open
japarson opened this issue Aug 2, 2022 · 11 comments · Fixed by #14080
Open

NVDA is not announcing Item Status property changed events in WPF #13973

japarson opened this issue Aug 2, 2022 · 11 comments · Fixed by #14080
Labels
p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.

Comments

@japarson
Copy link

japarson commented Aug 2, 2022

Steps to reproduce:

  1. Download the Visual Studio Community 2022 installer.
  2. Run the installer to install VS with the Universal Windows Platform development workload selected.
  3. Open Visual Studio.
  4. In the Get started dialog, click Create a new project.
  5. In the search box, type "uwp" and select the first option Blank App (Universal Windows).
  6. Next -> Create -> OK.
  7. Project -> Publish -> Create App Packages...
  8. Next.
  9. Select From Azure Key Vault...
  10. Click on any of the WPF DataGrid column headers to change the sort direction of the column.

Expected behavior:

Clicking on the column headers triggers a AutomationPeer.RaisePropertyChangedEvent to fire for the AutomationElementIdentifiers.ItemStatusProperty.

When using Narrator, this event will be announced in the form of a message that states the new item status. When the sort direction is ascending, it will announce "Column Name - Ascending". Likewise, when the sort direction is descending, it will announce "Column Name - Descending".

The video below shows a user interacting with the "Select a certificate in Azure Key Vault" dialog in Visual Studio. In this dialog, there is a WPF DataGrid which is used to display information about code signing certificates that are stored in a Key Vault. The DataGrid contains 4 columns, each with a column header: Name, Status, Expiration Date, and Thumbprint. The user clicks on the Status column header and after Narrator finishes introducing some dialog context, it announces "Status Ascending". The user clicks on the Status column header again and Narrator announces "Status Descending" because the sort direction is now descending. Once more, the user clicks the column header to sort in ascending order and Narrator announced "Status Ascending". The user then performs these same steps on the Expiration Date column header where Narrator announced "Expiration Date Ascending" and "Expiration Date Descending" respectively.

narrator.mp4

Actual behavior:

When using NVDA, there is only an announcement when the column header is hovered or first clicked, but none when the sort direction changes.

The video below shows a user interacting with the "Select a certificate in Azure Key Vault" dialog in Visual Studio. In this dialog, there is a WPF DataGrid which is used to display information about code signing certificates that are stored in a Key Vault. The DataGrid contains 4 columns, each with a column header: Name, Status, Expiration Date, and Thumbprint. The user hovers over the Status column and NVDA announces "Status". The user clicks on the Status column header and after NVDA finishes introducing some dialog context, it announces "Status header item 2 of 4". The user clicks on the Status column header again to make the sort direction descending and NVDA makes no announcement. Once more, the user clicks the column header to sort in ascending order and NVDA makes no announcement. The user then performs these same steps on the Expiration Date column header where NVDA is once again not announcing the new Item Status of the column header.

2022-08-02.00-03-07.mp4

NVDA logs, crash dumps and other attachments:

nvda.log

System configuration

NVDA installed/portable/running from source:

Installed.

NVDA version:

2022.2

Windows version:

Edition Windows 11 Pro
Version 21H2
Installed on ‎10/‎5/‎2021
OS build 22000.795
Serial number MJ0EK6FF
Experience Windows Feature Experience Pack 1000.22000.795.0

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

Microsoft Visual Studio Enterprise 2022 (64-bit) - Preview
Version 17.3.0 Preview 5.0

Other information about your system:

N/A

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.

Have only tried latest version of NVDA.

If NVDA add-ons are disabled, is your problem still occurring?

No add-ons are installed.

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Yes.

@josephsl
Copy link
Collaborator

josephsl commented Aug 2, 2022 via email

@Brian1Gaff
Copy link

Brian1Gaff commented Aug 2, 2022 via email

@josephsl
Copy link
Collaborator

josephsl commented Aug 2, 2022 via email

@josephsl
Copy link
Collaborator

josephsl commented Aug 2, 2022

Hi,

Update: what I suspected is happening.

Technical: as reported, UIA does fire item status property change event when the grid header changes. NVDA does include an example implementation of item status event handler for Windows 10 Action Center. The solution to this issue is to expand Action Center app module solution to UIA NVDA objects with one specific workaround: remove duplicate announcements via timestamp checks and/or caching. As promised, I will come up with a solution via Windows App Essentials NVDA add-on (as soon as within the next ten minutes, although the solution (for now) will result in duplicate item status announcements). Transforming the add-on solution into an actual NVDA screen reader pull request can take some time as we need to discuss design choices, but the idea is simple: add event_UIA_itemStatus event handler in source/NVDAObjects/UIA/__init__.py (if you are willing, I can walk you through this process provided that you would like to write the PR this week).

By the way, there is an add-on called Event Tracker that will log events as they occur, including (surprisingly enough) UIA item status property event.

Thanks.

@josephsl
Copy link
Collaborator

josephsl commented Aug 2, 2022

Hi,

Here it is - linked is a try build of Windows App Essentials add-on that should resolve this issue. The official solution requires more thought since it must also resolve duplicate item status output:
https://github.com/josephsl/wintenApps/releases/download/22.08/wintenApps-try13973-20220802.nvda-addon

Thanks.

@seanbudd seanbudd added p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation. labels Aug 4, 2022
josephsl added a commit to josephsl/nvda that referenced this issue Aug 28, 2022
…perty event. Re nvaccess#13973.

Announce item status UIA property whenever it changes provided that there is no pending event of the same coming from the same element. Note that both the element name and item status are announced.
josephsl added a commit to josephsl/nvda that referenced this issue Aug 28, 2022
…nnouncements. Re nvaccess#13973.

Borrowing from Windows 10 Action Center (ShellExperienceHost) app module: cache item status propety for the element so it can be compared to the text coming from item status property event, and if they match, drop the event. This also removes the need to use event handler's pending events function.
seanbudd added a commit that referenced this issue Aug 29, 2022
…perty event (#14080)

Closes #13973

Summary of the issue:
In parts of Visual Studio 2022 and possibly other apps, NVDA is not announcing item status property changes.

Description of user facing changes
NVDA will announce item name and status when the status changes.

Description of development approach
Add base implementation of UIA item status property event handler in base UIA NVDA object, borrowing heavily from an existing implementation in ShelExperienceHost (Windows 10 Action Center) app module introduced in 2019

* NVDAObjects.UIA: introduce base implementation of UIA item status property event. Re #13973.

Announce item status UIA property whenever it changes provided that there is no pending event of the same coming from the same element. Note that both the element name and item status are announced.

* NVDAObjects.UIA: cache item status property text to avoid duplicate announcements. Re #13973.

Borrowing from Windows 10 Action Center (ShellExperienceHost) app module: cache item status propety for the element so it can be compared to the text coming from item status property event, and if they match, drop the event. This also removes the need to use event handler's pending events function.

Co-authored-by: Sean Budd <sean@nvaccess.org>
@nvaccessAuto nvaccessAuto modified the milestone: 2022.4 Aug 29, 2022
@seanbudd seanbudd removed this from the 2022.4 milestone Sep 13, 2022
@seanbudd seanbudd reopened this Sep 13, 2022
seanbudd added a commit that referenced this issue Sep 14, 2022
…atus property event (#14080)" (#14136)

This reverts commit a4644ef.

This reverts commit a4644ef.

Link to issue number:
reverts #14080
re-opens #13973

Summary of the issue:
Based on discussion in #14086 (comment), it appears that #14080 makes the behaviour worse when using WPF projects in VS.

Description of user facing changes
#13973 is now an issue again

Description of development approach
reverts #14080
@fsteffi
Copy link

fsteffi commented Mar 17, 2023

@japarson and @seanbudd is there any update on the fix of this bug

@PoojaNamde
Copy link

@seanbudd is there any update on the fix of this bug

@Adriani90
Copy link
Collaborator

@josephsl are you planing to integrate your solution in Win10Apps into NVDA core for this issue?

Is There something that can be done from the WPF team as external fix?

cc: @siagupta0202, @anjali-wpf, @arpitmathur, @dipeshmsft, @himgoyalmicro, @harshit7962 maybe you can help here as well.

@josephsl
Copy link
Collaborator

josephsl commented Jul 9, 2024

Hi,

I have removed support for UIA item status property change event from my add-on a long time ago, and it is unlikely that I'll work on it.

Thanks.

@Adriani90
Copy link
Collaborator

Adriani90 commented Jul 9, 2024 via email

@josephsl
Copy link
Collaborator

josephsl commented Jul 9, 2024

Hi,

A bit complicated - Narrator may or may not exhibit this issue. If it doesn't, then a solution from NVDA may need to be implemented along with a discussion with WPF team inside Microsoft.

Part of the reason for removing item status property event from Windows App Essentials was due to duplicate announcement problem and other issues after implementing it. It is unlikely to come back because I'm doing everything I can to minimize my participation in NVDA community (life priorities).

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants