Page MenuHomePhabricator

Skip irrelevant ARIA descriptions when editing single-part templates
Closed, ResolvedPublic2 Estimated Story Points

Description

This is a direct follow-up for the changes done in T291284: Each sidebar element should have a clear label, role, state and description/instructions.

  • When the user is editing a single-part template, do not read the instructions to move the template. It's not possible anyway. Except:

Nice to have

  • Read the instructions to delete the template because pressing Crtl+Del is still possible and a more direct way for someone using a screen reader to delete a template. (If this complicates the logic of hiding, then it's fine to leave this out)

Event Timeline

thiemowmde set the point value for this task to 2.Nov 10 2021, 11:14 AM

Change 738875 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/extensions/VisualEditor@master] Only use aria description on multipart transclusions

https://gerrit.wikimedia.org/r/738875

@ECohen_WMDE, sorry to bring this up again, but when reviewing the patch and testing it myself I found this part super confusing:

Read the instructions to delete the template because pressing Crtl+Del is still possible and a more direct way for someone using a screen reader to delete a template.

Why would anyone want to empty the dialog by pressing Ctrl+Del on the last template? I find this really weird. There are multiple other ways to do the same:

  • I can press the back button in the upper corner and go back to the initial search for a template.
  • Deleting an existing template from the page is done from outside of the template dialog. If what I want is to start fresh with an empty dialog, I just add a new template.

It might be ok to leave the shortcut active. But I would not advertise it to the user as if this is a normal thing to do. It's a redundant patter to memorize. The feature is rarely ever needed – only on multi-part templates, and usually not even there. And it's actually a bit dangerous because it deletes your work with no warning.

Change 738875 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Only use aria description on multipart transclusions

https://gerrit.wikimedia.org/r/738875

Change 739134 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: WMDE-Fisch):

[mediawiki/extensions/VisualEditor@master] Make better use of the ARIA mixin

https://gerrit.wikimedia.org/r/739134

While reviewing the remaining patch https://gerrit.wikimedia.org/r/739134 (this is only code cleanup), I got confused by some behavior that is, as far as I can tell, somewhat flawed.

  1. The instructions for moving/removing transclusion parts (Ctrl+Shift+Cursor and Ctrl+Del) only exist when the part is a template or wikitext. It's missing on template placeholder parts. But the shortcuts work on placeholders as well.
    • There is a checkbox for wikitext parts in T291284, and it's checked. I don't know what happened, but it looks like this got lost.
    • Template placeholders are not mentioned in T291284.
  2. The instructions are currently arranged in a way that makes it sound like you need to select a part with space first before you can move/remove it. That's only partially true. The selected state only matters when you continue pressing tab and navigate down to the toolbar. The toolbar buttons act on the selected part. But that's not what the ARIA description is about. Ctrl+Shift+Cursor and Ctrl+Del act on the focused part. No need to press space first. Selection doesn't matter. That would be confusing for a screenreader user as they can't easily see which element is selected the moment they press Ctrl+Shift+Cursor and Ctrl+Del. Instead the hotkeys act on the same element that contains the description where the hotkeys are mentioned, i.e. the focused element.
    • Because of this the ARIA description is almost always the shortest "Press Space to select the template.". This includes all parts of a multi-part template, as long as none is selected.

Summary: As of now the hotkeys almost always work (the only exception are the move keys on single-parts), but are almost never announced because of the 2 problems described above.

This comment was removed by thiemowmde.
  • There is a checkbox for wikitext parts in T291284, and it's checked. I don't know what happened, but it looks like this got lost.

The instructions exist for wikitext. See https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualEditor/+/refs/heads/master/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineWikitextWidget.js It's also working for me. If it's not working on your end than there might be a bug?

Thanks for having a look. Looks like I confused something. I fixed my comment in T295353#7513913.

Change 739134 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Make better use of the ARIA mixin

https://gerrit.wikimedia.org/r/739134

WMDE-Fisch removed WMDE-Fisch as the assignee of this task.
WMDE-Fisch moved this task from Demo to Done on the WMDE-TechWish-Sprint-2021-11-24 board.
  1. The instructions are currently arranged in a way that makes it sound like you need to select a part with space first before you can move/remove it. That's only partially true. The selected state only matters when you continue pressing tab and navigate down to the toolbar. The toolbar buttons act on the selected part. But that's not what the ARIA description is about. Ctrl+Shift+Cursor and Ctrl+Del act on the focused part. No need to press space first. Selection doesn't matter. That would be confusing for a screenreader user as they can't easily see which element is selected the moment they press Ctrl+Shift+Cursor and Ctrl+Del. Instead the hotkeys act on the same element that contains the description where the hotkeys are mentioned, i.e. the focused element.
    • Because of this the ARIA description is almost always the shortest "Press Space to select the template.". This includes all parts of a multi-part template, as long as none is selected.

Summary: As of now the hotkeys almost always work (the only exception are the move keys on single-parts), but are almost never announced because of the 2 problems described above.

I added this open question to T294521: Finishing touches on keyboard shortcuts in the new template dialog