Pārlūkot izejas kodu

Merge pull request #17791 from silentoplayz/truncate-models-tag

Fix: truncate long model tags with a 32 characters limit
Tim Jaeryang Baek 2 nedēļas atpakaļ
vecāks
revīzija
a97cdc0da0
1 mainītis faili ar 12 papildinājumiem un 10 dzēšanām
  1. 12 10
      src/lib/components/workspace/Models.svelte

+ 12 - 10
src/lib/components/workspace/Models.svelte

@@ -305,16 +305,18 @@
 				</button>
 
 				{#each tags as tag}
-					<button
-						class="min-w-fit outline-none p-1.5 {selectedTag === tag
-							? ''
-							: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition capitalize"
-						on:click={() => {
-							selectedTag = tag;
-						}}
-					>
-						{tag}
-					</button>
+					<Tooltip content={tag}>
+						<button
+							class="min-w-fit outline-none p-1.5 {selectedTag === tag
+								? ''
+								: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition capitalize"
+							on:click={() => {
+								selectedTag = tag;
+							}}
+						>
+							{tag.length > 32 ? `${tag.slice(0, 32)}...` : tag}
+						</button>
+					</Tooltip>
 				{/each}
 			</div>
 		</div>