@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.

Add some missing aural button labels for accessibility

Summary:
Ref T13164. See PHI823. (See that issue for some more details and discussion.)

Add aural labels to various buttons which were missing reasonable aural labels.

The "Search" button (magnifying glass in the global search input) had an entire menu thing inside it. I moved that one level up and it doesn't look like it broke anything (?). All the other changes are pretty straightforward.

Test Plan:
{F5806497}

{F5806498}

- Will follow up on the issue to make sure things are in better shape for the reporting user.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13164

Differential Revision: https://secure.phabricator.com/D19594

+60 -27
+2 -1
src/applications/favorites/engineextension/PhabricatorFavoritesMainMenuBarExtension.php
··· 30 30 ->addClass('phabricator-core-user-menu') 31 31 ->setNoCSS(true) 32 32 ->setDropdown(true) 33 - ->setDropdownMenu($dropdown); 33 + ->setDropdownMenu($dropdown) 34 + ->setAuralLabel(pht('Favorites Menu')); 34 35 35 36 return array( 36 37 $favorites_menu,
+2 -1
src/applications/people/engineextension/PeopleMainMenuBarExtension.php
··· 43 43 ->setIcon($profile_image) 44 44 ->addClass('phabricator-core-user-menu') 45 45 ->setHasCaret(true) 46 - ->setNoCSS(true); 46 + ->setNoCSS(true) 47 + ->setAuralLabel(pht('Account Menu')); 47 48 48 49 return array( 49 50 $user_menu,
+1 -1
src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
··· 230 230 'div', 231 231 array( 232 232 'style' => 'background-image: url('.$image_uri.')', 233 - 'class' => 'phui-comment-image', 233 + 'class' => 'phui-comment-image visual-only', 234 234 )); 235 235 $wedge = phutil_tag( 236 236 'div',
+10 -5
src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
··· 233 233 ->setIcon('fa-reply') 234 234 ->setTooltip(pht('Reply')) 235 235 ->addSigil('differential-inline-reply') 236 - ->setMustCapture(true); 236 + ->setMustCapture(true) 237 + ->setAuralLabel(pht('Reply')); 237 238 } 238 239 239 240 if ($this->editable && !$this->preview) { ··· 242 243 ->setIcon('fa-pencil') 243 244 ->setTooltip(pht('Edit')) 244 245 ->addSigil('differential-inline-edit') 245 - ->setMustCapture(true); 246 + ->setMustCapture(true) 247 + ->setAuralLabel(pht('Edit')); 246 248 247 249 $action_buttons[] = id(new PHUIButtonView()) 248 250 ->setTag('a') 249 251 ->setIcon('fa-trash-o') 250 252 ->setTooltip(pht('Delete')) 251 253 ->addSigil('differential-inline-delete') 252 - ->setMustCapture(true); 254 + ->setMustCapture(true) 255 + ->setAuralLabel(pht('Delete')); 253 256 254 257 } else if ($this->preview) { 255 258 $links[] = javelin_tag( ··· 268 271 ->setTooltip(pht('Delete')) 269 272 ->setIcon('fa-trash-o') 270 273 ->addSigil('differential-inline-delete') 271 - ->setMustCapture(true); 274 + ->setMustCapture(true) 275 + ->setAuralLabel(pht('Delete')); 272 276 } 273 277 274 278 if (!$this->preview && $this->canHide()) { ··· 277 281 ->setTooltip(pht('Collapse')) 278 282 ->setIcon('fa-times') 279 283 ->addSigil('hide-inline') 280 - ->setMustCapture(true); 284 + ->setMustCapture(true) 285 + ->setAuralLabel(pht('Collapse')); 281 286 } 282 287 283 288 $done_button = null;
+18 -14
src/view/page/menu/PhabricatorMainMenuSearchView.php
··· 94 94 'action' => '/search/', 95 95 'method' => 'POST', 96 96 ), 97 - phutil_tag_div('phabricator-main-menu-search-container', array( 98 - $input, 99 - phutil_tag( 100 - 'button', 101 - array( 102 - 'id' => $button_id, 103 - 'class' => 'phui-icon-view phui-font-fa fa-search', 97 + phutil_tag( 98 + 'div', 99 + array( 100 + 'class' => 'phabricator-main-menu-search-container', 101 + ), 102 + array( 103 + $input, 104 + phutil_tag( 105 + 'button', 106 + array( 107 + 'id' => $button_id, 108 + 'class' => 'phui-icon-view phui-font-fa fa-search', 104 109 ), 105 - array( 106 - $selector, 107 - $search_text, 108 - )), 109 - $primary_input, 110 - $target, 111 - ))); 110 + $search_text), 111 + $selector, 112 + $primary_input, 113 + $target, 114 + ))); 112 115 113 116 return $form; 114 117 } ··· 207 210 id(new PHUIIconView()) 208 211 ->addSigil('global-search-dropdown-icon') 209 212 ->setIcon($current_icon)) 213 + ->setAuralLabel(pht('Configure Global Search')) 210 214 ->setDropdown(true); 211 215 212 216 $input = javelin_tag(
+2 -1
src/view/page/menu/PhabricatorMainMenuView.php
··· 232 232 ->addClass('phabricator-core-user-menu') 233 233 ->addClass('phabricator-core-user-mobile-menu') 234 234 ->setNoCSS(true) 235 - ->setDropdownMenu($dropdown); 235 + ->setDropdownMenu($dropdown) 236 + ->setAuralLabel(pht('Page Menu')); 236 237 } 237 238 238 239 private function renderApplicationMenu() {
+23 -2
src/view/phui/PHUIButtonView.php
··· 31 31 private $noCSS; 32 32 private $hasCaret; 33 33 private $buttonType = self::BUTTONTYPE_DEFAULT; 34 + private $auralLabel; 34 35 35 36 public function setName($name) { 36 37 $this->name = $name; ··· 121 122 122 123 public function getButtonType() { 123 124 return $this->buttonType; 125 + } 126 + 127 + public function setAuralLabel($aural_label) { 128 + $this->auralLabel = $aural_label; 129 + return $this; 130 + } 131 + 132 + public function getAuralLabel() { 133 + return $this->auralLabel; 124 134 } 125 135 126 136 public function setIcon($icon, $first = true) { ··· 265 275 $caret = phutil_tag('span', array('class' => 'caret'), ''); 266 276 } 267 277 278 + $aural = null; 279 + if ($this->auralLabel !== null) { 280 + $aural = phutil_tag( 281 + 'span', 282 + array( 283 + 'class' => 'aural-only', 284 + ), 285 + $this->auralLabel); 286 + } 287 + 288 + 268 289 if ($this->iconFirst == true) { 269 - return array($icon, $text, $caret); 290 + return array($aural, $icon, $text, $caret); 270 291 } else { 271 - return array($text, $icon, $caret); 292 + return array($aural, $text, $icon, $caret); 272 293 } 273 294 } 274 295 }
+1 -1
src/view/phui/PHUIHeadThingView.php
··· 55 55 $image = phutil_tag( 56 56 'a', 57 57 array( 58 - 'class' => 'phui-head-thing-image', 58 + 'class' => 'phui-head-thing-image visual-only', 59 59 'style' => 'background-image: url('.$this->image.');', 60 60 'href' => $this->imageHref, 61 61 ));
+1 -1
src/view/phui/PHUITimelineEventView.php
··· 404 404 ($this->userHandle->getURI()) ? 'a' : 'div', 405 405 array( 406 406 'style' => 'background-image: url('.$image_uri.')', 407 - 'class' => 'phui-timeline-image', 407 + 'class' => 'phui-timeline-image visual-only', 408 408 'href' => $this->userHandle->getURI(), 409 409 ), 410 410 '');