From 9a13c33d6b84f4521003ffafa2c98cba6c5662d1 Mon Sep 17 00:00:00 2001
From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>
Date: Tue, 8 Aug 2023 13:15:48 -0700
Subject: [PATCH] Make profiles keyboard accessible
Co-Authored-By: Jason <84899178+jasonhenriquez@users.noreply.github.com>
---
.eslintrc.js | 3 ++-
.../ft-list-channel/ft-list-channel.vue | 2 ++
.../components/ft-list-video/ft-list-video.vue | 1 +
.../ft-profile-bubble/ft-profile-bubble.js | 11 ++++++++++-
.../ft-profile-bubble/ft-profile-bubble.vue | 9 ++++++++-
.../ft-profile-channel-list.vue | 1 +
.../ft-profile-edit/ft-profile-edit.vue | 4 ++++
.../ft-profile-filter-channels-list.vue | 1 +
.../ft-profile-selector/ft-profile-selector.vue | 15 +++++++++++++++
src/renderer/views/Channel/Channel.vue | 8 ++++++++
.../views/Subscriptions/Subscriptions.vue | 3 +++
src/renderer/views/Trending/Trending.vue | 4 ++++
static/locales/en-US.yaml | 1 +
13 files changed, 60 insertions(+), 3 deletions(-)
diff --git a/.eslintrc.js b/.eslintrc.js
index 8cc33f62ab94a..2729411b7e10b 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -47,7 +47,7 @@ module.exports = {
'plugin:vue/recommended',
'standard',
'plugin:jsonc/recommended-with-json',
- // 'plugin:vuejs-accessibility/recommended' // uncomment once issues are fixed
+ 'plugin:vuejs-accessibility/recommended'
],
// https://eslint.org/docs/user-guide/configuring#configuring-plugins
@@ -70,6 +70,7 @@ module.exports = {
some: ['nesting', 'id']
}
}],
+ 'vuejs-accessibility/no-static-element-interactions': 'off',
'n/no-callback-literal': 'warn',
'n/no-path-concat': 'warn',
'unicorn/better-regex': 'error',
diff --git a/src/renderer/components/ft-list-channel/ft-list-channel.vue b/src/renderer/components/ft-list-channel/ft-list-channel.vue
index cfc85205005e1..cd034322cbae0 100644
--- a/src/renderer/components/ft-list-channel/ft-list-channel.vue
+++ b/src/renderer/components/ft-list-channel/ft-list-channel.vue
@@ -10,10 +10,12 @@
diff --git a/src/renderer/components/ft-list-video/ft-list-video.vue b/src/renderer/components/ft-list-video/ft-list-video.vue
index a6a039d2ae8dd..e3a6303d5649f 100644
--- a/src/renderer/components/ft-list-video/ft-list-video.vue
+++ b/src/renderer/components/ft-list-video/ft-list-video.vue
@@ -22,6 +22,7 @@
0 ? Array.from(this.profileName)[0].toUpperCase() : ''
}
},
methods: {
- goToProfile: function () {
+ goToProfile: function (event) {
+ if (event instanceof KeyboardEvent) {
+ if (event.target.getAttribute('role') === 'link' && event.key !== 'Enter') {
+ return
+ }
+ }
this.$router.push({
path: `/settings/profile/edit/${this.profileId}`
})
diff --git a/src/renderer/components/ft-profile-bubble/ft-profile-bubble.vue b/src/renderer/components/ft-profile-bubble/ft-profile-bubble.vue
index 6879570dd057d..cfed977e68996 100644
--- a/src/renderer/components/ft-profile-bubble/ft-profile-bubble.vue
+++ b/src/renderer/components/ft-profile-bubble/ft-profile-bubble.vue
@@ -1,7 +1,11 @@
-
diff --git a/src/renderer/components/ft-profile-channel-list/ft-profile-channel-list.vue b/src/renderer/components/ft-profile-channel-list/ft-profile-channel-list.vue
index d19827b566e7f..bb77bfcb1751e 100644
--- a/src/renderer/components/ft-profile-channel-list/ft-profile-channel-list.vue
+++ b/src/renderer/components/ft-profile-channel-list/ft-profile-channel-list.vue
@@ -15,6 +15,7 @@
:channel-name="channel.name"
:channel-thumbnail="channel.thumbnail"
:show-selected="true"
+ role="button"
@click="handleChannelClick(index)"
/>
diff --git a/src/renderer/components/ft-profile-edit/ft-profile-edit.vue b/src/renderer/components/ft-profile-edit/ft-profile-edit.vue
index 700d54c3da4e6..d0824574f4b6e 100644
--- a/src/renderer/components/ft-profile-edit/ft-profile-edit.vue
+++ b/src/renderer/components/ft-profile-edit/ft-profile-edit.vue
@@ -19,8 +19,12 @@
v-for="(color, index) in colorValues"
:key="index"
class="colorOption"
+ :title="color + ' ' + $t('Profile.Custom Color')"
:style="{ background: color }"
+ tabindex="0"
@click="profileBgColor = color"
+ @keydown.space.prevent="profileBgColor = color"
+ @keydown.enter.prevent="profileBgColor = color"
/>
diff --git a/src/renderer/components/ft-profile-selector/ft-profile-selector.vue b/src/renderer/components/ft-profile-selector/ft-profile-selector.vue
index d1d0ee0c6dc91..f9696ad46a31a 100644
--- a/src/renderer/components/ft-profile-selector/ft-profile-selector.vue
+++ b/src/renderer/components/ft-profile-selector/ft-profile-selector.vue
@@ -2,9 +2,14 @@
{{ $t("Profile.Profile Select") }}
@@ -31,12 +37,20 @@
/>
{{ profile.name }}
diff --git a/src/renderer/views/Channel/Channel.vue b/src/renderer/views/Channel/Channel.vue
index 5c5af74c74907..114aaa16ab487 100644
--- a/src/renderer/views/Channel/Channel.vue
+++ b/src/renderer/views/Channel/Channel.vue
@@ -85,6 +85,7 @@
role="tablist"
:aria-label="$t('Channel.Channel Tabs')"
>
+
{{ $t("Channel.Videos.Videos").toUpperCase() }}
+
{{ $t("Global.Shorts").toUpperCase() }}
+
{{ $t("Channel.Live.Live").toUpperCase() }}
+
{{ $t("Channel.Releases.Releases").toUpperCase() }}
+
{{ $t("Channel.Podcasts.Podcasts").toUpperCase() }}
+
{{ $t("Channel.Playlists.Playlists").toUpperCase() }}
+
+
+
{{ $t("Global.Videos").toUpperCase() }}
+
{{ $t("Global.Shorts").toUpperCase() }}
+
+
{{ $t("Trending.Default").toUpperCase() }}
+
{{ $t("Trending.Music").toUpperCase() }}
+
{{ $t("Trending.Gaming").toUpperCase() }}
+