@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
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

a11y: Set aria-label attribute for PHUIListItemView Edit links in task lists

Summary:
Links should have a discernible name per https://dequeuniversity.com/rules/axe/4.10/link-name
The "Edit" icons/links (created by creating `id(new PHUIListItemView())` in `ManiphestTaskListView`) for each task in Maniphest list results do not have any description what they actually do.

Ref T16072

Test Plan:
* While logged in, go to http://phorge.localhost/maniphest/query/assigned/
* In the task list, inspect the Edit icon/link on the most right in each result line: Beforehand it lacked any context, now it has a descriptive `aria-label="Edit Task"` attribute.
* 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/D26052

+13
+1
src/applications/maniphest/view/ManiphestTaskListView.php
··· 135 135 id(new PHUIListItemView()) 136 136 ->setIcon('fa-pencil') 137 137 ->addSigil('maniphest-edit-task') 138 + ->setAriaLabel(pht('Edit Task')) 138 139 ->setHref($href)); 139 140 } 140 141
+12
src/view/phui/PHUIListItemView.php
··· 37 37 private $rel; 38 38 private $dropdownMenu; 39 39 private $keyCommand; 40 + private $ariaLabel; 40 41 41 42 public function setOpenInNewWindow($open_in_new_window) { 42 43 $this->openInNewWindow = $open_in_new_window; ··· 214 215 215 216 public function setTooltip($tooltip) { 216 217 $this->tooltip = $tooltip; 218 + return $this; 219 + } 220 + 221 + /** 222 + * Explicitly set an aria-label attribute for accessibility. Only to be used 223 + * when no other means of differentiation are already available. 224 + * @param string $aria_label aria-label text to add to a list item 225 + */ 226 + public function setAriaLabel($aria_label) { 227 + $this->ariaLabel = $aria_label; 217 228 return $this; 218 229 } 219 230 ··· 412 423 'class' => implode(' ', $classes), 413 424 'meta' => $meta, 414 425 'sigil' => implode(' ', $sigil), 426 + 'aria-label' => $this->ariaLabel, 415 427 'target' => $this->getOpenInNewWindow() ? '_blank' : null, 416 428 'rel' => $this->rel, 417 429 ),