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

Improve accessibility for welcome/home page and dashboard #3159

Merged
merged 4 commits into from
Jun 29, 2023

Conversation

mjgiarlo
Copy link
Member

@mjgiarlo mjgiarlo commented Jun 28, 2023

Why was this change made? 🤔

Fixes #3148
Fixes #3150

  • Remove WCAG A/AA and aria violations from welcome page
  • Remove WCAG A/AA and aria violations from home page
  • Address accessibility errors in welcome & home pages identified by axe and wave plugins
  • Eliminate accessibility violations on dashboard page

How was this change tested? 🤨

  • CI
  • QA/stage

Does your change introduce accessibility violations? 🩺

No.

@@ -2,7 +2,7 @@
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="citationModalHeader"></h5>
<h5 class="modal-title" id="citationModalHeader">Copy citation</h5>
Copy link
Member Author

Choose a reason for hiding this comment

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

Empty headings bad.

<% end %>
<% else %>
<tr>
<td colspan="7" class="text-center">No visible deposits</td>
Copy link
Member Author

Choose a reason for hiding this comment

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

Empty table bodies bad.

@@ -1,8 +1,8 @@
<tr>
<td>
<%= work_link %>
<%= helpers.turbo_frame_tag dom_id(work, :edit), src: edit_button_work_path(work), target: "_top" %>
<%= helpers.turbo_frame_tag dom_id(work, :delete), src: delete_button_work_path(work) %>
<%= helpers.turbo_frame_tag dom_id(work, :edit_in_progress), src: edit_button_work_path(work, tag: "in_progress"), target: "_top" %>
Copy link
Member Author

Choose a reason for hiding this comment

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

Non-unique IDs bad.

@@ -1,8 +1,8 @@
<div class="modal fade" id="purlReservationModal" tabindex="-1" aria-labelledby="content-type-prompt" aria-hidden="true">
<div class="modal fade" id="purlReservationModal" tabindex="-1" aria-labelledby="deposit-title-prompt" aria-hidden="true">
Copy link
Member Author

Choose a reason for hiding this comment

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

Non-unique IDs (due to copypasta) bad.

@@ -1,5 +1,5 @@
<%= turbo_frame_tag dom_id(collection, :summary) do %>
<li class="mb-5"><!-- from _dashboard.html -->
<div class="mb-5"><!-- from _dashboard.html -->
Copy link
Member Author

@mjgiarlo mjgiarlo Jun 28, 2023

Choose a reason for hiding this comment

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

Having tags between a list container element (ul) and a list item element (li)---the turbo frame---bad. And, AFAICT, there is no need to have a ul/li structure here.

@@ -3,6 +3,7 @@
<% end %>
<main class="mb-3 mb-md-5" id="content">
<div class="container px-4 px-md-3" id="dashboard" data-controller="work-type work-type-modal">
<h1 class="mb-3">Dashboard</h1>
Copy link
Member Author

Choose a reason for hiding this comment

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

Lack of top-level headings bad.

@@ -28,11 +28,11 @@
</head>

<body data-controller="help-how">
<div class="overflow-hidden">
<nav class="overflow-hidden" aria-label="Skip to main content">
Copy link
Member Author

Choose a reason for hiding this comment

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

Lack of aria bad. Prefer semantic tags.

@@ -83,14 +83,14 @@
</div>
</nav>
<% if controller_name != 'welcome' %>
<div class="background-holder">
<header class="background-holder">
Copy link
Member Author

Choose a reason for hiding this comment

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

Prefer semantic tags.


<div id="global-footer" role="contentinfo">
Copy link
Member Author

Choose a reason for hiding this comment

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

Multiple role="contentinfo" elements bad. Move the SU footer into the HTML footer.

@@ -1,9 +1,9 @@
<div class="modal" id="termsOfDepositModal" tabindex="-1" aria-labelledby="content-type-prompt" aria-hidden="true">
<div class="modal" id="termsOfDepositModal" tabindex="-1" aria-labelledby="terms-of-deposit-prompt" aria-hidden="true">
Copy link
Member Author

Choose a reason for hiding this comment

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

Non-unique IDs (due to copypasta) bad.

@@ -1,9 +1,9 @@
<div class="row justify-content-center">
<main class="row justify-content-center" id="content">
Copy link
Member Author

Choose a reason for hiding this comment

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

Prefer semantic elements. And provide an anchor for the skip link.

<div class="card col-md-10 col-lg-8 col-xl-7 col-xxl-6 mt-5 mb-5">
<div class="card-body">
<h5 class="card-title">Welcome!</h5>
<h1 class="card-title">Welcome!</h1>
Copy link
Member Author

Choose a reason for hiding this comment

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

Select a heading based on semantics, not display (which can be controlled by CSS).

@@ -18,7 +18,8 @@
<a href="#photo-credit" class="credit">Photo credit<sup>*</sup></a>
</div>
</main>
<div class="benefits">

<section class="benefits" aria-label="Benefits">
Copy link
Member Author

Choose a reason for hiding this comment

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

Prefer semantic elements.


<div class="whys">
<section class="whys" aria-label="Frequently Asked Questions">
Copy link
Member Author

Choose a reason for hiding this comment

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

Prefer semantic elements.

<div class="container p-4">
<div class="row">
<div class="col-md-3">
<%= image_tag "home_who.jpg", height: 80, width: 80, aria: {hidden: true} %>
<%= image_tag "home_who.jpg", height: 80, width: 80, aria: {hidden: true}, alt: "Who" %>
Copy link
Member Author

Choose a reason for hiding this comment

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

Use alt attrs consistently.

Copy link
Contributor

@ndushay ndushay left a comment

Choose a reason for hiding this comment

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

LGTM, modulo Amy approving visible changes.

Fixes #3150

This deals with a11y violations of the A/AA/aria variety as identified by the Siteimprove Accessibility Checker extension and the WAVE extension.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants