fix(ui): prevent avatar alt-text overlap on failed image loads (#21730)

This commit is contained in:
G30
2026-02-22 15:24:16 -05:00
committed by GitHub
parent f95cff0895
commit 713fe1afa7
3 changed files with 14 additions and 2 deletions

View File

@@ -349,6 +349,9 @@
src="{WEBUI_API_BASE_URL}/models/model/profile/image?id={model.model_id}"
alt={model.name}
class="size-5 rounded-full object-cover shrink-0"
on:error={(e) => {
e.target.src = '/favicon.png';
}}
/>
<span class="truncate max-w-[150px]">{model.name}</span>
</div>
@@ -435,6 +438,9 @@
src="{WEBUI_API_BASE_URL}/users/{user.user_id}/profile/image"
alt={user.name || 'User'}
class="size-5 rounded-full object-cover shrink-0"
on:error={(e) => {
e.target.src = '/user.png';
}}
/>
<span class="truncate max-w-[150px]"
>{user.name || user.email || user.user_id.substring(0, 8)}</span

View File

@@ -130,7 +130,10 @@
<img
src="{WEBUI_API_BASE_URL}/models/model/profile/image?id={model.model_id}"
alt={model.name}
class="size-5 rounded-full object-cover"
class="size-5 rounded-full object-cover shrink-0"
on:error={(e) => {
e.target.src = '/favicon.png';
}}
/>
<span class="font-medium text-gray-800 dark:text-gray-200">{model.name}</span>
</div>

View File

@@ -180,7 +180,10 @@
<img
src="{WEBUI_API_BASE_URL}/models/model/profile/image?id={model.id}"
alt={model.name}
class="size-5 rounded-full object-cover"
class="size-5 rounded-full object-cover shrink-0"
on:error={(e) => {
e.target.src = '/favicon.png';
}}
/>
<Tooltip content={`${model.name} (${model.id})`} placement="top-start">
<span class="font-medium text-gray-800 dark:text-gray-200 line-clamp-1"