Skip to content

Commit 329affd

Browse files
committed
Remove trivial tooltips from the help link
Before this change, the help link showed a trivial tooltip that simply repeated the name of the control. Such tooltips distract the user. Users might even not click the link anymore because they think that the tooltip already shows the actual help message. Now the additional help text is available as aria-label only.
1 parent f836cdc commit 329affd

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

core/src/main/resources/lib/form/helpLink.jelly

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ THE SOFTWARE.
2929
a spacer if none is available.
3030
3131
The help link is rendered as a table cell with an (?) icon.
32-
If the user clicks it, the content of the HTML fragment at the given URL
32+
If the user clicks it, the content of the HTML fragment at the given URL
3333
is rendered in the area designated as <f:helpArea> by the caller,
3434
usually in a row beneath the item with help.
35-
35+
3636
The alternative spacer is just an empty table cell.
37-
37+
3838
This tag was introduced to ensure that the space reserved for help items
3939
is consistent over the UI whether or not help exists.
4040
@@ -49,14 +49,14 @@ THE SOFTWARE.
4949
]]>
5050
</st:attribute>
5151
<st:attribute name="featureName">
52-
Name of the feature described by the help text, used for constructing the
52+
Name of the feature described by the help text, used for constructing the
5353
icon's alt attribute. Optional.
5454
</st:attribute>
5555
</st:documentation>
5656
<j:choose>
5757
<j:when test="${attrs.url!=null}">
5858
<j:set var="altText" value="${attrs.featureName != null ? '%Help for feature:' + ' ' + attrs.featureName : '%Help'}" />
59-
<a href="#" class="jenkins-help-button" tooltip="${altText}" helpURL="${rootURL}${attrs.url}">
59+
<a href="#" class="jenkins-help-button" aria-label="${altText}" helpURL="${rootURL}${attrs.url}">
6060
<!-- .jenkins-help-button span element is required as it's restyled in CSS -->
6161
<span>?</span>
6262
</a>

test/src/test/java/jenkins/security/Security2779Test.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,11 @@ void setUp(JenkinsRule rule) {
2828
j = rule;
2929
}
3030

31-
@Test
32-
void noXssInHelpLinkPanel() throws Exception {
33-
noCrossSiteScriptingInHelp("#link-panel a");
34-
}
35-
3631
@Test
3732
void noXssInHelpIconPanel() throws Exception {
38-
noCrossSiteScriptingInHelp("#icon-panel svg");
39-
}
40-
41-
private void noCrossSiteScriptingInHelp(String selector) throws Exception {
42-
final AtomicInteger alerts = new AtomicInteger();
43-
final JenkinsRule.WebClient webClient = j.createWebClient();
33+
var selector = "#icon-panel svg";
34+
var alerts = new AtomicInteger();
35+
var webClient = j.createWebClient();
4436
webClient.setAlertHandler((AlertHandler) (p, s) -> alerts.addAndGet(1));
4537
final HtmlPage page = webClient.goTo(URL_NAME);
4638
page.executeJavaScript("document.querySelector('" + selector + "')._tippy.show()");

0 commit comments

Comments
 (0)