diff --git a/src/applications/maniphest/view/ManiphestTaskListView.php b/src/applications/maniphest/view/ManiphestTaskListView.php --- a/src/applications/maniphest/view/ManiphestTaskListView.php +++ b/src/applications/maniphest/view/ManiphestTaskListView.php @@ -135,6 +135,7 @@ id(new PHUIListItemView()) ->setIcon('fa-pencil') ->addSigil('maniphest-edit-task') + ->setAriaLabel('Edit Task') ->setHref($href)); } diff --git a/src/view/phui/PHUIListItemView.php b/src/view/phui/PHUIListItemView.php --- a/src/view/phui/PHUIListItemView.php +++ b/src/view/phui/PHUIListItemView.php @@ -37,6 +37,7 @@ private $rel; private $dropdownMenu; private $keyCommand; + private $ariaLabel; public function setOpenInNewWindow($open_in_new_window) { $this->openInNewWindow = $open_in_new_window; @@ -217,6 +218,16 @@ return $this; } + /** + * Explicitly set an aria-label attribute for accessibility. Only to be used + * when no other means of differentiation are already available. + * @param string $aria_label aria-label text to add to a list item + */ + public function setAriaLabel($aria_label) { + $this->ariaLabel = $aria_label; + return $this; + } + protected function getTagName() { return 'li'; } @@ -412,6 +423,7 @@ 'class' => implode(' ', $classes), 'meta' => $meta, 'sigil' => implode(' ', $sigil), + 'aria-label' => $this->ariaLabel, 'target' => $this->getOpenInNewWindow() ? '_blank' : null, 'rel' => $this->rel, ),