Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
e32074c
Adds button functionality to comments section
kommunarr Jul 10, 2021
1cd8edf
Changes commenters' profile redirects to links
kommunarr Jul 10, 2021
dd1ad86
Adds link functionality to channel name under video
kommunarr Jul 10, 2021
47abd92
Adds link & button functionality for playlist controls
kommunarr Jul 10, 2021
ab25d00
Fixes link functionality to not trigger on space key
kommunarr Jul 11, 2021
eb56ffa
Improves keyboard navigation & adds l/r arrow navigation
kommunarr Jul 12, 2021
aa1b7c2
Adds button functionality to ft-icon-buttons
kommunarr Jul 12, 2021
31c3725
Improves keyboard navigation & adds arrow navigation
kommunarr Jul 12, 2021
dcbcf1c
Adds listbox/option & Home/End key functionality
kommunarr Jul 13, 2021
54eb7f3
Adds up/down arrow & Home/End navigation to all ft-icon-buttons
kommunarr Jul 13, 2021
75f39d2
Adds yaml entries that should have been there already
kommunarr Jul 13, 2021
119dea8
Improves keyboard navigation, corrects roles, and adds yaml aria-labels
kommunarr Jul 13, 2021
ec578d0
Implements linter fixes and refactors channel arrow tab navigation
kommunarr Jul 13, 2021
aa7b080
Adds labels, roles, and improved keyboard navigation
kommunarr Jul 13, 2021
d939c88
Implements linter fixes and adds yaml aria-labels
kommunarr Jul 13, 2021
c75947c
Enables keyboard navigation for getting next page of search results
kommunarr Jul 14, 2021
c5710f5
Adds roles, aria-labels, and tab navigation to all ft-channel-bubbles
kommunarr Jul 14, 2021
af01188
Adds roles, aria-labels, and tab navigation to all ft-profile-buttons
kommunarr Jul 14, 2021
4ddd41b
Adds aria-abels, roles, and tab navigation to side-nav-more-options
kommunarr Jul 14, 2021
653c4c1
Adds close button to release notes modal and moves title
kommunarr Jul 15, 2021
b6f4560
Enables keyboard navigation for ft-notification-banners
kommunarr Jul 15, 2021
675d88e
Linter fixes
kommunarr Jul 15, 2021
ad95552
Minor accessibility improvements to ft-prompt
kommunarr Jul 15, 2021
22ca4bb
Retains ft-share-button close behavior
kommunarr Jul 15, 2021
c86dbb2
Adds accessible hover & focus styling to 'load comments' buttons & <a…
kommunarr Jul 15, 2021
b57b18b
Adds aria-abels, roles, and tab navigation to live chat
kommunarr Jul 15, 2021
f663fde
Update themes.css
kommunarr Jul 15, 2021
bbf81a3
Adds aria-labels, roles, and arrow navigation to ft-list-navigation
kommunarr Jul 15, 2021
cbee9d2
Fixes ft-icon-button arrow navigation & replaces unneeded role
kommunarr Jul 15, 2021
ea8d0dd
Adds proper event checks for link role
kommunarr Jul 15, 2021
fa04169
Adds toasts to 'Share Playlist' actions
kommunarr Jul 15, 2021
a0ee955
Fixes and simplifies ft-list-dropdown
kommunarr Jul 15, 2021
bbe10d1
Prevents unwanted event behavior in channel & profile bubbles
kommunarr Jul 16, 2021
d6fc1ca
Changes profile-selector to start focus on active profile
kommunarr Jul 16, 2021
57db78b
Fixes aria-labelledby value
kommunarr Jul 16, 2021
1258fa9
Adds more missing button actions
kommunarr Jul 17, 2021
6d7d975
Replaces unnecessary aria-labels with titles
kommunarr Jul 17, 2021
20693f8
Merge branch 'development' into improve-accessibility
kommunarr Jul 21, 2021
302cf28
Fixes search filter toggle button name
kommunarr Jul 22, 2021
02d4a94
Adds headings to video, playlist, and channel titles
kommunarr Jul 22, 2021
ab33285
Fixes styling from adding headings to results
kommunarr Jul 22, 2021
624d5e4
Moves 'save button' button lower in tab order w/o affecting apperance
kommunarr Jul 22, 2021
1d7d394
Fixes 'End' key profile selection
kommunarr Jul 23, 2021
734c8f3
Fixes redundant styling
kommunarr Jul 23, 2021
5de1145
Merge branch 'development' into improve-accessibility
kommunarr Aug 5, 2021
b76c2fd
Removes default event behavior & makes label translatable
kommunarr Aug 6, 2021
ad9b00d
Improves comments page styling
kommunarr Aug 8, 2021
558eb3f
Properly directs focus for comments section buttons
kommunarr Aug 8, 2021
ec3ba5f
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into im…
kommunarr Aug 8, 2021
9b46cff
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into im…
kommunarr Aug 13, 2021
6949308
Assorted minor accessibility improvements
kommunarr Aug 13, 2021
4d0a3dc
Fixes notification banner & makes profile-edit preset colors selectable
kommunarr Aug 13, 2021
12a9eaa
Adds eslint-plugin-vuejs-accessibility
kommunarr Aug 13, 2021
fca05c0
Applies eslint-plugin-vuejs-accessibility rules
kommunarr Aug 13, 2021
95d1380
Minor linter fixes
kommunarr Aug 13, 2021
d11aa8f
Refactors and adds wrap-around functionality to dropdown lists
kommunarr Aug 14, 2021
80d9ac0
Fixes ft-select, and removes extraneous linter rule
kommunarr Aug 14, 2021
48dfcb0
Refactors key event handling
kommunarr Aug 14, 2021
3ad708e
Refactors goToChannel and moves global functions
kommunarr Aug 14, 2021
8d5a249
Automatically applies focus to first button in any ft-prompt
kommunarr Aug 14, 2021
c3c7bc6
Merge branch 'development' into improve-accessibility
PrestonN Aug 16, 2021
bfccbdb
Merge branch 'development' into improve-accessibility
PrestonN Aug 16, 2021
f0beb49
Merge branch 'development' into improve-accessibility
PrestonN Aug 16, 2021
d85f9e5
Merge branch 'development' into improve-accessibility
PrestonN Aug 16, 2021
6f43ec5
Replaces deprecated JQuery .focus() calls with vanilla JS .focus() calls
kommunarr Aug 17, 2021
c604bfd
Enables arrow navigation of any ft-list-video elements
kommunarr Aug 17, 2021
e15bdc5
Merge branch 'development' into improve-accessibility
kommunarr Aug 21, 2021
da8b635
Merge branch 'development' into improve-accessibility
kommunarr Aug 24, 2021
b15a74d
Merges branch 'development' into branch 'improve-accessibility'
kommunarr Aug 26, 2021
574d244
Merge branch 'development' of https://github.com/FreeTubeApp/FreeTube…
kommunarr Aug 26, 2021
c047d2d
Minor linter fix
kommunarr Aug 26, 2021
c4825a1
Merge branch 'development' into improve-accessibility
kommunarr Aug 29, 2021
3ab90ae
Merge conflict fixes
kommunarr Aug 29, 2021
9ed3575
Merge branch 'improve-accessibility' of github.com:jasonhenriquez/Fre…
kommunarr Aug 29, 2021
a8a42f2
Removes language file changes
kommunarr Aug 29, 2021
6eb235d
Variety of important fixes
kommunarr Sep 2, 2021
2277b72
Minor linter fixes
kommunarr Sep 2, 2021
a7699de
Merge branch 'development' into improve-accessibility
kommunarr Sep 2, 2021
ad16ea4
Update package.json
kommunarr Sep 2, 2021
b566878
Update package.json
kommunarr Sep 2, 2021
761f99a
Merge branch 'development' of https://github.com/FreeTubeApp/FreeTube…
kommunarr Sep 6, 2021
dbd521f
Minor linter fix
kommunarr Sep 6, 2021
538a760
Makes ft-select labels function properly as labels
kommunarr Sep 6, 2021
ea71488
Removes whitespace characters from id attributes
kommunarr Sep 6, 2021
b4e4411
Merge branch 'development' of https://github.com/FreeTubeApp/FreeTube…
kommunarr Sep 6, 2021
89193ac
Merge branch 'development' of https://github.com/FreeTubeApp/FreeTube…
kommunarr Sep 12, 2021
e174d12
Merge branch 'development' of https://github.com/FreeTubeApp/FreeTube…
kommunarr Sep 14, 2021
5238edf
Mark channel name on channel page & video name on video page as headings
kommunarr Sep 14, 2021
da0d342
Merge branch 'development' of https://github.com/FreeTubeApp/FreeTube…
kommunarr Sep 20, 2021
1e6e263
Updates dependencies for accessibility plugin
kommunarr Sep 20, 2021
7391855
Merge branch 'development' into improve-accessibility
kommunarr Sep 23, 2021
51aebf4
Merge branch 'development' into improve-accessibility
kommunarr Oct 15, 2021
aaced10
Updates eslint-plugin-vuejs-accessibility & fixes for linter
kommunarr Oct 15, 2021
33a8629
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into im…
kommunarr Jun 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ module.exports = {
'prettier',
'eslint:recommended',
'plugin:vue/recommended',
'standard'
'standard',
'plugin:vuejs-accessibility/recommended'
],

