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

Accessibility Improvements #1525

Closed

Conversation

kommunarr
Copy link
Collaborator

@kommunarr kommunarr commented Jul 16, 2021


Accessibility Improvements

Pull Request Type

  • Feature Implementation

Related issue
closes #693
closes #1580

Description
Currently, most of FreeTube's controls do not use the proper semantic elements (e.g., button, a). These "fake controls" (i.e., mostly <div>s, <span>s, and custom FreeTube elements with a @click or @change event handler) seem to work fine for sighted users, but they lack much of the functionality & screen reader interaction provided by the native control elements.

To minimize the effect on the look and feel of the app, this pull request uses a combination of roles (e.g., button, link), accessibility attributes (e.g., aria-label, aria-selected), and event handlers (e.g., @keydown) to enhance FreeTube's controls (e.g., <ft-icon-button>, <ft-notification-banner>) & assorted existing "fake controls" with the proper behavior. Almost all controls should now be both keyboard focusable and keyboard interactive.

The appearance of the app is virtually unaffected, but some elements have new styling on being focused (and hovered for some). For people who do not use screen readers or keyboard navigation, most of the focusing style changes should be insignificant. Sighted users will appreciate that some buttons, links, and tabs now appropriately change appearance on hover.

While most users do not use their keyboard to navigate the app, the user experience for all users should be noticeably improved. The profile selection tab, channel page tabs, and all drop-down lists can now be navigated with arrow keys. All video lists can now be navigated with arrow keys as well.

Screenshots (if appropriate)
The visual appearance of the app is the same. The main differences relate to interactivity.

Testing (for code that is not small enough to be easily understandable)
I am neither Blind nor competent with a screen reader. I did not use a screen reader in my testing, but I did thoroughly test keyboard navigation. Although these improvements should be unilaterally positive, I would be welcome to hear the input of people who regularly use screen readers / keyboard navigation.

Here are two videos testing/showcasing most of the new functionality in five separate clips. The only changes not displayed in the videos are comment navigation, live chat navigation, and new benefits for screen readers (e.g., new button labels):

  • Accessibility.Improvements.mp4
  • Accessibility.Improvements.II.mp4

Desktop (please complete the following information):

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.13.2 Beta

Additional context
This pull request replaces all the "fake controls" I could find. For "fake controls" beginning with "ft-", the appropriate @keydown behavior is now handled automatically. However, future developers should take care to still give the appropriate role [most likely either role="button" or role="link"] to their <ft-channel-bubble>s and <ft-profile-bubble>s upon creating them. If you are thinking about using a <font-awesome-icon> as a button or link, you should probably use an <ft-icon-button> instead. If you have no choice but to use a fake control, append to it @keydown.enter.prevent="linkOrButtonFunction" if it's a link or button as well as a @keydown.space.prevent="buttonFunction" if it's a button.

Future FreeTube contributors should take care to not use "fake controls" (e.g., a <div> or <span> with a @click or @change event handler). This is inaccessible to users who use keyboard navigation and/or screen readers to navigate the app. Whenever possible, use native controls (e.g., <button>, <a>) or FreeTube's controls (e.g., <ft-button>, <ft-icon-button>). Otherwise, you (or someone else) will have to do the work of adding roles, aria-labels, accessible event handlers, and so on. I would like these accessibility suggestions to be added to the wiki/documentation and/or required by linter rules.

2 Final Updates:

  1. 95d1380: Linter rules against inaccessible fake controls, among other accessibility rules, will be codified in the FreeTube linter upon the passage of this PR. This was done using all but two of the recommended rules in eslint-plugin-vuejs-accessibility (see discussion here and here).
  2. 3ad708e: This pull request has now implemented all of its intended accessibility changes and more. With the helpful input of @RastislavKish and four additional waves of changes since July, this PR has finally begun being tested.

@PikachuEXE
Copy link
Collaborator

@ChunkyProgrammer Cannot until 0.17 released...

@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 6, 2022
src/renderer/App.js Show resolved Hide resolved
@@ -42,6 +42,8 @@
"rebuild:electron": "electron-builder install-app-deps",
"rebuild:node": "npm rebuild",
"release": "run-s test build",
"test": "run-s rebuild:node pack:workers jest",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"test": "run-s rebuild:node pack:workers jest",

@@ -42,6 +42,8 @@
"rebuild:electron": "electron-builder install-app-deps",
"rebuild:node": "npm rebuild",
"release": "run-s test build",
"test": "run-s rebuild:node pack:workers jest",
"test:watch": "run-s rebuild:node pack:workers jest:watch",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"test:watch": "run-s rebuild:node pack:workers jest:watch",

Comment on lines +134 to +140
// const listbox = $(`#${this.id}`)
// const allOptions = listbox.children()

// allOptions.attr('aria-selected', 'false')
// allOptions.attr('tabindex', '-1')
// event.target.setAttribute('aria-selected', 'true')
// event.target.setAttribute('tabindex', '0')
Copy link
Member

Choose a reason for hiding this comment

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

@jasonhenriquez would you be able to provide context on the removal? maybe someone else could work on it. (I think this is the main blocker for the code to be reviewed)

@@ -104,6 +106,8 @@
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"eslint-plugin-vue": "^7.17.0",
"eslint-plugin-vuejs-accessibility": "^1.2.0",
"fast-glob": "^3.2.7",
Copy link
Member

@ChunkyProgrammer ChunkyProgrammer Sep 9, 2022

Choose a reason for hiding this comment

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

a newer version of fast-glob is available. also curious as to why this package is added? is it needed by vuejs-accessibility?
edit: nvm 72b4e17

@@ -38,6 +42,12 @@ module.exports = {
'no-console': 0,
'no-unused-vars': 1,
'no-undef': 1,
'vue/no-template-key': 1
'vue/no-template-key': 1,
'vuejs-accessibility/no-onchange': 0,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
'vuejs-accessibility/no-onchange': 0,
'vuejs-accessibility/no-onchange': 'warn',

@@ -104,6 +106,8 @@
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"eslint-plugin-vue": "^7.17.0",
"eslint-plugin-vuejs-accessibility": "^1.2.0",
"fast-glob": "^3.2.7",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"fast-glob": "^3.2.7",

@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2022

This PR is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@ChunkyProgrammer
Copy link
Member

Going to keep this open for now

@github-actions
Copy link
Contributor

This PR is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@ChunkyProgrammer
Copy link
Member

Most of the changes in this PR have been implemented.
Things that still need to be implemented:

  • accessibility improvements to video/playlist/channel lists
  • profile elements

Also created a C# project for selenium tests (it runs accessibility analysis agaianst FreeTube Cordova) https://github.com/ChunkyProgrammer/FreeTube-Cordova-Selenium-Tests

@efb4f5ff-1298-471a-8973-3d47447115dc

@ChunkyProgrammer i wanted to test FT in more places just like i reported in #3643

Should i keep opening issues or is it best to put all my findings here?

@ChunkyProgrammer
Copy link
Member

I think new issues would be better, that way there is more visibility to the issues

@ChunkyProgrammer
Copy link
Member

From what I can tell, the only thing from this PR that still needs to be added to FreeTube is using headings (h tags) for search results

@efb4f5ff-1298-471a-8973-3d47447115dc

@ChunkyProgrammer do you think this can be closed now that your latest PR has been merged?

@ChunkyProgrammer
Copy link
Member

Changes should be implemented

auto-merge was automatically disabled August 21, 2023 12:15

Pull request was closed

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.

FreeTube accessibility issues Adding eslint-plugin-vuejs-accessibility to linter rules
9 participants