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

Update InfoBar narrator behavior #4578

Conversation

marcelwgn
Copy link
Collaborator

Description

Now, the InfoBar will behave as follows:

  • Close button will be read as "Close infobar severity"
  • Should be announced as "Title Message Severity"
  • Default icons can be read and will be announced as "Icon severity ..."

Motivation and Context

Closes #4533 , closes #4534

How Has This Been Tested?

Tested manually.

Screenshots (if appropriate):

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Mar 18, 2021
dev/InfoBar/InfoBar.cpp Outdated Show resolved Hide resolved
<data name="InfoBarCloseButtonName" xml:space="preserve">
<value>Close</value>
<comment>Automation name of the close button.</comment>
<data name="InfoBarCloseButtonNameSeverityError" xml:space="preserve">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here and below: @gabbybilka feel free to suggest better text that should be used to announce the respective information, those were just a short text I used to plan and test things out.

@StephenLPeters StephenLPeters added accessibility Narrator, keyboarding, UIA, etc area-InfoBar team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Mar 19, 2021
@ranjeshj
Copy link
Contributor

@gabbybilka @YuliKl can you help define what should be announced ? "Close infobar error" sounds incorrect. Perhaps it could be
"Informational infobar close button"
"Success infobar close button"
"Warning infobar close button"
"Error infobar close button"

where the first word matches the severity enum.

@marcelwgn
Copy link
Collaborator Author

Updated the wording for the close button now.

dev/InfoBar/Strings/en-us/Resources.resw Outdated Show resolved Hide resolved
<comment>The formatted string read by narrator when the InfoBar opens: "{Title} {Message}, {severity level}"</comment>
</data>
<data name="InfoBarSeverityErrorName" xml:space="preserve">
<value>severity error</value>
Copy link
Member

@gabbybilka gabbybilka Mar 22, 2021

Choose a reason for hiding this comment

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

@YuliKl, I think this should be "Info message, error severity" to give context that the InfoBar is a message before the content is read out. Notification could also work here?

Or just "Error InfoBar" to match the close button text.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated wording now.

@@ -133,8 +145,40 @@
<value>InfoBar</value>
<comment>This is the custom landmark used to denote an InfoBar to narrator.</comment>
</data>
<data name="InfoBarIconSeverityErrorName" xml:space="preserve">
<value>Icon severity error</value>
Copy link
Member

Choose a reason for hiding this comment

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

@chingucoding Is it possible for the value to be the name of the icon if the icon is either the default or changed via resource from the default font set in generic.xaml?
It would be great if a user-provided icon set in IconSource had a name that we could set here as well.
@StephenLPeters has anything similar been done in other controls? Does Teaching Tip announce its icon?
@YuliKl I'm not sure of the value this announcement would provide with the current text considering the severity of the InfoBar will be announced when it opens. Maybe for when a user returns to the InfoBar after the initial announcement?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, today, icon's are entirely ignored by narrator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@gabbybilka Current behavior, if you use the build in icons, we use our texts for UIA. If the user specify their own icon, they should be in charge of the UIA behavior of that (at least we are not interfering there to any degree).

@ranjeshj
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@johnpf74
Copy link

@gabbybilka @YuliKl can you help define what should be announced ? "Close infobar error" sounds incorrect. Perhaps it could be
"Informational infobar close button"
"Success infobar close button"
"Warning infobar close button"
"Error infobar close button"

where the first word matches the severity enum.

Should there be similar text for the action button?

@ranjeshj
Copy link
Contributor

ranjeshj commented Apr 6, 2021

@chingucoding Sorry for the delayed response on this. We have been trying to reach out and get more information from accessibility experts on the correct approach for these issues. This is what we have finally landed on (which I think is simpler and gives a better accessibility experience).

• Set AutomationProperty.IsDialog=”true” in the default style so that the InfoBar elements (Icon + Title + Message) are read when an action or close button is first focused. When focus leaves an InfoBar and returns, the InfoBar elements will be re-read. This is special behavior that Narrator has for elements with this property set to true which works pretty well for InfoBar.
• Add Icon to the UIA tree to communicate that element as ‘Information image’, ‘Success image’, ‘Error image’, ‘Warning image’
• When the Severity, Title, or Message has changed the InfoBar should re-raise its notification event. Note that if multiple of these change one after the other, we raise the event just once after all of them are set.

@gabbybilka and @johnpf74 as FYI.

@gabbybilka
Copy link
Member

gabbybilka commented Apr 6, 2021

@chingucoding Sorry for the delayed response on this. We have been trying to reach out and get more information from accessibility experts on the correct approach for these issues. This is what we have finally landed on (which I think is simpler and gives a better accessibility experience).

• Set AutomationProperty.IsDialog=”true” in the default style so that the InfoBar elements (Icon + Title + Message) are read when an action or close button is first focused. When focus leaves an InfoBar and returns, the InfoBar elements will be re-read. This is special behavior that Narrator has for elements with this property set to true which works pretty well for InfoBar.
• Add Icon to the UIA tree to communicate that element as ‘Information image’, ‘Success image’, ‘Error image’, ‘Warning image’
• When the Severity, Title, or Message has changed the InfoBar should re-raise its notification event. Note that if multiple of these change one after the other, we raise the event just once after all of them are set.

Also, to clarify a few points:

  • Can you remove the resource names for the close button? Since we're setting AutomationProperty.IsDialog to true the close button (and action button) will have the appropriate context. The extra info associated with the close button would be too much.
  • For the InfoBarOpened notification instead of the 'Info message severity error' text for the first value, please use the text for the icon that is now added to the UIA tree.

