Problem/Motivation
There are a (growing) pile of module-specific links on admin/modules. The 'Configure' link includes <span class="visually-hidden">the X module</span> for context to satisfy SC 2.4.4 (level A) and SC 2.4.9 (level AAA). However, the 'Help' and 'Permissions' links do not.
We noticed this while working on #3012004: Add a link to the module's drupal.org project page in the module admin page, now moved into #2906547: Add links to Drupal.org project pages to module listings in /admin/modules. @andrewmacpherson suggested we add the same context to all the links.
Steps to reproduce
- Install 9.3.x-dev or 9.2.7 core.
- Visit /admin/modules.
- Scroll down to "Node"
- Expand the "Allows content to be submitted to the site and displayed on pages." details element.
- Inspect the 'Help' and 'Permissions' links.
Proposed resolution
Add an appropriate <span class="visually-hidden"> context to these two links.
<span class="visually-hidden">Configure @module_name</span> PermissionsHelp <span class="visually-hidden">for @module_name</span>
Also proposing to remove the title attribute on both links, since it's now extra noise that doesn't add anything.
Remaining tasks
Confirm the right wording for each link.Decide if we should remove theYestitleattributes once the main link text has better context.Implement it.Add/update tests.Reviews/refinements.RTBC.- Commit https://www.drupal.org/files/issues/2021-10-29/3245622-17.no-title.patch.
User interface changes
More context for non-sighted users at /admin/modules.
No title attributes on the links?
API changes
None.
Data model changes
None.
Release notes snippet
TBD.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 3245622-17.no-title.patch | 4.45 KB | dww |
Comments
Comment #2
dwwI think this qualifies as an accessibility bug.
Comment #3
dwwThis might be all we need. Let's see if I can get the drupalci.yml changes right this time. 🤞😉
Comment #4
dww🤦♂️ Guess not. @mixologic pointed out I have the = sign in the --class, but run-tests.sh (what the bot uses) doesn't work like that. Let's try again. 🤞
3245622-4.patch is identical to 3245622-3.patch, just re-uploading so it's the last patch in here to make the bot happy.
Comment #6
darvanenThis seems like a small regression to me, why remove the test for the tooltip?
With that noted, 2.4.9 includes the advisory technique H33: Supplementing link text with the title attribute. Why make this change and keep the title/tooltip? It no longer adds anything to the link - especially if you move the "configure" verb into the visually-hidden part of the permissions link.
Comment #8
dwwThanks for the review! Re: #6:
Great question. Right, that advisory also says:
Yeah, probably we should remove title from these links, too. I don't think moving "configure" into the visually hidden part is easy, since we'd want that first, which would require two separate visually-hidden spans. That seems a bit icky.
Flagging for an accessibility review to get clarity on how to best proceed.
Thanks,
-Derek
p.s. Crediting @andrewmacphearson who suggested this in the first place.
Comment #9
darvanenGood plan to get this addressed by experts.
If two spans is icky (I agree) how about
<span>Configure @module module</span> Permissions?Comment #10
dwwSure, that mostly sounds good. Although for the Slack chat about getting the visually hidden text right for #2906547: Add links to Drupal.org project pages to module listings in /admin/modules, @andrewmacpherson said that "for the @module_name module" stuff was too verbose, and that "for @module_name" was plenty. Overly verbose assistive tech wording can be another form of accessibility problem. So I think this is probably best:
<span>Configure @module_name</span> PermissionsUpdating summary to be more explicit about proposed resolution and remaining tasks.
Comment #11
dwwWhile we're word-smithing, I wonder if:
Help <span class="visually-hidden">for @module_name</span>should actually be:
<span class="visually-hidden">Get @module_name</span> Helpto include the verb and be more like the 'Permissions' link.
Comment #12
darvanenLinks with verbs are good, yes. Perhaps "view" rather than "get"? Or even "read"?
To me "get" implies active rather than passive help, and documentation is most definitely passive help.
Comment #13
dwwI was thinking of that, but “View” seemed a weird verb to include inside something visually-hidden. “Hear” seemed worse. So I proposed “Get”.
Comment #14
dwwI guess “read” would work since something can be “read aloud”, too... if we need an action verb, that’s probably best we’ve got so far. ;)
Comment #15
darvanenI'm guessing the accessibility team (we have one of those right?) will have input on that too.
Comment #16
aaronmchaleWe look at this issue today at #3245345: Drupal Usability Meeting 2021-10-29.
The recommendation is that we use the format
[Action] for [module]so that would be for examplePermissions for Views, with the visually hidden part beingfor [module]. The configure link being the exception, which we felt would be fine withConfigure [module].This is consistent with the practice of less is more, and from an accessibility perspective - particularly for screen reader users - keeping the link text short is beneficial, especially on the modules page where there is a lot of text and a lot of links. If you consider the modules page with just core modules, removing even just one unnecessary word from the link text would save a significant amount of time when tabbing through the entire page.
Presenting the action word first, aka the visible part of the link text, ensures that for someone quickly tabbing through the text on the screen, they can navigate through those links quickly, only needing to hear the first word to know where the link goes.
Keeping the format of
[Action] for [module]or[Action] [module]also means the text on all of the links is consistent and avoids confusion. For example, the proposed text ofConfigure [module] Permissionscould be easily confused with theConfigure [module]link, especially if a screen reader user is quickly tabbing across the links because they would essentially hear two configure links and it would be very easy to then select the wrong one.Comment #17
dwwThanks for the usability review! That all sounds great and makes sense. So patch #4 is already correct for 'help' and 'permissions' links. But #16 suggests simplifying 'configure'. Fixed here.
Also, although there hasn't been a formal accessibility review yet, @mikemai2awesome in #accessibility Slack agreed hat removing title would be wise. Adding that as a separate patch so we can choose which approach we prefer. I think the no-title version is better, but let's see what other reviews say.
Thanks everyone,
-Derek
Comment #18
aaronmchaleHi Derek
Thanks for adopting our recommendations! We also discussed the title attribute during the UX review, after looking quickly at the accessibility guidance, we agreed that the title attribute was not appropriate and so could be removed, however that did not form part of our formal recommendation because we agreed to defer to our accessibility maintainers on that point.
If there is agreement on the accessibility side that the title attribute is not required, then it sounds like we are all good to remove it.
Thanks,
-Aaron
Comment #19
darvanen@AaronMcHale thanks so much for taking the time to comprehensively explain the decision, I definitely learned something today.
@dww thanks for making two patches! That should really help it get past the accessibility review, which, correct me if I'm wrong, only happens once an issue has gone RTBC?
I was about to turn this green to get it in the queue for that, but I noticed:
We're still clobbering the test of the title attribute here in the with-title patch.
Comment #20
dwwCool, thanks for looking. I think the no-title patch is what we’re gonna want, so I won’t bother fixing the title patch tests unless we return to that approach.
Comment #21
darvanenI agree the no-title patch is the best way forward so the risk of being sent back to fix the (now hidden) with-title patch is minimal.
Let's see how we go :)
Comment #22
dwwP.s. no, I don’t think folks necessarily wait for RTBC to do accessibility reviews. If anything, I’d say something shouldn’t move to RTBC until all the “Needs X review” tags are resolved. We can ping in Slack again to try to solicit a formal review. I’m hoping @andrewmacphearson will chime in since this was his suggestion in the first place. 😉
X-post, but resetting status to NR, since I don’t think core commiters should spend time on this until the accessibility review is complete.
Thanks again!
-Derek
Comment #23
darvanenI stand corrected :) thank you
Comment #24
vikashsoni commented@dww Patch giving error while appliying in drupal-9.3.x-dev
Needs to Re-roll -----
Checking patch core/modules/system/src/Form/ModulesListForm.php...
warning: core/modules/system/src/Form/ModulesListForm.php has type 100755, expected 100644
Hunk #1 succeeded at 257 (offset -1 lines).
error: while searching for:
if ($module->status && $this->currentUser->hasPermission('administer permissions') && $this->permissionHandler->moduleProvidesPermissions($module->getName())) {
$row['links']['permissions'] = [
'#type' => 'link',
'#title' => $this->t('Permissions'),
'#url' => Url::fromRoute('user.admin_permissions.module', ['modules' => $module->getName()]),
'#options' => ['attributes' => ['class' => ['module-link', 'module-link-permissions'], 'title' => $this->t('Configure permissions')]],
];
}
error: patch failed: core/modules/system/src/Form/ModulesListForm.php:268
error: core/modules/system/src/Form/ModulesListForm.php: patch does not apply
Checking patch core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php...
warning: core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php has type 100755, expected 100644
error: while searching for:
$this->drupalGet('admin/modules');
// Check that system_test's configure link was rendered correctly.
$this->assertSession()->elementExists('xpath', "//a[contains(@href, '/system-test/configure/bar') and text()='Configure ']/span[contains(@class, 'visually-hidden') and text()='the System test module']");
// Check that system_test's permissions link was rendered correctly.
$this->assertSession()->elementExists('xpath', "//a[contains(@href, '/admin/people/permissions/module/system_test') and @title='Configure permissions']");
// Check that system_test's help link was rendered correctly.
$this->assertSession()->elementExists('xpath', "//a[contains(@href, '/admin/help/system_test') and @title='Help']");
// Ensure that the Database Logging module's machine name is printed. This
// module is used because its machine name is different than its human
error: patch failed: core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php:41
error: core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php: patch does not apply
Comment #25
dww@vikashsoni: Maybe you had a stale copy of 9.3.x branch? I re-queued the test bot on #17 and it passed, and I just tried applying locally, no problem.
Comment #26
mgiffordI reviewed the issue. Agreed that @dww correctly described a bug. Titles are a challenge for assistive technology as they have generally been very badly implemented. Removing them and moving to describing the function as per the patch is the right way to go. It also makes it more consistent with the Configure link which is currently done differently than the other links. That helps with usability for everyone.
I couldn't test the patch on SimplyTest.me but it looked fine to me. Lets get the bots to verify this.
Comment #27
mgiffordRemoving accessibility review.
Comment #28
longwaveThis has passed accessibility review and the code looks good to me, so marking RTBC.
Comment #29
dwwThanks @mgifford for the accessibility review and @longwave for the RTBC!
To be extra clear: https://www.drupal.org/files/issues/2021-10-29/3245622-17.no-title.patch is the one that's RTBC. It's the only one visible at the top of the issue, but it's a little confusing that there are two patches in #17. Sorry about that. I'd consider re-uploading it here as a stand-alone, but that's rather wasteful of bot cycles. Updating summary remaining tasks to add an explicit link to the patch to commit and crossing off everything else (which is now completed).
Thanks again,
-Derek
Comment #42
alexpottCrediting the usability team for discussing this issue. It's helpful if comments like #16 contain who to credit as I have no idea who was active in the discussion of this issue.
Comment #43
alexpottCommitted and pushed 67b083bfe70 to 10.0.x and da50a859252 to 9.4.x. Thanks!