Skip to content

A self-hosted media server and file management system

feat: improve screenreader usability

aminnausinfc6bec7ecc74
diff --git a/resources/js/components/cedar-ui/popover/BasePopover.vue b/resources/js/components/cedar-ui/popover/BasePopover.vue
index 6c2d0b17..119d3aa5 100644
--- a/resources/js/components/cedar-ui/popover/BasePopover.vue
+++ b/resources/js/components/cedar-ui/popover/BasePopover.vue
@@ -135,7 +135,15 @@ defineExpose({ handleClose, popoverOpen });
</script>
<template>
<div class="relative flex">
- <component :is="buttonComponent" ref="popoverButton" :class="buttonClass" @click="popoverOpen = !popoverOpen" v-bind="mergedButtonAttributes" :disabled="disabled">
+ <component
+ :is="buttonComponent"
+ ref="popoverButton"
+ aria-haspopup="menu"
+ :class="buttonClass"
+ @click="popoverOpen = !popoverOpen"
+ v-bind="mergedButtonAttributes"
+ :disabled="disabled"
+ >
<template #text>
<slot name="buttonText"> </slot>
</template>
diff --git a/resources/js/components/home/HomeActivityFeed.vue b/resources/js/components/home/HomeActivityFeed.vue
index a35348a9..3f853300 100644
--- a/resources/js/components/home/HomeActivityFeed.vue
+++ b/resources/js/components/home/HomeActivityFeed.vue
@@ -77,7 +77,7 @@ const typeIcon = (type: string) => (type === 'audio' ? ProiconsMusicNote2 : type
<LazyImage
:src="item.thumbnail"
- :alt="item.title"
+ :alt="`${item.type} Poster`"
wrapper-class="absolute inset-0 flex items-center justify-center z-1"
:class="cn('aspect-video w-full object-cover', { 'aspect-square': item.type === 'audio' })"
loading="lazy"
@@ -94,6 +94,7 @@ const typeIcon = (type: string) => (type === 'audio' ? ProiconsMusicNote2 : type
<span
v-if="item.isNew"
class="bg-primary/40 group-hover:bg-primary/60 3xl:text-[10px] absolute top-1 left-1 z-2 rounded-full px-1.5 py-0.5 text-[10px] leading-none text-white transition-colors sm:text-[8px]"
+ :aria-label="`New Update`"
>
NEW
</span>
@@ -105,6 +106,7 @@ const typeIcon = (type: string) => (type === 'audio' ? ProiconsMusicNote2 : type
</div>
<component
:is="typeIcon(item.type)"
+ :aria-label="item.type"
class="text-foreground-2 group-hover:text-foreground-0 mt-1 mb-auto hidden size-4.5 shrink-0 stroke-current stroke-1 transition-colors lg:size-3.5 @[14rem]:block"
/>
</div>
diff --git a/resources/js/components/video/VideoPreview.vue b/resources/js/components/video/VideoPreview.vue
index 2da2908b..7156b64c 100644
--- a/resources/js/components/video/VideoPreview.vue
+++ b/resources/js/components/video/VideoPreview.vue
@@ -7,6 +7,7 @@ import { computed, reactive, ref, useTemplateRef, watch } from 'vue';
import { SvgSpinners90RingWithBg } from '@/components/cedar-ui/icons';
import { buildStoryboardCues } from '@/service/storyboard';
import { toFormattedDuration } from '@/service/util';
+import { MediaType } from '@/types/types';
import { cn } from '@aminnausin/cedar-ui';
import VideoControlWrapper from '@/components/video/VideoControlWrapper.vue';
@@ -221,7 +222,10 @@ defineExpose({ hovered });
<!-- Overlay -->
<div v-if="data.duration" :class="cn('duration-input pointer-events-none absolute inset-0 z-3 flex flex-col justify-end gap-1 transition-[translate,margin]')">
<VideoControlWrapper :class="cn('ml-1 w-fit')">
- <p :class="cn('font-figtree px-1 text-white tabular-nums text-shadow-lg')">
+ <p
+ :class="cn('font-figtree px-1 text-white tabular-nums text-shadow-lg')"
+ :aria-label="`${data.metadata?.media_type === MediaType.AUDIO ? 'Track' : 'Video'} Duration ${toFormattedDuration(data.duration, false, 'verbose')}`"
+ >
{{ activeCue && hovered ? timestamp : toFormattedDuration(data.duration, false, 'digital') }}
</p>
</VideoControlWrapper>
diff --git a/resources/js/components/video/popover/VideoPopover.vue b/resources/js/components/video/popover/VideoPopover.vue
index e2d806f1..76db366a 100644
--- a/resources/js/components/video/popover/VideoPopover.vue
+++ b/resources/js/components/video/popover/VideoPopover.vue
@@ -108,6 +108,7 @@ onUnmounted(() => {
<template>
<VideoButton
ref="popoverButton"
+ aria-haspopup="menu"
v-bind="buttonAttributes"
:class="cn(buttonClass, { 'text-primary-muted dark:text-primary': popoverOpen })"
:disabled="disabled"