Skip to content

Bug: lesson side navigation a11y issues #4423

@thatblindgeye

Description

@thatblindgeye

Checks

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this issue follows the Bug: brief description of bug format, e.g. Bug: Lesson complete button does not update on click
  • Would you like to work on this issue?

Bug description

Various a11y issues that should be resolved for the lesson side navigation (this can be considered an epic consisting of several issues; each of these issues should have a separate PR):

  • Side navigation not visible at smaller viewports - Basically the lesson side navigation is not visible when zoom is higher or viewport is smaller, which is an issue that needs to be resolved. Ideally the navigation should be collapsible/expandable regardless of viewport/zoom, rather than just completely hiding it at a certain point. This may involve updating the h4 heading

  • Related to above, we should move the lesson jump links from the right side of the screen (in LTR languages) to the left in the DOM. This would satisfy being able to traverse those jump links before the actual lesson content (right now you basically have to go through the entire lesson just to get focus into those jump links, unless you're using some AT that has nifty shortcuts that can help alleviate that)

  • Reconsider wrapper element for the lesson nav from an aside to a nav. While an aside may make sense in terms of positioning, it really is more of a navigation. Doing this we could also remove the h4 tag as it's no longer really a section of content; we should keep the text, though, and this text should be used as the labeling text for the nav/ul via aria-labelledby

  • Apply aria-current="location" to the li element that contains the link which is currently "active". May also want to consider applying a more noticeable style to the current jump link rather than just a slight background/text color change, like removing the left border from all li's except the active one (screenshot below)
    TOP lesson side navigation with updated styling, where only the active jump link item has a left border applied

  • Apply a role="list" to the nav ul element. It's redundant, but Safari removes the semantics for lists that remove the list styling. This would apply to other areas of the site that uses lists in this way as well. We should also apply an aria-labelledby to this ul element, referencing the "Lesson contents" heading.

How to reproduce

Visit any lesson (like our working with text lesson) and compare the above comments to the side navigation. Some may not be reproducible without a screen reader (aria-current for example).

Expected behavior

  1. The side nav is able to be viewed regardless of zoom/viewport width
  2. The side navigation is announced semantically as a navigation element as it contains links for the lesson itself (rather than external links)
  3. The side nav and/or ul elements are labeled by the "Lesson content" text
  4. The currently active jump link is announced as the current link via aria-current, and has improved active styling
  5. The ul element retains its semantics via role="list" for Safari, which removes the semantics when certain styles are applied to the ul

What browsers are you seeing the problem on?

No response

What OS are you using?

No response

Discord Name

No response

Additional Comments

cc @KevinMulhern in case some of these issues need some design input, may be worth getting together async to chat about them

May also be coupled to #4407 and/or #3498

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs ReviewThis issue/PR needs an initial or additional reviewType: BugInvolves something that isn't working as intended

    Type

    No type

    Projects

    Status

    📋 Backlog / Ideas

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions