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

Dialog headers needing announced. #17631

Merged
merged 5 commits into from
Oct 27, 2023
Merged

Conversation

tidy-dev
Copy link
Contributor

xref: https://github.com/github/accessibility-audits/issues/6728

Description

Seeing that the prop for the ariaLabelledby in the popover-dropdown was aria-labelledby. I figured getting the branch select dropdown header to announce would be a easy fix. However, in doing so, I found that it would announce for NVDA but it would not announce for VoiceOver. 😠 Did some spot checking and most of our dialogs no longer announce their titles. 😞

So.. easy fix turned into figuring out the new VoiceOver problem. Turns out that VoiceOver works fine if an dialog element had a header child that is NOT associated via the aria-labelledby. This is incorrect as it should work with the semantics wired up. But, VoiceOver wants to do it's auto detection thing.

Technically, we could leave it correctly wired and just file a bug with Apple. But, that leaves all our VoiceOver users in a lurch. Thus, in this PR, I added isMacOSSonoma check to our dialog and popover dialogs similar to our isMacOSVentura, fortunately Apple improved upon the dialog title announcing behavior of Sonoma so it is less complex. That said, in the next major version of macOS, we may end up needing to do this again.. It is a bummer, but is the best thing to do for our users.

Screenshots

Tested our popovers, regular dialogs, and confirm (alert) dialogs.

CleanShot.2023-10-26.at.11.22.47.mp4

Release notes

Notes:
[Fixed] The branch select popover header in the pull request preview dialog is announced by screen readers.
[Fixed] The dialog and popover headers are announced by VoiceOver in macOs Sonoma.

Comment on lines -236 to +231
if (!isMacOSVentura()) {
if (isMacOSVentura()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Decided to invert the checks since now we have multiple. Basically the bottom return statement is the "expected" one if we do not have any if that redirect it.

}
}

if (this.props.role === 'alertdialog') {
if (isMacOSSonoma() && this.props.role !== 'alertdialog') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

macSomona did improved that their alertdialogs work as intended where Ventura didn't! :)

Comment on lines +53 to +54
systemVersionGreaterThanOrEqualTo('14.0') &&
systemVersionLessThan('15.0')
Copy link
Contributor Author

@tidy-dev tidy-dev Oct 26, 2023

Choose a reason for hiding this comment

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

Sadly, this either means version 15 will need a similar addition or they will fix it in 15.. They did make some improvements from 13 to 14. 🤞 Feedback from accessibility team is that we are acknowledging that this may not be readily caught until another audit.

<span id="popover-dropdown-header">{contentTitle}</span>
<h3 id="popover-dropdown-header">{contentTitle}</h3>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Header should be a header anyways.. but is important for macOS VoiceOver

Comment on lines -119 to +120
<h3 id="diff-options-popover-header">
Diff {__DARWIN__ ? 'Settings' : 'Options'}
</h3>
<h3 id="diff-options-popover-header">{header}</h3>
Copy link
Contributor Author

@tidy-dev tidy-dev Oct 26, 2023

Choose a reason for hiding this comment

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

This isn't necessary... NVDA nicely announces it as "Diff Options" but VoiceOver was doing "Diff level 2 settings". I assume because the {__DARWIN__ ? 'Settings' : 'Options'} was adding in a detectable child element.. This just make the VoiceOver announcement a clean Diff Settings

Copy link
Member

@sergiou87 sergiou87 left a comment

Choose a reason for hiding this comment

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

Nice work with this fix! I'm still running macOS 13 so I couldn't test the fix for Sonoma, but I verified there are no regressions with popovers or dialogs on 13 🎉

@tidy-dev tidy-dev merged commit 7f5a4c6 into development Oct 27, 2023
13 checks passed
@tidy-dev tidy-dev deleted the popover-dropdown-announcement branch October 27, 2023 10:47
@tidy-dev tidy-dev added the accessibility Issues related to accessibility improvements label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Issues related to accessibility improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants