Skip to content

Fixes sidebar navigation not exposed as a separate navigation landmark - #2026

Open
jacobo-dominguez-wgu wants to merge 1 commit into
openedx:masterfrom
WGU-Open-edX:fix/a11y-nav-main-tags
Open

Fixes sidebar navigation not exposed as a separate navigation landmark#2026
jacobo-dominguez-wgu wants to merge 1 commit into
openedx:masterfrom
WGU-Open-edX:fix/a11y-nav-main-tags

Conversation

@jacobo-dominguez-wgu

Copy link
Copy Markdown
Contributor

Description

Fixes an accessibility issue on the courseware page where the course-outline sidebar was not exposed as its own landmark and the <main> landmark included both the sidebar navigation and the primary sequence content, making the page structure unclear for screen-reader users.

After this change:

  • The course-outline sidebar is a <nav> landmark with an accessible name (aria-label="Course outline").
  • The <main> landmark contains only the primary sequence content; the sidebar is a sibling outside of <main>.
  • The "Skip to main content" anchor (#main-content) now lives on the semantic <main> element, which is the correct WCAG-aligned skip target.

Problem

Before:

<main>                              ← includes everything
  breadcrumbs, tab nav, alerts
  <section class="outline-sidebar"> ← generic region, no accessible name
    …course outline links…
  </section>
  <div class="sequence">            ← primary content
    …unit + navigation…
  </div>
</main>

Screen readers announced a single main landmark containing both the navigation and the reading content, and the sidebar had no distinct landmark or accessible name.

Solution

After:

<div>                                                        (LoadedTabPage)
  breadcrumbs, tab nav, alerts
  <div class="container-xl d-flex flex-column flex-grow-1">
    <div class="sequence-container …">
      <nav class="outline-sidebar" aria-label="Course outline">   ← navigation landmark
        …course outline links…
      </nav>
      <main id="main-content" class="sequence w-100">             ← main landmark, primary content only
        …unit + navigation…
      </main>
      <RightSidebarSlot />
    </div>
  </div>
</div>

Non-courseware tabs (outline, dates, progress, discussion, lti_live) still receive a <main> from LoadedTabPage exactly as before — the swap is scoped to activeTabSlug === 'courseware'.

Accessibility impact

  • Landmarks pass in axe / WAVE / VoiceOver rotor: the page now exposes a distinct Course outline navigation landmark and a main landmark that contains only the primary content.
  • Skip link (#main-content) now targets the semantic <main> element, matching the WAI-ARIA recommendation.
  • Non-courseware tabs are unchanged — their existing <main id="main-content"> landmark still wraps the tab content.

Testing

  • Manual QA suggestions:
    • VoiceOver / NVDA landmark rotor on /course/:courseId/:sequenceId/:unitId should now list a navigation landmark named "Course outline" and a main landmark that does not contain the sidebar.
    • Confirm the "Skip to main content" link (if enabled by the shell/header) lands directly at the sequence content.
    • Sanity-check layout of course outline, dates, progress, discussion, and live tabs — no visual change expected.

Screenshots

No visual changes intended. All modifications are DOM-semantics only.
image

AI assistance disclosure

The modifications of this PR — including the semantic-landmark refactor, the layout-preserving CSS cleanup, and the new landmark-structure tests — were made with the assistance of Claude Opus 4.7.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Aug 28, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @jacobo-dominguez-wgu!

This repository is currently maintained by @openedx/committers-frontend-app-learning.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.59%. Comparing base (020a3ee) to head (5e080fe).
⚠️ Report is 23 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2026      +/-   ##
==========================================
+ Coverage   93.53%   93.59%   +0.05%     
==========================================
  Files         363      367       +4     
  Lines        5905     6007     +102     
  Branches     1367     1418      +51     
==========================================
+ Hits         5523     5622      +99     
- Misses        367      368       +1     
- Partials       15       17       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@brian-smith-tcril brian-smith-tcril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is definitely worth addressing, but I have some concerns with the proposed solution in this PR.

I'd like to hear @kblemel's thoughts on this one.

Comment thread src/tab-page/LoadedTabPage.tsx Outdated
verifiedMode={verifiedMode}
/>
<main className="d-flex flex-column flex-grow-1">
<PageWrapper className="d-flex flex-column flex-grow-1">

@brian-smith-tcril brian-smith-tcril Aug 31, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This feels awkward to me. Without this PR the main-content div doesn't contain the AlertList or CourseTabsNavigationSlot. This seems to be splitting main from the main-content div, which doesn't feel right to me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That was i mistake, I have fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

4 participants