Thanks so much!

@marcelwgn
Copy link
Collaborator Author

I think the changes are implemented now @ranjeshj and @gabbybilka . The icon already was in the UIA tree. Regarding reanouncing the InfoBar, I am not sure how to implement or how to prevent consecutive changes to not overlap.

Copy link
Member

@gabbybilka gabbybilka left a comment

Choose a reason for hiding this comment

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

@chingucoding

Regarding reanouncing the InfoBar, I am not sure how to implement or how to prevent consecutive changes to not overlap.

@StephenLPeters do you have any recommendations for how to implement this so that they don't overlap? Thanks both!

dev/InfoBar/InfoBar.cpp Show resolved Hide resolved
<data name="InfoBarIconSeverityWarningName" xml:space="preserve">
<value>Icon severity warning</value>
<comment>Automation name used to announce the severity warning icon.</comment>
</data>
<data name="InfoBarOpenedNotification" xml:space="preserve">
Copy link
Member

Choose a reason for hiding this comment

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

After testing, this string is no longer read when the InfoBar is opened. @ranjeshj as FYI but I think that is fine and preferred as the string generated by setting isDialog to true is announced instead.
In case my test was faulty, can you update the InfoBarSeverity{Severity}Name values to be "{Severity} icon" for consistency with the icon names? 😊

<comment>Automation name used to announce the severity error icon.</comment>
</data>
<data name="InfoBarIconSeverityInformationalName" xml:space="preserve">
<value>Icon severity informational</value>
Copy link
Member

Choose a reason for hiding this comment

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

Can each of these icon names be updated to "{Severity} icon"?

  • "Informational icon"
  • "Success icon"
  • "Warning icon"
  • "Error icon"

Copy link
Member

Choose a reason for hiding this comment

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

@chingucoding before merging in, can you update these names?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh yes, of course. Not sure how I missed this. should be updated now.

@ranjeshj
Copy link
Contributor

ranjeshj commented Apr 8, 2021

I think the changes are implemented now @ranjeshj and @gabbybilka . The icon already was in the UIA tree. Regarding reanouncing the InfoBar, I am not sure how to implement or how to prevent consecutive changes to not overlap.

One way might be to batch the changes and raise the automation event on an event that happens later, like say in a LayoutUpdated event and immediately unsubscribe from that LayoutUpdated event.

@beervoley
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@marcelwgn
Copy link
Collaborator Author

I don't really understand why the tests now fail with the changes made. All changes are in the UIA layer, none of them touch the Visual Tree from a rendering standpoint (only thing I can think of is a reference to elements on the visual tree). But I also don't really understand how the actual asserts in the failing test

or why they were designed the way they are. @teaP can you maybe help me out a bit here?

@beervoley
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ranjeshj
Copy link
Contributor

Weird. The changes are purely accessibility related so I'm not sure why layout test is failing. @teaP @StephenLPeters any thoughts ? @chingucoding can you merge in master so we can be sure something is not stale ?

Also, lets make the UpdateLayout part a separate PR. Thanks.

@gabbybilka gabbybilka self-requested a review April 19, 2021 19:01
@marcelwgn
Copy link
Collaborator Author

Merged with master now @ranjeshj .

Not sure what UpdateLayout part you are referring to here since all changes seem to be purely a11y wise, nothing related to the layout.

@teaP
Copy link
Contributor

teaP commented Apr 19, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@teaP
Copy link
Contributor

teaP commented Apr 19, 2021

I looked at this but I don't know what's happening either. The test seems to be failing because the strings are no longer top-aligned, but I'm not sure how that could have changed... maybe it's because the UIA bounding box was affected somehow?

@marcelwgn
Copy link
Collaborator Author

I looked at this but I don't know what's happening either. The test seems to be failing because the strings are no longer top-aligned, but I'm not sure how that could have changed... maybe it's because the UIA bounding box was affected somehow?

Is the bounding box affected by that? I thought it was just a purely "visual" aspect of a control, not something related to the UIA tree.

@ranjeshj
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ranjeshj
Copy link
Contributor

@teaP @chingucoding can you take a look visually and see if there is a difference ? If not perhaps the test needs to be updated.

@marcelwgn
Copy link
Collaborator Author

I wasn't able to find a visual difference, master branch and this PR seemed pretty much the same with the changes done in the test.

@teaP
Copy link
Contributor

teaP commented Apr 20, 2021

I wasn't able to find a visual difference, master branch and this PR seemed pretty much the same with the changes done in the test.

Yeah, same here. I'm trying to replace it with an API test that does the same thing now.

@teaP
Copy link
Contributor

teaP commented Apr 21, 2021

In this end, it was pretty simply -- I realized the test was indexing into the UIA children of InfoBar, and this change added the icon as the first child, so all the indices were 1 off. :)

@teaP
Copy link
Contributor

teaP commented Apr 21, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@marcelwgn
Copy link
Collaborator Author

In this end, it was pretty simply -- I realized the test was indexing into the UIA children of InfoBar, and this change added the icon as the first child, so all the indices were 1 off. :)

Totally didn't think about this. Thank you so much for fixing the test @teaP !

@ranjeshj ranjeshj merged commit 1f7779d into microsoft:master Apr 22, 2021
@marcelwgn marcelwgn deleted the user/chingucoding/inforbar-narrator-updates branch April 22, 2021 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Narrator, keyboarding, UIA, etc area-InfoBar team-Controls Issue for the Controls team
Projects
None yet
7 participants