// https://eslint.org/docs/user-guide/configuring#configuring-plugins
plugins: ['vue'],
plugins: [
'vue',
'vuejs-accessibility'
],

rules: {
'space-before-function-paren': 0,
Expand All @@ -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',

'vuejs-accessibility/label-has-for': ['error', {
required: {
some: ['nesting', 'id']
}
}]
}
}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",

"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",

"ci": "yarn install --frozen-lockfile"
},
"dependencies": {
Expand Down Expand Up @@ -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

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",

"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.3.2",
"mini-css-extract-plugin": "^2.2.2",
Expand Down
51 changes: 51 additions & 0 deletions src/renderer/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,3 +541,54 @@ export default Vue.extend({
])
}
})

// return true if it is a selection event, false if it is a navigation event
Vue.prototype.$handleDropdownKeyboardEvent = function(event, target, afterElement) {
if (!event || !(event instanceof KeyboardEvent)) {
return true
}

let nextElement = null
if (event.key === 'Tab') {
if (afterElement) {
afterElement.tabindex = 0
afterElement.focus()
}
return false
} if (event.key === 'ArrowUp') {
nextElement = target.previousElementSibling ?? target.parentNode.lastElementChild

if (nextElement.classList.contains('listItemDivider')) {
nextElement = nextElement.previousElementSibling
}
} else if (event.key === 'ArrowDown') {
nextElement = target.nextElementSibling ?? target.parentNode.firstElementChild

if (nextElement.classList.contains('listItemDivider')) {
nextElement = nextElement.nextElementSibling
}
} else if (event.key === 'Home') {
nextElement = target.parentNode.firstElementChild
} else if (event.key === 'End') {
nextElement = target.parentNode.lastElementChild
}

event.preventDefault()

if (nextElement) {
target.setAttribute('tabindex', '-1')
nextElement.setAttribute('tabindex', '0')
nextElement.focus()
}

return event.key === 'Enter' || event.key === ' '
}

