From 8fb6c8693b5486bfcb53614df3ca565112afc088 Mon Sep 17 00:00:00 2001 From: zurdi Date: Wed, 14 May 2025 00:39:04 +0000 Subject: [PATCH] feat: enhance accessibility with aria-labels and tabindex adjustments across various components --- frontend/src/components/Details/ActionBar.vue | 16 +++++- .../Gallery/AppBar/Platform/FirmwareBtn.vue | 1 + .../AppBar/Platform/PlatformInfoDrawer.vue | 29 ++++++++--- .../Gallery/AppBar/Platform/SettingsBtn.vue | 3 +- .../Gallery/AppBar/common/CharIndexBar.vue | 1 + .../Gallery/AppBar/common/FilterBtn.vue | 1 + .../AppBar/common/FilterDrawer/Base.vue | 51 +++++++++++++++---- .../Gallery/AppBar/common/FilterTextField.vue | 1 - .../Gallery/AppBar/common/GalleryViewBtn.vue | 1 + .../Gallery/AppBar/common/SelectingBtn.vue | 1 + frontend/src/components/Home/Collections.vue | 6 ++- .../src/components/Home/ContinuePlaying.vue | 6 ++- frontend/src/components/Home/Platforms.vue | 6 ++- frontend/src/components/Home/RecentAdded.vue | 6 ++- .../components/common/Game/Card/ActionBar.vue | 5 ++ .../src/components/common/Game/Card/Base.vue | 3 +- .../common/Navigation/CollectionsDrawer.vue | 26 +++++----- .../common/Navigation/PlatformsDrawer.vue | 20 ++++---- .../common/Navigation/SettingsDrawer.vue | 41 ++++++++------- .../components/common/Navigation/UserBtn.vue | 1 + 20 files changed, 155 insertions(+), 70 deletions(-) diff --git a/frontend/src/components/Details/ActionBar.vue b/frontend/src/components/Details/ActionBar.vue index ad2782659..2e1d085b2 100644 --- a/frontend/src/components/Details/ActionBar.vue +++ b/frontend/src/components/Details/ActionBar.vue @@ -79,6 +79,7 @@ async function copyDownloadLink(rom: DetailedRom) { fileIDs: downloadStore.fileIDsToDownload, }) " + :aria-label="`Download ${rom.name}`" > - + @@ -120,6 +126,7 @@ async function copyDownloadLink(rom: DetailedRom) { params: { rom: rom?.id }, }) " + :aria-label="`Play ${rom.name}`" > @@ -127,6 +134,7 @@ async function copyDownloadLink(rom: DetailedRom) { v-if="is3DSRom" class="flex-grow-1" @click="emitter?.emit('showQRCodeDialog', rom)" + :aria-label="`Show ${rom.name} QR code`" > @@ -139,7 +147,11 @@ async function copyDownloadLink(rom: DetailedRom) { location="bottom" > diff --git a/frontend/src/components/Gallery/AppBar/Platform/FirmwareBtn.vue b/frontend/src/components/Gallery/AppBar/Platform/FirmwareBtn.vue index b0af82457..a2a2dbaee 100644 --- a/frontend/src/components/Gallery/AppBar/Platform/FirmwareBtn.vue +++ b/frontend/src/components/Gallery/AppBar/Platform/FirmwareBtn.vue @@ -25,6 +25,7 @@ const { activeFirmwareDrawer } = storeToRefs(galleryViewStore); v-bind="props" icon="mdi-memory" :color="activeFirmwareDrawer ? 'primary' : ''" + aria-label="Firmwares" @click="galleryViewStore.switchActiveFirmwareDrawer()" /> diff --git a/frontend/src/components/Gallery/AppBar/Platform/PlatformInfoDrawer.vue b/frontend/src/components/Gallery/AppBar/Platform/PlatformInfoDrawer.vue index 0123caee0..473bc32b9 100644 --- a/frontend/src/components/Gallery/AppBar/Platform/PlatformInfoDrawer.vue +++ b/frontend/src/components/Gallery/AppBar/Platform/PlatformInfoDrawer.vue @@ -56,6 +56,7 @@ const aspectRatioOptions = computed(() => [ source: t("platform.old-horizontal-cases"), }, ]); +const tabIndex = computed(() => (activePlatformInfoDrawer.value ? 0 : -1)); const PLATFORM_INFO_FIELDS: { key: keyof Platform; @@ -208,6 +209,7 @@ watch( class="bg-toplayer" @click="showEditable" size="small" + :tabindex="tabIndex" > - + { @update:model-value="nextTick(() => emitter?.emit('filter', null))" /> - - + + {{ t("platform.reset-filters") }} diff --git a/frontend/src/components/Gallery/AppBar/common/FilterTextField.vue b/frontend/src/components/Gallery/AppBar/common/FilterTextField.vue index babbd14bc..995626bd7 100644 --- a/frontend/src/components/Gallery/AppBar/common/FilterTextField.vue +++ b/frontend/src/components/Gallery/AppBar/common/FilterTextField.vue @@ -54,7 +54,6 @@ watch( diff --git a/frontend/src/components/Gallery/AppBar/common/SelectingBtn.vue b/frontend/src/components/Gallery/AppBar/common/SelectingBtn.vue index b41833691..2619ca4aa 100644 --- a/frontend/src/components/Gallery/AppBar/common/SelectingBtn.vue +++ b/frontend/src/components/Gallery/AppBar/common/SelectingBtn.vue @@ -23,6 +23,7 @@ const romsStore = storeRoms(); v-bind="props" class="mr-0" icon="mdi-select-group" + aria-label="Multi select" @click="romsStore.setSelecting()" /> diff --git a/frontend/src/components/Home/Collections.vue b/frontend/src/components/Home/Collections.vue index 0f1d7a0ea..8a0047a8c 100644 --- a/frontend/src/components/Home/Collections.vue +++ b/frontend/src/components/Home/Collections.vue @@ -25,7 +25,11 @@ function toggleGridCollections() {