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: Apply accessibility violation fixes #1344

Merged
merged 11 commits into from
Jul 3, 2024
Merged

Conversation

lauzadis
Copy link
Member

@lauzadis lauzadis commented Jul 1, 2024

Fixes various docs accessibility issues:

  1. Ensure pages reflow without requiring two-dimensional scrolling without loss of content or functionality
    • We were violating this with via inline code blocks. Each symbol in these blocks are rendered separately, so it's not a simple fix to just enable wrapping on these elements.
    • This was fixed by adding a hamburger button to all code blocks which controls visibility. The code blocks are automatically hidden on small screens (<550px)
    • "Moving content to an accessible show/hide control, such as a hamburger menu, is acceptable."
  2. Ensure custom controls provide proper textual name, role, and state information
    • We were violating this by not setting aria-label, aria-controls, aria-expanded attributes on the left sidebar arrow button. The fix was to add these attributes to each navButton.
  3. Ensure all interactive functionality is operable with the keyboard
    • Users could not expand the left sidebar entries using only the keyboard. This was fixed by making the navButton a separate togglable button.
  4. Provide a mechanism for skipping past repetitive content
    • Users could not skip past the left sidebar, they would have to tab through each entry before reaching the main content of the page. This was fixed by adding an invisible button immediately after the first left sidebar entry. When tabbed into, the button becomes visible and provides a link to the main content of the page.

Issue #

N/A

Description of changes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

github-actions bot commented Jul 1, 2024

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

This comment has been minimized.

@lauzadis lauzadis added the no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly. label Jul 2, 2024
@lauzadis lauzadis marked this pull request as ready for review July 2, 2024 14:22
@lauzadis lauzadis requested a review from a team as a code owner July 2, 2024 14:22
Copy link

github-actions bot commented Jul 2, 2024

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

Copy link

github-actions bot commented Jul 2, 2024

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

This comment has been minimized.

Copy link

github-actions bot commented Jul 2, 2024

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

@lauzadis lauzadis changed the title fix: various docs accessibility violations fix: Apply docs accessibility fixes Jul 2, 2024
@lauzadis lauzadis changed the title fix: Apply docs accessibility fixes fix: Apply accessibility violation fixes Jul 2, 2024

This comment has been minimized.

Copy link

github-actions bot commented Jul 2, 2024

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

This comment has been minimized.

Copy link

github-actions bot commented Jul 2, 2024

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

This comment has been minimized.

docs/dokka-presets/scripts/accessibility.js Outdated Show resolved Hide resolved
//
/**
* Ensure that content (specifically, code blocks) reflows on small page sizes.
* Fix for accessibility violation: "Ensure pages reflow without requiring two-dimensional scrolling without loss of content or functionality"
Copy link
Contributor

Choose a reason for hiding this comment

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

style: it's a bit easier to read if we say Fixes accessibility violation: ...

docs/dokka-presets/css/aws-styles.css Outdated Show resolved Hide resolved
if (element.children.length > 1) {
element.insertBefore(skipLink, element.children[1]);
} else {
element.appendChild(skipLink);
Copy link
Contributor

Choose a reason for hiding this comment

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

question: do we have elements with 0 children?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, the leaf nodes in our documentation have 1 child which is what this condition matches.

The structure for this condition is like this:

<div sideMenuPart>
	<div overview>
	<div skip-to-main-content> -- added via appendChild

The other condition is for structures like like this:

<div sideMenuPart>
	<div overview>
	<div skip-to-main-content> -- added via insertBefore element.children[1]
	<div child sideMenuPart>
		<div overview>
	<div child sideMenuPart>
		<div overview>
	<div child sideMenuPart>
		<div overview>

docs/dokka-presets/scripts/accessibility.js Outdated Show resolved Hide resolved
docs/dokka-presets/scripts/accessibility.js Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Jul 2, 2024

Copy link

github-actions bot commented Jul 2, 2024

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

Copy link

github-actions bot commented Jul 2, 2024

Affected Artifacts

Changed in size
Artifact Pull Request (bytes) Latest Release (bytes) Delta (bytes) Delta (percentage)
paymentcryptography-jvm.jar closure 9,165,279 9,165,286 -7 -0.00%
paymentcryptography-jvm.jar 951,277 951,286 -9 -0.00%
ec2-jvm.jar closure 37,009,377 37,010,428 -1,051 -0.00%
ec2-jvm.jar 28,795,375 28,796,428 -1,053 -0.00%
eks-jvm.jar closure 10,977,468 10,978,569 -1,101 -0.01%
s3-jvm.jar closure 12,801,297 12,802,658 -1,361 -0.01%
s3-jvm.jar 4,500,046 4,501,409 -1,363 -0.03%
eks-jvm.jar 2,763,466 2,764,569 -1,103 -0.04%
paymentcryptographydata-jvm.jar closure 9,208,881 9,241,104 -32,223 -0.35%
connect-jvm.jar closure 18,902,466 19,003,050 -100,584 -0.53%
connect-jvm.jar 10,688,464 10,789,050 -100,586 -0.93%
paymentcryptographydata-jvm.jar 994,879 1,027,104 -32,225 -3.14%

@lauzadis lauzadis merged commit 77f1025 into main Jul 3, 2024
17 checks passed
@lauzadis lauzadis deleted the chore-docs-accessibility branch July 3, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants