Skip to content

Conversation

@dgdavid
Copy link
Contributor

@dgdavid dgdavid commented May 7, 2025

Problem

There is no a way in the Agama web interface for keyboard users easily bypass repeated content (navigation links and other focusable elements) as the WCAG criterion 2.4.1 Bypass Blocks states.

Solution

To add an skip link as a first focusable element, relying on PF/SkipToContent component. Apart of addressing mentioned issue, it should mitigate #1521

Testing

  • Added a new unit test
  • Tested manually

Screenshots

How link looks when hit via TAB. Using the Waterwhole color from https://brand.suse.com/design-language#color on purpose to accomplish the "This is acceptable as long as it becomes highly visible on focus." part of https://www.w3.org/WAI/test-evaluate/easy-checks/skip-link/

localhost_8080_ (52)

Future work

Component is ready for adding a "Skip to main navigation" link or whatever other needed skip link. However, it is not part of this PR because it needs more work for rendering it only when the navigation is visible.

It's still necessary to evaluate whether it's better to move focus, upon navigation, to the first focusable element within #main-content, or possibly to the first focusable form element on the new page. However, it could be problematic, as screen reader users might miss the surrounding context, requiring them to navigate back or to the top of the page for clarity. So, let keep postponing such a decision until having more knowledge from an accessibility perspective, to avoid introducing behaviors that may be difficult to reverse later without triggering a wave of complaints.

Relevant resources

dgdavid added 7 commits May 7, 2025 12:34
Based on the PF/SkipToContent and intended to provide
navigational aid for keyboard and screen reader users to skip navigation
links and other focusable elements preceding the main content.

It also helps to conform to success criterion 2.4.1: Bypass Blocks,

> A mechanism is available to bypass blocks of content that are repeated
> on multiple webpages.

See

  - https://www.w3.org/WAI/WCAG22/quickref/?versions=2.1&showtechniques=241#bypass-blocks
  - https://webaim.org/projects/screenreadersurvey9/#skip
  - https://www.w3.org/WAI/test-evaluate/easy-checks/skip-link/
Avoids using the same name as the underlying PF component to reduce
ambiguity for developers.
In an attempt to make it highly visible as stated at
https://www.w3.org/WAI/test-evaluate/easy-checks/skip-link/

> Ideally the skip navigation link should be visible as the first link
> on the page. However, some designers like to hide it from view until it
> receives keyboard focus. **This is acceptable as long as it becomes highly
> visible on focus**.
When they are in a :focus-visible state
Because there are pages, such Log in, that might not need it.
Since there is actually nothing to skip there.
@dgdavid dgdavid marked this pull request as ready for review May 7, 2025 13:45
@dgdavid dgdavid requested a review from imobachgs May 7, 2025 13:48
dgdavid added 2 commits May 7, 2025 15:41
Renamed the component to make it more agnostic. While it defaults to
"skip to content," it can be configured to skip to navigation or
other sections as needed.
@dgdavid dgdavid merged commit 154a651 into master May 7, 2025
8 checks passed
@dgdavid dgdavid deleted the add-skip-to-content-link branch May 7, 2025 20:20
@imobachgs imobachgs mentioned this pull request May 26, 2025
imobachgs added a commit that referenced this pull request May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants