Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI search UI a11y changes #1253

Merged
merged 3 commits into from
Dec 15, 2023
Merged

UI search UI a11y changes #1253

merged 3 commits into from
Dec 15, 2023

Conversation

rijuma
Copy link
Member

@rijuma rijuma commented Dec 14, 2023

Description

Tickets: KBK-74 🔒, KBK-77 🔒

These changes improves the Accessibility for the UI on Courseware Search. Some of the update requests for accessibility are not possible from this implementation, since we are using Paragon components. A request to update these accessibility issues on Paragon will be performed.

Ticket KBK-74

Update breakdown

The search button tab order must be after the navigation tabs.

Done.

Change the <h2>Search this course</h2> with <h2 aria-level="1">Search this course</h2> or <h1 class="h2">Search this course</h1>. The main heading should be an H1 semantically.

Done.

The light gray text is too light (3.23:1, minimum is 4.5:1). The Paragon design system has standard values for hint text.
The main underline for the tab-list (the lighter gray) should have minimum 3:1 contrast vs. background.

Color contrast updates:

  • Navigation Tab border changed from #e9e6e4 (Paragon default) to gray-300 (#8F8F8F) Contrast change: from 1.21:1 to 3.23:1.
  • Active tab border bottom increased from 2px to 4px to make more evident that the tab is currently active. This is to complement the darkening of the tab border from the previous change.
  • All light gray text changed from gray-400 (#8F8F8F) to gray-500 (#707070) - Contrast change: from 3.23:1 to 4.95.

For the Search button Searchsubmit search. Remove the sr-only span, otherwise it will read as "Search submit search".

An empty string was provided to the parameter that adds the span with the sr-only class. This results in an empty span with a sr-only. I'll assume the span will be ignored, otherwise we should request an update on Paragon to remove the element when there's no text for that label.

For

add aria-live="polite" aria-relevant="all" aria-atomic="true".

Done.

In narrow viewport, if there is a More... button, the focusable

  • should have role="tab". (Spin up a new ticket for a Paragon accessibility update if this is not possible on our side).

  • This is a Paragon issue. A request to update this will be created.

    The logic seems to be off on narrow viewports. Where it shows the More button when there is room for Sequence for example. And when Sequence is selected it doesn’t appear to be selected (though this particular filter result might be an edge case).

    This is a Paragon issue. A request to update this will be created.

    Change search to search box Better to have more distinct labels, for voice input programs.

    The search component in Paragon has a property to set both the label and the button text (i18n), but share the same property. So currently is not possible to have a different text between the label and the search submit button. This is a Paragon issue. A request to update this will be created.

    Ticket KBK-77

    Currently, the result count from the search endpoint is not equivalent to the result item count. We've decided to remove this count from the results label.

    UI Changes

    These are screenshots showing the results in the UI updates.

    New

    search-after

    Old

    search-before

    Comment on lines -41 to -58
    .course-tabs-navigation {
    border-bottom: solid 1px #eaeaea;

    .nav a,
    .nav button {
    &:hover {
    background-color: $light-400;
    }
    }

    .nav a {
    &:not(.active):hover {
    background-color: $light-400;
    border-bottom: none;
    }
    }
    }

    Copy link
    Member Author

    Choose a reason for hiding this comment

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

    This was moved to its own css file for the CourseTabsNavigation component.

    @rijuma rijuma force-pushed the rijuma/ui-search-ui-a11y-changes branch from 77ac13d to 56f7e5e Compare December 14, 2023 19:01
    @rijuma rijuma marked this pull request as ready for review December 14, 2023 19:27
    Copy link

    codecov bot commented Dec 14, 2023

    Codecov Report

    All modified and coverable lines are covered by tests ✅

    Comparison is base (e004ead) 87.97% compared to head (e1a6f79) 87.96%.

    Additional details and impacted files
    @@            Coverage Diff             @@
    ##           master    #1253      +/-   ##
    ==========================================
    - Coverage   87.97%   87.96%   -0.01%     
    ==========================================
      Files         276      276              
      Lines        4739     4736       -3     
      Branches     1194     1191       -3     
    ==========================================
    - Hits         4169     4166       -3     
      Misses        554      554              
      Partials       16       16              

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

    Copy link
    Contributor

    @schenedx schenedx left a comment

    Choose a reason for hiding this comment

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

    A question on the removal of a test case.
    No blocking comments. LGTM 👍

    @@ -246,24 +246,14 @@ describe('CoursewareSearch', () => {
    expect(screen.queryByTestId('courseware-search-summary').textContent).toBe('No results found.');
    });

    it('should show a summary for a single result', () => {
    it('should show a summary for the results', () => {
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Why did you remove the test case for multiple results?

    Copy link
    Member Author

    @rijuma rijuma Dec 14, 2023

    Choose a reason for hiding this comment

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

    It used to have two different messages, one for a single result and another for multiple/zero results, like:

    • 1 match found for ${search}
    • 2 matches found for ${search}

    This required two i18n entries for different languages as well.

    Since we are not considering the count any more, it will always be the same copy.

    src/course-tabs/course-tabs-navigation.scss Outdated Show resolved Hide resolved
    @rijuma rijuma merged commit 2bf326f into master Dec 15, 2023
    6 checks passed
    @rijuma rijuma deleted the rijuma/ui-search-ui-a11y-changes branch December 15, 2023 12:23
    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.

    2 participants