// remove whitespace; intended to be used on attribute names
Vue.prototype.$unspace = function(attribute) {
return attribute.replace(/\s/g, '')
}

Vue.prototype.$goToChannel = function(id) {
this.$router.push({ path: `/channel/${id}` })
}
10 changes: 7 additions & 3 deletions src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
v-if="showUpdatesBanner"
class="banner"
:message="updateBannerMessage"
role="link"
@click="handleUpdateBannerClick"
/>
<ft-notification-banner
v-if="showBlogBanner"
class="banner"
:message="blogBannerMessage"
role="link"
@click="handleNewBlogBannerClick"
/>
</ft-flex-box>
Expand All @@ -40,11 +42,9 @@
</transition>
<ft-prompt
v-if="showReleaseNotes"
:label="changeLogTitle"
@click="showReleaseNotes = !showReleaseNotes"
>
<h2>
{{ changeLogTitle }}
</h2>
<span
id="changeLogText"
v-html="updateChangelog"
Expand All @@ -54,6 +54,10 @@
:label="$t('Download From Site')"
@click="openDownloadsPage"
/>
<ft-button
:label="$t('Close')"
@click="showReleaseNotes = !showReleaseNotes"
/>
</ft-flex-box>
</ft-prompt>
<ft-prompt
Expand Down
16 changes: 15 additions & 1 deletion src/renderer/components/ft-channel-bubble/ft-channel-bubble.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,21 @@ export default Vue.extend({
}
},
methods: {
handleClick: function () {
handleClick: function (event) {
if (event instanceof KeyboardEvent) {
if (event.key === 'Tab') {
return
}

event.preventDefault()

if (event.target.getAttribute('role') === 'link' && event.key !== 'Enter') {
return
} else if (event.key !== 'Enter' && event.key !== ' ') {
return
}
}

if (this.showSelected) {
this.selected = !this.selected
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<template>
<div
class="bubblePadding"
tabindex="0"
:aria-labelledby="'channelBubble-' + $unspace(channelName)"
@click="handleClick"
@keydown="handleClick($event)"
>
<img
class="bubble"
:src="channelThumbnail"
alt=""
>
<div
v-if="selected"
Expand All @@ -16,7 +20,10 @@
class="icon"
/>
</div>
<div class="channelName">
<div
:id="'channelBubble' + $unspace(channelName)"
class="channelName"
>
{{ channelName }}
</div>
</div>
Expand Down
74 changes: 49 additions & 25 deletions src/renderer/components/ft-icon-button/ft-icon-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,44 +65,56 @@ export default Vue.extend({
methods: {
toggleDropdown: function () {
const dropdownBox = $(`#${this.id}`)

if (this.dropdownShown) {
dropdownBox.get(0).style.display = 'none'
dropdownBox[0].style.display = 'none'
this.dropdownShown = false
} else {
dropdownBox.get(0).style.display = 'inline'
dropdownBox.get(0).focus()
this.dropdownShown = true
return
}

dropdownBox[0].style.display = 'inline'
this.dropdownShown = true

const firstItem = dropdownBox.find('.listItem')[0]
if (firstItem) {
firstItem.tabindex = 0
firstItem.setAttribute('aria-selected', 'true')
dropdownBox.attr('aria-expanded', 'true')
firstItem.focus()
}

dropdownBox.on('focusout', (e) => {
if (dropdownBox.has(e.relatedTarget).length) {
return
}

dropdownBox.focusout(() => {
const shareLinks = dropdownBox.find('.shareLinks')
dropdownBox[0].style.display = 'none'
dropdownBox.attr('aria-expanded', 'false')

if (shareLinks.length > 0) {
if (!shareLinks[0].parentNode.matches(':hover')) {
dropdownBox.get(0).style.display = 'none'
// When pressing the profile button
// It will make the menu reappear if we set `dropdownShown` immediately
setTimeout(() => {
this.dropdownShown = false
}, 100)
}
} else {
const shareLinks = dropdownBox.find('.shareLinks')
if (shareLinks.length > 0) {
if (!shareLinks[0].parentNode.matches(':hover')) {
dropdownBox.get(0).style.display = 'none'
// When pressing the profile button
// It will make the menu reappear if we set `dropdownShown` immediately
setTimeout(() => {
this.dropdownShown = false
}, 100)
}
})
}
} else {
dropdownBox.get(0).style.display = 'none'
// When pressing the profile button
// It will make the menu reappear if we set `dropdownShown` immediately
setTimeout(() => {
this.dropdownShown = false
}, 100)
}
})
},

focusOut: function () {
focusOut: function() {
const dropdownBox = $(`#${this.id}`)

dropdownBox.focusout()
dropdownBox.get(0).style.display = 'none'
dropdownBox.trigger('focusout')
dropdownBox[0].style.display = 'none'
this.dropdownShown = false
},

Expand All @@ -114,7 +126,19 @@ export default Vue.extend({
}
},

handleDropdownClick: function ({ url, index }) {
handleDropdownClick: function ({ url, index }, event) {
if (!this.$handleDropdownKeyboardEvent(event, event?.target)) {
return
}

// 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')
Comment on lines +134 to +140
Copy link
Member

Choose a reason for hiding this comment

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

What happen to this commented code?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was a temporary removal - will add it back when I have the time.

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)


if (this.returnIndex) {
this.$emit('click', index)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/ft-icon-button/ft-icon-button.sass
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
cursor: pointer
transition: background 0.2s ease-out

&:hover
&:hover, &:focus
background-color: var(--side-nav-hover-color)
transition: background 0.2s ease-in

Expand Down
13 changes: 12 additions & 1 deletion src/renderer/components/ft-icon-button/ft-icon-button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
padding: padding + 'px',
fontSize: size + 'px'
}"
tabindex="0"
role="button"
@click="handleIconClick"
@keydown.enter.prevent="handleIconClick"
@keydown.space.prevent="handleIconClick"
/>
<div
:id="id"
Expand All @@ -30,12 +34,19 @@
<ul
v-if="dropdownOptions.length > 0"
class="list"
role="listbox"
aria-expanded="false"
>
<li
v-for="(option, index) in dropdownOptions"
:id="title + '-' + index"
:key="index"
role="option"
aria-selected="false"
tabindex="-1"
:class="option.type === 'divider' ? 'listItemDivider' : 'listItem'"
@click="handleDropdownClick({url: option.value, index: index})"
@click="handleDropdownClick({url: option.value, index: index}, $event)"
@keydown="handleDropdownClick({url: option.value, index: index}, $event)"
>
{{ option.type === 'divider' ? '' : option.label }}
</li>
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/components/ft-input/ft-input.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- eslint-disable vuejs-accessibility/mouse-events-have-key-events -->
<template>
<div
class="ft-input-component"
Expand Down Expand Up @@ -69,6 +70,7 @@
@mouseenter="searchState.isPointerInList = true"
@mouseleave="searchState.isPointerInList = false"
>
<!-- eslint-disable vuejs-accessibility/click-events-have-key-events -->
<li
v-for="(list, index) in visibleDataList"
:key="index"
Expand All @@ -78,6 +80,7 @@
>
{{ list }}
</li>
<!-- skipped -->
</ul>
</div>
</div>
Expand Down
16 changes: 10 additions & 6 deletions src/renderer/components/ft-list-channel/ft-list-channel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,24 @@
<div class="channelThumbnail">
<router-link
:to="`/channel/${id}`"
tabindex="-1"
>
<img
:src="thumbnail"
class="channelImage"
alt=""
>
</router-link>
</div>
<div class="info">
<router-link
class="title"
:to="`/channel/${id}`"
>
{{ channelName }}
</router-link>
<h2 class="resultHeading">
<router-link
class="title"
:to="`/channel/${id}`"
>
{{ channelName }}
</router-link>
</h2>
<div class="infoLine">
<span
v-if="subscriberCount !== null"
Expand Down
Loading