fix(a11y): add descriptive alt text to images with empty alt attributes

This commit is contained in:
Vincent Agra 2026-05-03 13:13:40 -03:00
parent 4e2240aada
commit 78076b9100
5 changed files with 7 additions and 7 deletions

View file

@ -92,7 +92,7 @@
<img
src={image || `${WEBUI_BASE_URL}/static/favicon.png`}
class="rounded-full size-8 object-cover flex-shrink-0"
alt=""
alt={name}
/>
<div class="flex-1 text-left min-w-0">
<div class="font-medium text-gray-900 dark:text-white truncate">
@ -126,7 +126,7 @@
<img
src={image || `${WEBUI_BASE_URL}/static/favicon.png`}
class="size-8 object-cover"
alt=""
alt={name}
/>
</button>
<div class="flex-1">

View file

@ -213,7 +213,7 @@
: `${WEBUI_API_BASE_URL}/files/${file.url}${file?.content_type ? '/content' : ''}`}
<div class={($settings?.chatBubble ?? true) ? 'self-end' : ''}>
{#if file.type === 'image' || (file?.content_type ?? '').startsWith('image/')}
<Image src={fileUrl} imageClassName=" max-h-96 rounded-lg" />
<Image src={fileUrl} alt={$i18n.t('Uploaded image')} imageClassName=" max-h-96 rounded-lg" />
{:else}
<FileItem
item={file}

View file

@ -247,7 +247,7 @@
<img
src={`${WEBUI_API_BASE_URL}/users/${$user?.id}/profile/image`}
class="size-6 object-cover rounded-full"
alt=""
alt={$user?.name ? $i18n.t("{{name}}'s avatar", { name: $user.name }) : ""}
draggable="false"
/>
</div>

View file

@ -140,7 +140,7 @@
>
<img
src={image.url}
alt=""
alt={$i18n.t('Generated image')}
class="w-full aspect-square object-cover rounded-lg border border-gray-100/30 dark:border-gray-850/30"
/>
<div
@ -184,7 +184,7 @@
{#each sourceImages as image, index}
<div class=" relative group">
<div class="relative flex items-center">
<img src={image} alt="" class="size-10 rounded-xl object-cover" />
<img src={image} alt={$i18n.t('Source image')} class="size-10 rounded-xl object-cover" />
</div>
<div class=" absolute -top-1 -right-1">
<button

View file

@ -595,7 +595,7 @@
crossorigin="anonymous"
src="{WEBUI_BASE_URL}/static/favicon.png"
class=" w-6 rounded-full"
alt=""
alt="Open WebUI logo"
/>
</div>
</div>