|
203 | 203 | // Show file upload when any mime is allowed (text always; images if multimodal) |
204 | 204 | let showFileUpload = $derived(mimeTypes.length > 0); |
205 | 205 | let showNoTools = $derived(!showFileUpload); |
| 206 | + let selectedServers = $derived( |
| 207 | + $allMcpServers.filter((server) => $selectedServerIds.has(server.id)) |
| 208 | + ); |
206 | 209 | </script> |
207 | 210 |
|
208 | 211 | <div class="flex min-h-full flex-1 flex-col" onpaste={onPaste}> |
|
382 | 385 |
|
383 | 386 | {#if $enabledServersCount > 0} |
384 | 387 | <div |
385 | | - class="ml-2 inline-flex h-7 items-center gap-1.5 rounded-full border border-blue-500/10 bg-blue-600/10 pl-3 pr-1 text-xs font-semibold text-blue-700 dark:bg-blue-600/20 dark:text-blue-400" |
| 388 | + class="ml-2 inline-flex h-7 items-center gap-1.5 rounded-full border border-blue-500/10 bg-blue-600/10 pl-2 pr-1 text-xs font-semibold text-blue-700 dark:bg-blue-600/20 dark:text-blue-400" |
386 | 389 | class:grayscale={!modelSupportsTools} |
387 | 390 | class:opacity-60={!modelSupportsTools} |
388 | 391 | class:cursor-help={!modelSupportsTools} |
|
391 | 394 | : "Current model doesn’t support tools"} |
392 | 395 | > |
393 | 396 | <button |
394 | | - class="cursor-pointer select-none bg-transparent p-0 leading-none text-current focus:outline-none" |
| 397 | + class="inline-flex cursor-pointer select-none items-center gap-1 bg-transparent p-0 leading-none text-current focus:outline-none" |
395 | 398 | type="button" |
396 | 399 | title="Manage MCP Servers" |
397 | 400 | onclick={() => (isMcpManagerOpen = true)} |
398 | 401 | class:line-through={!modelSupportsTools} |
399 | 402 | > |
| 403 | + {#if selectedServers.length} |
| 404 | + <span class="flex items-center -space-x-1"> |
| 405 | + {#each selectedServers.slice(0, 3) as server (server.id)} |
| 406 | + <img |
| 407 | + src={getMcpServerFaviconUrl(server.url)} |
| 408 | + alt="" |
| 409 | + class="size-4 rounded bg-white p-px shadow-sm ring-1 ring-black/5 dark:bg-gray-900 dark:ring-white/10" |
| 410 | + /> |
| 411 | + {/each} |
| 412 | + {#if selectedServers.length > 3} |
| 413 | + <span class="ml-1 text-[10px] font-semibold text-blue-800 dark:text-blue-200"> |
| 414 | + +{selectedServers.length - 3} |
| 415 | + </span> |
| 416 | + {/if} |
| 417 | + </span> |
| 418 | + {/if} |
400 | 419 | MCP ({$enabledServersCount}) |
401 | 420 | </button> |
402 | 421 | <button |
|
0 commit comments