Gutenberg: Wrong notification message shown when an entity is moved to trash

Created on 14 Dec 2019  路  12Comments  路  Source: WordPress/gutenberg

Describe the bug

When moving a post to trash from the Document settings pane in Gutenberg:

Screen Shot 2019-12-13 at 18 36 15

(Image above is a screen shot of the Gutenberg editor with focus set to the "Move to trash button")

VoiceOver announces after successful completion of operation that the post has been reverted to draft:

Screen Shot 2019-12-13 at 18 37 16

(Image above is a screenshot of the Posts section in wp-admin, where the recently deleted post appears to have been moved to trash but the VoiceOver caption is announcing that the post has been reverted to draft)

I expect the announcement to be "Post moved to trash" instead. Also, the just-deleted post does not appear as a draft, as announced, but instead appears in the Trash, as expected.

To reproduce
Steps to reproduce the behavior:

  1. Open a published post.
  2. On the Document settings pane, click on "Move to trash"
  3. Post is correctly moved to trash, but VoiceOver announces that it has been reverted to draft instead.

Desktop

  • OS: macOS 10.15.1
  • Browser: Safari 13.0.3
Accessibility (a11y) Needs Accessibility Feedback [Priority] Low [Status] In Progress [Type] Bug

Most helpful comment

~#25563 definitely needs a follow-up to fix the translation issue @afercia mentioned.~

Edit: just saw #25604

Very easy but not ideal solution:

noticeMessage = sprintf(
    /* translators: %s: post type singular name. */
    __( '%s trashed.' ),
    postType.labels.singular_name
);

Better solution:

noticeMessage = postType.labels.item_trashed; // where item_trashed is "Post trashed." or "Page trashed."

Filter post type labels to add needed label as long as https://core.trac.wordpress.org/ticket/51387 is pending

There's some precedence here:

https://github.com/WordPress/gutenberg/blob/5de94bba090d31fc995e8ead15d8189cdb5818ae/lib/compat.php#L473-L510

All 12 comments

@tellthemachines When you have a moment, would you mind confirming if you can reproduce this? Thank you in advance!

Using VoiceOver with Safari I could not reproduce this issue on macOX 10.14.5.

I was able to reproduce this again. It appears that there are several consecutive messages that VoiceOver announces really quick that "Post reverted to draft" gets omitted.

I changed VO's verbosity settings to "Low" and I was able to see and hear "Post reverted to draft" for a split second before I get navigated to the Post's list page.

@enriquesanchez I was also able to reproduce the issue at the second time of trying, it seems a little inconsistent, as you say, probably related to the message being interrupted as the page and focus changes.

Thanks for testing @talldan!

I wonder if it's possible to enqueue the announcements so none gets interrupted?

Actually this is because we don't handle the trash case and VoiceOver announces another message from the created notification.

Looking alsto at #25563, I couldn't reproduce this. Maybe it happens only when the "redirect" to the Posts page is very slow so that the screen reader has time to announce the aria-live message delivered on the block editor page.

However, I'm not sure why the aria-live message should be delivered on the block editor page in the first place. When trashing a post, users are brought to the Posts page so they're (rightfully) forced to abandon the page where the aria-live message is supposed to work.

Instead, I'd tend to think the final trashing confirmation step is on the Posts page, where an admin notice is already displayed:

Screenshot 2020-09-23 at 19 42 38

To improve accessibility I wouldn't try to make the message on the block editor page "work". Instead I'd try to:

  • improve the accessibility of the admin notice displayed on the Posts page, see https://core.trac.wordpress.org/ticket/50486
  • make sure that when trashing, no aria-live messages are used on the block editor page, as in: prevent the message "Post reverted to draft." (and any other message) to be triggered

Maybe it happens only when the "redirect" to the Posts page is very slow so that the screen reader has time to announce the aria-live message delivered on the block editor page.

It happens after successful deletion of the entity and right before redirecting.

For now the respective PR fixed the case of showing proper message and the current issue.

improve the accessibility of the admin notice displayed on the Posts page, see https://core.trac.wordpress.org/ticket/50486

This is something to work on core and is not part of GB. Thanks for having opened that ticket @afercia.

Thanks @ntsekouras

It happens after successful deletion of the entity and right before redirecting.

My point is that I can't reproduce this issue 馃檪 I would have appreciated more details instructions to reproduce it.

Also, I think my previous point sill stands: why we would want to use an aria-live message on a page where users are redirected away from?

My point is that I can't reproduce this issue 馃檪 I would have appreciated more details instructions to reproduce it.

I don't know why, but I could see the notification every time, before redirecting :). And this could probably be the case for more users when using a live site and redirecting to something other than localhost (internet connections come in play).

Also, I think my previous point sill stands: why we would want to use an aria-live message on a page where users are redirected away from?

I'm not sure about this from accessibility perspective, but in cases like mine (always seeing the message), I think this is definitely an improvement, being notified properly for my action..

Fair enough 馃檪 @ntsekouras can you please have a look at my comment on the PR? The message string is not translatable.

~#25563 definitely needs a follow-up to fix the translation issue @afercia mentioned.~

Edit: just saw #25604

Very easy but not ideal solution:

noticeMessage = sprintf(
    /* translators: %s: post type singular name. */
    __( '%s trashed.' ),
    postType.labels.singular_name
);

Better solution:

noticeMessage = postType.labels.item_trashed; // where item_trashed is "Post trashed." or "Page trashed."

Filter post type labels to add needed label as long as https://core.trac.wordpress.org/ticket/51387 is pending

There's some precedence here:

https://github.com/WordPress/gutenberg/blob/5de94bba090d31fc995e8ead15d8189cdb5818ae/lib/compat.php#L473-L510

Was this page helpful?
0 / 5 - 0 ratings