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

Nj 78 axe a11y #5323

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Nj 78 axe a11y #5323

wants to merge 1 commit into from

Conversation

mmazanec22
Copy link
Contributor

@mmazanec22 mmazanec22 commented Jan 7, 2025

Link to pivotal/JIRA issue

Most issues fixed in this PR were identified previously in https://github.com/newjersey/affordability-pm/issues/78

Those previously identified issues are explained in greater detail in these tickets (which should be publicly visible):
newjersey/accessibility-pm#1
newjersey/accessibility-pm#2
newjersey/accessibility-pm#15
newjersey/accessibility-pm#8

And this critical issue is fixed as well:
newjersey/accessibility-pm#9

Is PM acceptance required? (delete one)

  • Yes - don't merge until JIRA issue is accepted!

We probably also want CfA design review to make sure there are no unwanted visual changes.

What was done?

Tackle a handful of small accessibility issues and improve e2e testing.

How to test?

Navigate using the catchall persona to see as many screens as possible.

There should be no visual changes besides the keyboard focus (the critical issue linked above), back button color contrast, and dev button color contrast.

CfA reviewers, please check that the landmark changes don't affect anything that our team wouldn't notice.

Screenshots (for visual changes)

Used the :focus-visible pseudo class to make sure that there's no focus on click for the reveal, but there is a focus for keyboard users
image
image

Back button color contrast is improved
Before
image
After
image

Copy link

github-actions bot commented Jan 7, 2025

Heroku app: https://gyr-review-app-5323-3ed2fa7daa99.herokuapp.com/
View logs: heroku logs --app gyr-review-app-5323 (optionally add --tail)

@@ -14,4 +14,4 @@
</div>
</div>
</div>
</main>
</div>
Copy link
Contributor

@mluedke2 mluedke2 Jan 8, 2025

Choose a reason for hiding this comment

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

[dust] I confess I don't understand this change -- which of the issues does this fix? I'm used to introducing main when possible as being more semantic, so on a surface level this surprises me.

Edit: After looking at more of this diff, I wonder if it is because this ERB feeds into a larger page and thus the main here would conflict with a main from others?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we should only have one main landmark per page. See newjersey/accessibility-pm#1

Copy link
Contributor

Choose a reason for hiding this comment

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

got it, thanks!

@@ -17,7 +17,6 @@
label: t("general.negative"),
input_html: {
"data-follow-up": "#household-members",
"aria-controls": "household-members"
Copy link
Contributor

Choose a reason for hiding this comment

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

[dust] I also don't understand the removal of this -- was it not effective or correct as it was?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Axe flagged it, so I think it was either not correct, or needs to be added with js when the associated element appears, or was a problem bc of nested fieldsets. Going to surface this with Damian after the fieldset PR lands

@@ -651,31 +651,40 @@

context "NJ", :flow_explorer_screenshot, js: true do

def advance_to_start_of_intake(df_persona_name)
def advance_to_start_of_intake(df_persona_name, check_a11y: false)
Copy link
Contributor

Choose a reason for hiding this comment

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

[dust] I'm wondering why this is a toggle as opposed to always checking accessibility. Is checking costly in terms of time, so turning it off for most tests would reduce test suite time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I want to avoid duplicate checks of the same pages

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense! I'm curious about the scale of time saved, for future reference. But sounds good to me! (Also makes me wonder if there are other places in the slower tests like E2E or PDF filling that we can toggle off to save time... the CI taking 15 minutes is ok but feels like it could be quicker).

Copy link
Contributor

@mluedke2 mluedke2 left a comment

Choose a reason for hiding this comment

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

thanks for addressing my questions -- looks good to me!

@mmazanec22 mmazanec22 assigned mmazanec22 and unassigned mmazanec22 Jan 8, 2025
Copy link
Contributor

@jachan jachan left a comment

Choose a reason for hiding this comment

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

Looks good! Had one question about alt text.

@@ -25,7 +25,7 @@
</div>
<% end %>
</div>
<%= image_tag 'questions/welcome.svg', class: 'fyst-home-image' %>
<%= image_tag 'questions/welcome.svg', class: 'fyst-home-image', alt: '' %>
Copy link
Contributor

Choose a reason for hiding this comment

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

[DUST] Would it be helpful to fill in the alt text here for the visually impaired, or is that unnecessary/overkill?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This specifically needs an empty alt tag because it is a decorative image

advance_to_property_tax_page("Minimal", skip_health_insurance_eligibility: true)
advance_to_start_of_intake("O neal walker catchall mfj", check_a11y: true)

expect(page).to be_axe_clean
Copy link
Contributor

Choose a reason for hiding this comment

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

[DUST] Yay expectations on a11y issues!

Copy link
Contributor

@mrotondo mrotondo left a comment

Choose a reason for hiding this comment

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

I have a few questions (one visual, one about html structure) but overall (with my very limited understanding of modern html, accessibility and landmarks) this seems like a reasonable change.

@@ -10,17 +10,17 @@
padding-right: .5rem;
}
font-size: 1.6rem;
border: 1px solid $color-grey-medium;
border: 1px solid $color-grey-dark;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why this wouldn't result in a visual change, can you explain?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is one of the visual changes I called out, and included a screen shot for

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I missed that! Please post both before & after screenshots for visual changes, and please tag Anu & Madison on the slack thread for this PR to make sure they've gotten eyes on it before it goes in.

</div>
</main>

<% if content_for :footer %>
Copy link
Contributor

@mrotondo mrotondo Jan 8, 2025

Choose a reason for hiding this comment

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

Looks like <header> and <footer> are defined in different places as of this change - should that be the case? Is there a benefit to bringing the <footer> element up into this layout file, or is it impractical?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TBH I was trying to make the lightest touch possible given the scope of the other changes I had to make, and it seemed like the footer didn't need intervention. Happy to bring it in here though if that's better!

Copy link
Contributor

Choose a reason for hiding this comment

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

That's reasonable - just wanted to make sure I understood the rationale for the different treatment. I'm fine with it staying like this!

Copy link
Contributor

@mrotondo mrotondo left a comment

Choose a reason for hiding this comment

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

lgtm, but as noted in my comment please post before & after screenshots and ping our designers to make sure they know about this change

Remove extra header tags

Remove extra main tags

Move footer, add empty alt tags, add more a11y checks, adapt css to new page structure

Address header and focus issues on landing page
@mmazanec22
Copy link
Contributor Author

Image should have been globally removed??

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