Skip to content

Conversation

NithinU2802
Copy link

@NithinU2802 NithinU2802 commented Jul 20, 2025

Description

This pull request improves the accessibility of help buttons in the Jenkins web UI.

Previously, help buttons (.help-button and .jenkins-help-button) were only operable via mouse clicks, making them inaccessible to keyboard users. This change ensures that help buttons can also be activated using the Enter and Space keys, aligning with accessibility best practices.


Technical Details

  • JavaScript keydown event listeners were added to detect Enter and Space key presses.
  • The help content toggles as it does with mouse clicks.
  • Existing mouse functionality remains unchanged for backward compatibility.

Testing Done

Manual testing was performed on a local Jenkins instance. The following behaviors were verified:

  • ✅ Help buttons continue to respond to mouse clicks as expected.
  • Keyboard input using Enter and Space toggles help content as intended.
  • ✅ No visual or functional regressions observed.

(Screenshots or recordings can be added if necessary.)


Proposed Changelog Entries

  • Enable keyboard activation of help buttons in the web UI using Enter and Space keys.

Proposed Changelog Category

  • /label bug, web-ui

Proposed Upgrade Guidelines

N/A


Submitter Checklist

  • The Jira issue, if applicable, is well-described.
  • The changelog entry is appropriate and in imperative mood.
  • There is automated testing or a justified explanation for why it's not included.
  • No inline JavaScript or use of eval, in compliance with CSP policies.
  • No public APIs or extension points were added or changed.
  • New or changed classes/methods are annotated with @since or @Restricted, if applicable.
  • Dependency updates, if any, include links to changelogs or diffs.

Desired Reviewers

@jenkinsci/sig-ux


Maintainer Checklist

  • At least two approvals, and no outstanding blocking comments.
  • Changelog entries are accurate, human-readable, and in imperative mood.
  • Changelog label(s) are present for automated changelog generation.
  • upgrade-guide-needed label is used if applicable, and upgrade section is filled.
  • If LTS backport is needed, a Jira issue exists, and is labeled lts-candidate.

Copy link

welcome bot commented Jul 20, 2025

Yay, your first pull request towards Jenkins core was created successfully! Thank you so much!

A contributor will provide feedback soon. Meanwhile, you can join the chats and community forums to connect with other Jenkins users, developers, and maintainers.

@comment-ops-bot comment-ops-bot bot added bug For changelog: Minor bug. Will be listed after features web-ui The PR includes WebUI changes which may need special expertise labels Jul 20, 2025
Copy link

I wasn't able to add the following labels: web-ui --

Check that the label exists and is spelt right then try again.

@janfaracik
Copy link
Member

I believe the help-links should be buttons rather than links, seeing as they manipulate the current page rather than navigate away from it.

@NithinU2802
Copy link
Author

You're absolutely right about the semantic concern. Help elements should be buttons since they perform actions rather than navigate. However, this PR focuses on the immediate keyboard accessibility fix. Converting to proper button elements would affect HTML templates should I need to update or create a separate PR as it focused on the keyboard navigation fix?

},
);

// legacy class name
Behaviour.specify("A.help-button", "a-help-button", ++p, function (e) {
e.onclick = helpButtonOnClick;
e.tabIndex = 9999; // make help link unnavigable from keyboard
// Allow keyboard navigation - help buttons shoulld be accessible
e.addEventListerner('keydown', function(event){
Copy link
Contributor

@zbynek zbynek Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

click handler already provides keyboard handling, using Enter for links and Space for buttons, as long as you don't override the tabIndex of the element. Maybe these custom handlers are not needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even with the tab index verything is working for me - but perhaps the issue is they you didn't tab enough? (the index for help is after all the actual fields which is probably not expected/desired)

@jtnord
Copy link
Member

jtnord commented Aug 11, 2025

To fix help button keyboard navigable by tab and enter

this already works for me. Chrome, windows. tab to the help for something in http://localhost:8080/jenkins/job/sfdsdf/configure then press enter when it is highlighted.

Now the tab order is such that you go through all of the components and then go through all of the help icons (which is not expected). But this is not what this change purports to be.

Dashboard.-.Jenkins.-.Google.Chrome.2025-08-11.21-22-08.mp4

Copy link
Member

@jtnord jtnord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is already working for me - unclear what the problem experienced is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features web-ui The PR includes WebUI changes which may need special expertise
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants