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

Fix form required attributes redundancy and keyword input description #195

Merged
merged 1 commit into from
May 31, 2024

Conversation

jazairi
Copy link
Contributor

@jazairi jazairi commented May 29, 2024

Why these changes are being introduced:

DAS has informed us that it is bad practice to use both required and aria-required. They also suggested that we add an aria-describedby to the keyword input that links to the p tag below the site title.

Relevant ticket(s):

How this addresses that need:

This removes the redundant aria-required attributes and makes the suggested labeling change for the keyword input.

Side effects of this change:

The labeling piece only affects GDT, as non-GDT apps don't currently use the site_title partial. This feels acceptable, because the keyword input is more clearly labeled in other TIMDEX UI applications.

Developer

Accessibility
  • ANDI or WAVE has been run in accordance to our guide.
  • This PR contains no changes to the view layer.
  • New issues flagged by ANDI or WAVE have been resolved.
  • New issues flagged by ANDI or WAVE have been ticketed (link in the Pull Request details above).
  • No new accessibility issues have been flagged.
New ENV
  • All new ENV is documented in README.
  • All new ENV has been added to Heroku Pipeline, Staging and Prod.
  • ENV has not changed.
Approval beyond code review
  • UXWS/stakeholder approval has been confirmed.
  • UXWS/stakeholder review will be completed retroactively.
  • UXWS/stakeholder review is not needed.
Additional context needed to review

Confirm that required fields are still required (i.e., built-in form validations fire when they are empty).

Code Reviewer

Code
  • I have confirmed that the code works as intended.
  • Any CodeClimate issues have been fixed or confirmed as
    added technical debt.
Documentation
  • The commit message is clear and follows our guidelines
    (not just this pull request message).
  • The documentation has been updated or is unnecessary.
  • New dependencies are appropriate or there were no changes.
Testing
  • There are appropriate tests covering any new functionality.
  • No additional test coverage is required.

@mitlib mitlib temporarily deployed to timdex-ui-pi-more-form--ztt8fw May 29, 2024 21:06 Inactive
@coveralls
Copy link

coveralls commented May 29, 2024

Pull Request Test Coverage Report for Build 9320855317

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 98.653%

Totals Coverage Status
Change from base Build 9305057239: 0.2%
Covered Lines: 586
Relevant Lines: 594

💛 - Coveralls

@jazairi
Copy link
Contributor Author

jazairi commented May 29, 2024

CodeClimate issues are valid and noted, but not new. I think they showed up again because I touched the offending JS, so it analyzed it again instead of ignoring it.

@jazairi jazairi temporarily deployed to timdex-ui-pi-more-form--ztt8fw May 30, 2024 12:45 Inactive
@jazairi
Copy link
Contributor Author

jazairi commented May 30, 2024

Rich has confirmed that this review app fixes the last of the a11y issues. Opening for review.

@jazairi jazairi marked this pull request as ready for review May 30, 2024 16:15
@JPrevost JPrevost self-assigned this May 31, 2024
@@ -30,7 +30,8 @@ end
<input id="basic-search-main" type="search"
class="field field-text basic-search-input <%= "required" if search_required %>" name="q"
title="Keyword anywhere" placeholder="Enter your search"
value="<%= params[:q] %>" <%= 'required="required" aria-required="true"' if search_required %>>
value="<%= params[:q] %>" <%= 'required' if search_required %>
<%= 'aria-describedby=site-desc' if Flipflop.enabled?(:gdt) %>>
Copy link
Member

Choose a reason for hiding this comment

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

Can you help me understand why this is only being used for GDT enabled sites? I noted you called this out as unnecessary for non-GDT in the commit message but I don't understand why. I think I see the differences, but it's unclear why it was only an issue in GDT.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The relative clarity of the non-GDT form is the tiebreaker for me. It's just a keyword input with some advanced fields, so I suspect it will be clearer if a screen reader user goes from anh2 with the text of 'Search the MIT Libraries' to a 'Keyword anywhere' input.

To be transparent, though, this is an assumption I've made. I did not ask Rich to test search.libraries.mit.edu, and it's possible he would have the same feedback on that application. If that's a concern, I'd be happy add some copy (with Darcy's input) to describe the keyword input for non-GDT apps.

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with this solution for now as GDT is the only prod app. I'm waffly on whether we should pre-address this for non-GDT apps or remember/expect to come back to it when we prep non-GDT apps for prod. I'll go ahead and approve this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. It certainly calls to mind your idea of a post-project analysis of what are actually GDT features vs. non-GDT features.

Why these changes are being introduced:

DAS has informed us that it is bad practice to use both `required`
and `aria-required`. They also suggested that we add an
`aria-describedby` to the keyword input that links to the `p`
tag below the site title.

Relevant ticket(s):

* [GDT-327](https://mitlibraries.atlassian.net/browse/GDT-327)

How this addresses that need:

This removes the redundant `aria-required` attributes and makes
the suggested labeling change for the keyword input.

Side effects of this change:

The labeling piece only affects GDT, as non-GDT apps don't currently
use the `site_title` partial. This feels acceptable, because the
keyword input is more clearly labeled in other TIMDEX UI applications.
@jazairi jazairi temporarily deployed to timdex-ui-pi-more-form--ztt8fw May 31, 2024 15:50 Inactive
@jazairi jazairi merged commit 03f29ec into main May 31, 2024
4 of 5 checks passed
@jazairi jazairi deleted the more-form-a11y branch May 31, 2024 16:15
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.

4 participants