zonemaster / zonemaster-gui

The Zonemaster GUI - part of the Zonemaster project
Other
14 stars 23 forks source link

Better keyboard navigation #342

Closed hannaeko closed 1 year ago

hannaeko commented 2 years ago

Purpose

Some elements on the "run test" page and "result" page were not focusable or if they were not actionable. This PR tries to improve overall keyboard accessibility.

Context

n/a

Changes

Full keyboard navigation is now possible across all pages.

Note: The language menu has not been changed even thought it is not possible to focus the "links" as it is already undergoing major changes in https://github.com/zonemaster/zonemaster-gui/pull/337 so I let the work be done there.

How to test this PR

Try to use the gui without a mouse (use the TAB to move the focus forward and SHIFT + TAB to move it backward).

To quickly check that all elements are focusable using tab, Firefox accessibility inspector can be used to show the tab order. This does not replace tests to check that the elements are actionable and behave correctly.

Non exhaustive list of navigation paths to test:

matsduf commented 2 years ago

I wanted to test, but I failed to build. See #343.

hannaeko commented 2 years ago

I can run a test and select "history", but how do I select the history list that I want to view?

I tested it and I did it like this:

  1. Tab until "History" is selected.
  2. Press "Enter" to open the modal.
  3. Tab until the link to the test you want to see is selected.
  4. Press "Enter" to load this test.
  5. Press "Escape" to close the modal. (Or Shit + Tab until the close button is selected and press Enter)

If I press Enter on "options" nothing happens.

By default checkbox are toggled using "Space" (this is a browser behaviour).

I can select "filter text" but I cannot select the all-info-notice-warning-error-critcal buttons.

When I press tab, the filer buttons are focused after the "Share" button. Then I can press Enter on any of them to filter. I you can not do that we should investigate.

How do I select FAQ?

When you press Tab just after loading the page. The focus start with the Zonemaster logo then moves to the navigation menu links. If when you press Tab the focus is past the navigation menu, use Shift + Tab to go back until you are focusing "FAQ".

matsduf commented 2 years ago

I tested it and I did it like this:

1. Tab until "History" is selected.

Yes.

2. Press "Enter" to open the modal.

Yes.

3. Tab until the link to the test you want to see is selected.

First "X" is selected. Tab to "All". Tab to "Delegated". Tab to "Undelegated". Pressing "Enter" on any of these will do as expected.

Pressing tab again, and I am out of the modal. I am out of the Zonemaster page. I will end up on the web browser menu. This is Firefox.

In Chrome I come to the first in the history list, and it seems to work as you expect.

If I press Enter on "options" nothing happens.

By default checkbox are toggled using "Space" (this is a browser behaviour).

OK, then it works in both Firefox and Chrome.

I can select "filter text" but I cannot select the all-info-notice-warning-error-critcal buttons.

When I press tab, the filer buttons are focused after the "Share" button. Then I can press Enter on any of them to filter. I you can not do that we should investigate.

Works in Chrome, but not in Firefox.

How do I select FAQ?

When you press Tab just after loading the page. The focus start with the Zonemaster logo then moves to the navigation menu links. If when you press Tab the focus is past the navigation menu, use Shift + Tab to go back until you are focusing "FAQ".

Works in Chrome, but not in Firefox.

hannaeko commented 1 year ago

If the issues I find are issues with Firefox rather than the solution I am ready to approve.

Can it be a "Firefox on Mac" issue? I am also using Firefox, but on Linux.

mattias-p commented 1 year ago

I've successfully release tested this for v2022.2.