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: [M3-7571] - Missing label for Full Account Access Toggle #10931

Merged
merged 6 commits into from
Sep 23, 2024

Conversation

carrillo-erik
Copy link
Contributor

@carrillo-erik carrillo-erik commented Sep 12, 2024

Description 📝

This PR addresses the issue of the "Full Account Access" toggle missing a proper label. The changes in this PR improve accessibility in two ways. First by implementing correct markup semantics. Second, by ensuring screen readers inform the user more adequately by enhancing the output that is read.

Changes 🔄

List any change relevant to the reviewer.

  • Separates the "Full Account Access" toggle from the "User Permissions" header to improve readability.
  • Changes the variant property for some Typography components to ensure proper Header levels.
  • Update e2e tests

Target release date 🗓️

09/30/2024

Preview 📷

Before After
m3-7571-screenreader-before m3-7571-screenreader-after
m3-7571-desktop-before m3-7571-desktop-after
m3-7571-mobile-before m3-7571-mobile-after

How to test 🧪

Prerequisites

(How to setup test environment)

  • Visit the User Permissions landing page and activate the VoiceOver Utility (⌘ + F5) on your MAC computer.

Verification steps

(How to verify changes)

  • Use your keyboard to navigate to the "Full Account Access" toggle and changed the value a few times.
  • Pay attention to the audio output of the VoiceOver utility and/or inspect the text transcript to verify the expected output.
  • Verify that all Permission-related functionality works as expected.
  • Verify that there are no unexpected visual regressions.

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@carrillo-erik carrillo-erik added the Accessibility Contains accessibility improvements or changes label Sep 12, 2024
@carrillo-erik carrillo-erik self-assigned this Sep 12, 2024
@carrillo-erik carrillo-erik requested review from a team as code owners September 12, 2024 20:13
@carrillo-erik carrillo-erik requested review from cliu-akamai, jaalah-akamai and abailly-akamai and removed request for a team September 12, 2024 20:13
Copy link

github-actions bot commented Sep 12, 2024

Coverage Report:
Base Coverage: 87.12%
Current Coverage: 87.12%

Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

Thx! - Accessibility fix looks good but the headings composition needs to be reverted

packages/manager/src/features/Users/UserPermissions.tsx Outdated Show resolved Hide resolved
@@ -371,7 +345,7 @@ class UserPermissions extends React.Component<CombinedProps, State> {
spacing={2}
>
<Grid>
<Typography data-qa-permissions-header="billing" variant="h3">
<Typography data-qa-permissions-header="billing" variant="h2">
Copy link
Contributor

Choose a reason for hiding this comment

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

same - the headings composition was already correct

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found the culprit that led me to miscalculate the header order based on the Lighthouse tool. I've reverted the headers and updated the variant for the appropriate element.
Screenshot 2024-09-17 at 11 49 22 AM

Copy link
Contributor

@jaalah-akamai jaalah-akamai left a comment

Choose a reason for hiding this comment

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

Yea these are good pending changes

cy.findByLabelText('Toggle Full Account Access')
.should('be.visible')
.click();
cy.findByText('Full Account Access').should('be.visible').click();
Copy link
Member

Choose a reason for hiding this comment

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

This might be a dumb question, but wouldn't the fact that we switched to findByText over findByLabelText indicate that it isn't accessible? Is it expected we can't use findByLabelText?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bnussman-akamai It's a valid question and I was confused by this as well. The error from running the cypress debug command states "The element is not visible because it has CSS property: opacity: 0."

Looking at the Cypress docs, as a best practice, they recommend using data-* attributes to provide context to selectors and isolate them from CSS or JS changes. With that in mind, I went ahead and implemented this and confirmed the tests are still passing and VoiceOver works as expected.

Copy link
Member

Choose a reason for hiding this comment

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

Understood! Thanks for the context 🙏

Copy link
Contributor

@abailly-akamai abailly-akamai 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 the changes - change looks good from my end and addresses the accessibility issue ✅

@coliu-akamai coliu-akamai added Approved Multiple approvals and ready to merge! and removed Ready for Review labels Sep 18, 2024
@carrillo-erik carrillo-erik merged commit f36485d into linode:develop Sep 23, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility Contains accessibility improvements or changes Approved Multiple approvals and ready to merge!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants