Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Follow-up from #2896722: Leverage PluginWithFormsInterface to encapsulate @WorkflowType schema and clean up state/transition form methods.
The select link is lacking context for screen readers
See this comment: #2896722-68: Leverage PluginWithFormsInterface to encapsulate @WorkflowType schema and clean up state/transition form methods..
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#16 | 2898913-update-select-button-aria-label-16.patch | 2.9 KB | Sam152 |
#8 | 2898913-update-select-button-aria-label-8.patch | 1.65 KB | Sam152 |
Comments
Comment #2
larowlanThe select link is lacking context for screen readers
Comment #4
larowlanComment #5
larowlanComment #6
xjmAs a core gate, this would probably be WI crticical I think? Hopefully I'm using the tag correctly, thanks. Thanks Lee for filing this!
Comment #7
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedHaving a look.
Comment #8
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedUpdating the label to match the wording found in the modal title that the button launches.
It will now read:
The modal title is:
I assume the user will already have the context of which workflow is being viewed. The other aria labels on the same form read "Edit Draft state" and not "Edit Draft state for the Editorial workflow".
Comment #9
timmillwoodLooks fine to me, I would RTBC, but think we need accessibility sign off.
Comment #10
Wim LeersI did an accessibility review.
Unfortunately #8 results in
aria-label="Select content type entities"
on the<select>
andSelect the content type entities for the Editorial
as the modal title.These should be
aria-label="Select content types"
andSelect the content types for the Editorial workflow
as the modal title.Comment #11
timmillwoodThat's not our fault.
\Drupal\Core\Entity\EntityType::getPluralLabel
adds@label entities
.There is an issue open for this, but I can't find it.
We could change the modal title from "Select the content type entities for the Editorial" to "Select the content type entities for the Editorial workflow" but that's a separate issue.
Comment #12
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedComment #13
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedWe don't need to do this - it's going beyond what we need to do to satisfy the accessibility gate.
The operations links elsewhere in the admin UI don't have aria-label attributes, so patch #8 would introduce a UI inconsitency. Likewise, the aria-label attributes already present in the State and Transition operations links in
WorkFlowEditForm.php
are out of step with other core pages.The link does have context, at least as far as it is defined in WCAG. There are two success criteria relating to link text.
At this level it's sufficient if a link makes sense in the context where it encountered. Context comes from the semantic document structure. Typically this means the surrounding text in a sentence/paragraph, or in this case the related table header element. Most screen readers offer tools to interact with tables (announce headers of current cell, jump to start of row, etc). A user can employ these to find be sure that they have the correct operations drop-button in a table.
Having said that, there are some ways we could improve the link context for operations in tables:
<caption>
elements - our admin forms are lacking these currently. Most admin pages in Drupal have just a single table, and the purpose can be gleaned form the page title. The workflow configuration form is unusual in having 3 separate tables (states and transitions from WorkFlowEditForm, plus the applies-to table from ContentModerationConfigureForm). Table captions could help a lot here!This level is about links being understandable when they are disconnected from their context in the document structure, for example when using a list-all-links screen reader tool.
The aria-label attributes in patch #8 would help to satisfy Link Purpose (Link Only), but level-AAA exceeds the requirements of our accessibility gate. The read-more links for node teasers already address Link Purpose at level-AAA. These are more important in a way, as they are aimed at website visitors, rather than admin-users.
I do think it would be a good idea to pursue 2.4.9 Link Purpose (Link Only) for operations links across all of Drupal core. However I think it would be better to target a future D8 minor release, and introduce it across the whole of core admin, instead of doing it one form at a time.
So in the short term I propose:
WorkFlowEditForm.php
. This is to avoid being inconsistent from the rest of core. I guess we can probably do this in time for an 8.4.0 RC release.Longer term, let's use separate issues to explore admin-wide table captions, row-level table headers, and level-AAA link text for operations. These would all make great targets for 8.5.0 say.
Comment #14
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedComment #15
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedThe patch I'm suggesting would remove the 4 aria-label instances from edit/delete state/transition operations in
WorkFlowEditForm.php
Comment #16
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedSeems like we can safely downgrade the status of this, if the current approach goes beyond what is expected in core.
Here is the patch suggested in #15.
Comment #17
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedComment #18
timmillwood@Sam152 - Beat me to it! 😆
The patch in #16 looks to cover everything mentioned in #15. Talking to @andrewmacpherson on Slack it sounds like consistency is key, so lets get this in!
Comment #19
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedI just tried #16 in simplytest.me - all looks good.
Comment #22
larowlanUpdating issue credit to add Wim and Andrew for their reviews
Checked there were no other instances of aria-label in content moderation and workflows modules.
Committed 3cb53fe and pushed to 8.5.x.
Cherry-picked as 9f0c704 and pushed to 8.4.x