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 VideoPlayer accessibility issues #703

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

joshfarrant
Copy link
Contributor

@joshfarrant joshfarrant commented Aug 19, 2024

Summary

Fixes two Sev-2 VideoPlayer a11y issues.

The styling of the controls bar is heavier than it was before, but it's necessary to achieve the required contrast.

List of notable changes:

  • Improved contrast of VideoPlayer focus styles by making the focus outline thicker and offsetting it.
  • Improved contrast of controls and title.
  • To offset the heavier title bar styles, the title bar now hides while the video is playing. This should probably have been default behaviour from day 1.
  • Made the video tooltip more efficient by being more judicious about when the event listener is added.

Steps to test:

  1. Focus the VideoPlayer with the keyboard
  2. Observe the focus styles

Supporting resources (related issues, external links, etc):

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • New visual snapshots have been generated / updated for any UI changes
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

Screenshots:

Before After

image

image

image

image

Copy link

changeset-bot bot commented Aug 19, 2024

🦋 Changeset detected

Latest commit: d5fc0a4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@primer/react-brand Patch
@primer/brand-primitives Patch
@primer/brand-e2e Patch
@primer/brand-fonts Patch
@primer/brand-config Patch
@primer/brand-storybook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Aug 19, 2024

🔍 Design token changes found

View CSS variable changes
- --brand-videoPlayer-title-bgColor: linear-gradient(#01040966, var(--base-color-scale-transparent));
+ --brand-videoPlayer-title-bgColor: linear-gradient(180deg, #000000e6, #00000073 66%, transparent);
- --brand-videoPlayer-controls-bgColor: linear-gradient(var(--base-color-scale-transparent), #01040966);
+ --brand-videoPlayer-controls-bgColor: #000000bf;
- --brand-videoPlayer-range-bgColor-progress: var(--base-color-scale-blue-5);
+ --brand-videoPlayer-range-bgColor-progress: var(--base-color-scale-blue-4);
- --brand-videoPlayer-title-bgColor: linear-gradient(#01040966, var(--base-color-scale-transparent));
+ --brand-videoPlayer-title-bgColor: linear-gradient(180deg, #000000e6, #00000073 66%, transparent);
- --brand-videoPlayer-controls-bgColor: linear-gradient(var(--base-color-scale-transparent), #01040966);
+ --brand-videoPlayer-controls-bgColor: #000000bf;
- --brand-videoPlayer-range-bgColor-progress: var(--base-color-scale-blue-5);
+ --brand-videoPlayer-range-bgColor-progress: var(--base-color-scale-blue-4);

Copy link
Contributor

github-actions bot commented Aug 19, 2024

⚠️ Visual differences found

Our visual comparison tests found UI differences.

Please review the differences by using the test artifacts to ensure that the changes were intentional.

Artifacts can be downloaded and reviewed locally.

Download links are available at the bottom of the workflow summary screen.

Example:

artifacts section of workflow run

If the changes are expected, please run npm run test:visual:update-snapshots to replace the previous fixtures.

Review visual differences

@joshfarrant joshfarrant changed the title improve contrast of VideoPlayer focus styles Improve contrast of VideoPlayer focus styles Aug 20, 2024
@joshfarrant joshfarrant changed the title Improve contrast of VideoPlayer focus styles Fix VideoPlayer accessibility issues Aug 20, 2024
@joshfarrant joshfarrant marked this pull request as ready for review August 20, 2024 14:46
Copy link
Collaborator

@rezrah rezrah Sep 2, 2024

Choose a reason for hiding this comment

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

This is quite the change! The overlay is quite stark and now covers up a large part of the video underneath. If we're going this far, can we just position the control bar underneath the video instead of on top? Right now, it's eating into a lot of the video so I think everyone's losing out, and the opacity is barely going to be noticed (couldn't see it on my external display). Worth looping in a designer for second opinion too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants