Skip to content

Commit 6ae3ddd

Browse files
authored
fix: truncate long model names and IDs in UI (open-webui#20696)
- Added line-clamp-1 truncation and tooltips to long model names and IDs in the Evaluations and Models admin sections to prevent visual overflow. Model names now display truncated with full name and ID available on hover.
1 parent 98cb2d3 commit 6ae3ddd

4 files changed

Lines changed: 16 additions & 9 deletions

File tree

src/lib/components/admin/Evaluations/Feedbacks.svelte

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,11 @@
302302
<div class="flex flex-col items-start gap-0.5 h-full">
303303
<div class="flex flex-col h-full">
304304
{#if feedback.data?.sibling_model_ids}
305-
<div class="font-medium text-gray-600 dark:text-gray-400 flex-1">
305+
<Tooltip content={feedback.data?.model_id} placement="top-start">
306+
<div class="font-medium text-gray-600 dark:text-gray-400 flex-1 line-clamp-1">
306307
{feedback.data?.model_id}
307308
</div>
309+
</Tooltip>
308310

309311
<Tooltip content={feedback.data.sibling_model_ids.join(', ')}>
310312
<div class=" text-[0.65rem] text-gray-600 dark:text-gray-400 line-clamp-1">
@@ -320,11 +322,11 @@
320322
</div>
321323
</Tooltip>
322324
{:else}
323-
<div
324-
class=" text-sm font-medium text-gray-600 dark:text-gray-400 flex-1 py-1.5"
325-
>
325+
<Tooltip content={feedback.data?.model_id} placement="top-start">
326+
<div class="text-sm font-medium text-gray-600 dark:text-gray-400 flex-1 py-1.5 line-clamp-1">
326327
{feedback.data?.model_id}
327328
</div>
329+
</Tooltip>
328330
{/if}
329331
</div>
330332
</div>

src/lib/components/admin/Evaluations/Leaderboard.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@
182182
alt={model.name}
183183
class="size-5 rounded-full object-cover"
184184
/>
185-
<span class="font-medium text-gray-800 dark:text-gray-200">{model.name}</span>
185+
<Tooltip content={`${model.name} (${model.id})`} placement="top-start">
186+
<span class="font-medium text-gray-800 dark:text-gray-200 line-clamp-1">{model.name}</span>
187+
</Tooltip>
186188
</div>
187189
</td>
188190
<td class="px-3 py-1.5 text-right font-medium text-gray-900 dark:text-white">

src/lib/components/admin/Evaluations/LeaderboardModal.svelte

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import { getModelHistory } from '$lib/apis/evaluations';
55
import ModelActivityChart from './ModelActivityChart.svelte';
66
import XMark from '$lib/components/icons/XMark.svelte';
7+
import Tooltip from '$lib/components/common/Tooltip.svelte';
78
89
export let show = false;
910
export let model = null;
@@ -60,9 +61,11 @@
6061
<Modal size="md" bind:show>
6162
{#if model}
6263
<div class="flex justify-between dark:text-gray-300 px-5 pt-4 pb-2">
63-
<div class="text-lg font-medium self-center">
64-
{model.name}
65-
</div>
64+
<Tooltip content={`${model.name} (${model.id})`} placement="top-start">
65+
<div class="text-lg font-medium self-center line-clamp-1">
66+
{model.name}
67+
</div>
68+
</Tooltip>
6669
<button class="self-center" on:click={close} aria-label="Close">
6770
<XMark className={'size-5'} />
6871
</button>

src/lib/components/admin/Settings/Models/ModelList.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<div class="flex items-center gap-1">
5151
<EllipsisVertical className="size-4 cursor-move model-item-handle" />
5252

53-
<div class=" text-sm flex-1 py-1 rounded-lg">
53+
<div class=" text-sm flex-1 py-1 rounded-lg line-clamp-1">
5454
{#if $models.find((model) => model.id === modelId)}
5555
{$models.find((model) => model.id === modelId).name}
5656
{:else}

0 commit comments

Comments
 (0)