openedx / frontend-app-learning

Front-end for the Open edX course experience, implemented using React and Paragon.
GNU Affero General Public License v3.0
46 stars 207 forks source link

fix: update skip nav destination #1516

Closed KristinAoki closed 2 weeks ago

KristinAoki commented 2 weeks ago

Description

This PR moves the target ID for the skip nav button from the <main> tag to the children wrapper. This allows the skip nav to skip the secondary navigation of the page tabs.

Supporting Information

JIRA Ticket: AU-1333 πŸ”’

In the Learning MFE, the skip-nav in the outer most scope (the Learning MFE,) must redirect to the main content of the currently displayed sub-section, when in-courseware. If in a MFE page (Home, Progress, Grading, etc.) the skip-nav should point to main content for page.

In most webpages, the SkipNav link jumps keyboard focus over the main header, which typically contains a lot of redundant navigation links or menus. The SkipNav link is intended to save keystrokes for keyboard-only users (including but not limited to screen reader users). The gist of this issue is that the Learning MFE is kinda special, in that the top of the <main> element – the most common destination for SkipNav links – is not the location of the main content; there is another layer of navigation elements in the Learning MFE (the Course, Progress, Dates etc. tabset).

Testing

For the outline, progress, and dates tabs and the course content page run the following tests

  1. Reload the page to reset keyboard focus to the top of the page.
  2. Using your keyboard, navigate through the page until you activate the "Skip to main content" button
  3. Click the button
  4. Confirm that the page is navigate to the after the pages tabs
codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.25%. Comparing base (0effb32) to head (79a3bf4). Report is 3 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1516 +/- ## ========================================== + Coverage 89.23% 89.25% +0.01% ========================================== Files 317 318 +1 Lines 5557 5563 +6 Branches 1341 1379 +38 ========================================== + Hits 4959 4965 +6 + Misses 583 582 -1 - Partials 15 16 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.