Skip to content

Commit fd19216

Browse files
committed
Phabricator: Make reviewer status icons accessible (remove aria-hidden, set role, set label).
1 parent 2b9a3c5 commit fd19216

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

PhabricatorA11yFixes.user.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// @namespace http://axSgrease.nvaccess.org/
44
// @description Improves the accessibility of Phabricator.
55
// @author James Teh <jteh@mozilla.com>
6-
// @copyright 2018 Mozilla Corporation
6+
// @copyright 2018-2025 Mozilla Corporation
77
// @license Mozilla Public License version 2.0
8-
// @version 2018.2
8+
// @version 2025.1
99
// @grant GM_log
1010
// @include https://phabricator.services.mozilla.com/D*
1111
// ==/UserScript==
@@ -35,6 +35,12 @@ function setLabel(el, label) {
3535
el.setAttribute("aria-label", label);
3636
}
3737

38+
function labelHiddenStatusIcon(el, label) {
39+
el.removeAttribute("aria-hidden");
40+
el.setAttribute("role", "image");
41+
setLabel(el, label);
42+
}
43+
3844
/*** Code to apply the tweaks when appropriate. ***/
3945

4046
function applyTweaks(root, tweaks) {
@@ -90,6 +96,21 @@ const LOAD_TWEAKS = [
9096
// The diff is an h1, so the files inside the diff should be an h2, not an h1.
9197
{selector: '.differential-file-icon-header',
9298
tweak: [makeHeading, 2]},
99+
// Reviewer status icons.
100+
{selector: '.phui-status-item-target .fa-circle-o',
101+
tweak: [labelHiddenStatusIcon, "pending"]},
102+
{selector: '.phui-status-item-target .fa-minus-circle',
103+
tweak: [labelHiddenStatusIcon, "pending blocking"]},
104+
{selector: '.phui-status-item-target .fa-check-circle',
105+
tweak: [labelHiddenStatusIcon, "accepted"]},
106+
{selector: '.phui-status-item-target .fa-check-circle-o',
107+
tweak: [labelHiddenStatusIcon, "accepted prior"]},
108+
{selector: '.phui-status-item-target .fa-times-circle',
109+
tweak: [labelHiddenStatusIcon, "requested changes"]},
110+
{selector: '.phui-status-item-target .fa-times-circle-o',
111+
tweak: [labelHiddenStatusIcon, "requested changes to prior"]},
112+
{selector: '.phui-status-item-target .fa-comment',
113+
tweak: [labelHiddenStatusIcon, "comment"]},
93114
]
94115

95116
// Tweaks that must be applied whenever a node is added.

0 commit comments

Comments
 (0)