@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

a11y: Add aria-label to mini badges below user avatars

Summary:
Links should have a discernible name per https://dequeuniversity.com/rules/axe/4.10/link-name
Thus re-use the existing tooltip text with the name of the badge as the `aria-label` text for the badge's <a> link.

Ref T16072

Test Plan:
Set up a badge at http://phorge.localhost/badges/.
Award badge to some user at http://phorge.localhost/people/badges/1/.
Make that user who received a badge comment on a Maniphest task.
Hover over the badge below the user avatar next to the comment to see the badge name.
Inspect the `<a>` element surrounding the badge icon below the user avatar next to the comment, see an `aria-label` also set to the badge name.
Optionally, run an Accessibility check in Chromium Lighthouse.

Reviewers: O1 Blessed Committers, chris

Reviewed By: O1 Blessed Committers, chris

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16072

Differential Revision: https://we.phorge.it/D26048

+1
+1
src/view/phui/PHUIBadgeMiniView.php
··· 57 57 'class' => implode(' ', $classes), 58 58 'sigil' => 'has-tooltip', 59 59 'href' => $this->href, 60 + 'aria-label' => $this->header, 60 61 'meta' => array( 61 62 'tip' => $this->header, 62 63 'align' => $this->tipDirection,