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

Accessibility: Announce notices to assertive technologies #4192

Merged
merged 1 commit into from
Jan 2, 2018

Conversation

youknowriad
Copy link
Contributor

closes #3690

This PR uses the a11y lib to announce the publish flow notices to assertive technologies.
I was wondering if I should do this systematically for all notices (in a generic way) but decided not to because the assertive message could defer from the notice's content.

@youknowriad youknowriad requested a review from afercia December 28, 2017 09:28
@youknowriad youknowriad self-assigned this Dec 28, 2017
@youknowriad youknowriad added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Dec 28, 2017
@jorgefilipecosta
Copy link
Member

I think a generic way would be preferable as by default we would always announce notices.

the assertive message could defer from the notice's content.

One option the overcome that problem in a generic approach would be to add an option called spokenMessage to createNotice options. When that option is present we would use that property instead of the normal notice message for the spoken text.

@youknowriad
Copy link
Contributor Author

One option the overcome that problem in a generic approach would be to add an option called spokenMessage to createNotice options. When that option is present we would use that property instead of the normal notice message for the spoken text

I thought about this, but if the developer is unaware of the behavior, this might produce "wrong" messages (html inside etc...). Thoughts @afercia

@afercia
Copy link
Contributor

afercia commented Dec 28, 2017

Hm as far as I know, speak should already strip out HTML?
Ideally, the string for an audible message should be carefully crafted, for example it wouldn't make much sense to reuse "Post published! View post". Even stripping out the link, View post wouldn't make much sense. The message could simply be Post published. I'd tend to agree with @jorgefilipecosta: add a specific string for the audible messages, fallback to the notice string, educate developers, and document everything.

@youknowriad youknowriad force-pushed the update/announce-notices branch from dd30136 to c668bb3 Compare December 28, 2017 16:46
@youknowriad
Copy link
Contributor Author

PR updated with the generic approach.

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

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

From the code point view changes look good to me 👍

@youknowriad youknowriad merged commit 617edcb into master Jan 2, 2018
@youknowriad youknowriad deleted the update/announce-notices branch January 2, 2018 09:47
@@ -346,6 +346,7 @@ describe( 'effects', () => {
id: 'SAVE_POST_NOTICE_ID',
isDismissible: true,
status: 'success',
spokenMessage: 'Post published!',
Copy link
Member

Choose a reason for hiding this comment

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

These should be localized.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, these are only tests. The message is localized :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notices related to the publishing workflow should be announced to assistive technologies
4 participants