Skip to content

Commit c59cd7a

Browse files
committed
Improve MCP server manager and card UI
1 parent 3794994 commit c59cd7a

File tree

2 files changed

+36
-14
lines changed

2 files changed

+36
-14
lines changed

src/lib/components/mcp/MCPServerManager.svelte

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import IconAddLarge from "~icons/carbon/add-large";
1414
import IconRefresh from "~icons/carbon/renew";
1515
import IconTools from "~icons/carbon/tools";
16-
// Warning moved into AddServerForm to appear after headers
1716
1817
interface Props {
1918
onclose: () => void;
@@ -42,11 +41,11 @@
4241
}
4342
</script>
4443

45-
<Modal width="w-[600px]" {onclose} closeButton>
44+
<Modal width={currentView === "list" ? "w-[800px]" : "w-[600px]"} {onclose} closeButton>
4645
<div class="p-6">
4746
<!-- Header -->
4847
<div class="mb-6">
49-
<h2 class="mb-2 text-xl font-semibold text-gray-900 dark:text-gray-200">
48+
<h2 class="mb-1 text-xl font-semibold text-gray-900 dark:text-gray-200">
5049
{#if currentView === "list"}
5150
MCP Servers
5251
{:else}
@@ -55,7 +54,7 @@
5554
</h2>
5655
<p class="text-sm text-gray-600 dark:text-gray-400">
5756
{#if currentView === "list"}
58-
Manage MCP servers to extend your assistant with external tools.
57+
Manage MCP servers to extend HuggingChat with external tools.
5958
{:else}
6059
Add a custom MCP server to the application
6160
{/if}
@@ -65,10 +64,33 @@
6564
<!-- Content -->
6665
{#if currentView === "list"}
6766
<div
68-
class="mb-6 flex items-center justify-between rounded-lg bg-blue-50 p-4 dark:bg-blue-900/10"
67+
class="mb-6 flex items-center justify-between rounded-lg p-4 {!enabledCount
68+
? 'bg-gray-100 dark:bg-white/5'
69+
: 'bg-blue-50 dark:bg-blue-900/10'}"
6970
>
70-
<div class="flex items-center gap-2">
71-
<IconTools class="size-5 text-blue-600 dark:text-blue-400" />
71+
<div class="flex items-center gap-3">
72+
<div
73+
class="flex size-10 items-center justify-center rounded-xl bg-blue-500/10"
74+
class:grayscale={!enabledCount}
75+
>
76+
<svg
77+
xmlns="http://www.w3.org/2000/svg"
78+
width="1em"
79+
height="1em"
80+
viewBox="0 0 24 24"
81+
class="size-8 text-blue-600 dark:text-blue-500"
82+
><!-- Icon from Huge Icons by Hugeicons - undefined --><g
83+
fill="none"
84+
stroke="currentColor"
85+
stroke-linecap="round"
86+
stroke-linejoin="round"
87+
stroke-width="1.5"
88+
><path
89+
d="m3.5 11.75l8.172-8.171a2.828 2.828 0 1 1 4 4m0 0L9.5 13.75m6.172-6.171a2.828 2.828 0 0 1 4 4l-6.965 6.964a1 1 0 0 0 0 1.414L14 21.25"
90+
/><path d="m17.5 9.75l-6.172 6.171a2.829 2.829 0 0 1-4-4L13.5 5.749" /></g
91+
></svg
92+
>
93+
</div>
7294
<div>
7395
<p class="text-sm font-medium text-gray-900 dark:text-gray-100">
7496
{$allMcpServers.length}
@@ -97,14 +119,14 @@
97119
</button>
98120
</div>
99121
</div>
100-
<div class="space-y-6">
122+
<div class="space-y-5">
101123
<!-- Base Servers -->
102124
{#if baseServers.length > 0}
103125
<div>
104126
<h3 class="mb-3 text-sm font-medium text-gray-700 dark:text-gray-300">
105127
Base Servers ({baseServers.length})
106128
</h3>
107-
<div class="space-y-3">
129+
<div class="grid grid-cols-1 gap-3 md:grid-cols-2">
108130
{#each baseServers as server (server.id)}
109131
<ServerCard {server} isSelected={$selectedServerIds.has(server.id)} />
110132
{/each}
@@ -122,7 +144,7 @@
122144
class="flex flex-col items-center justify-center rounded-lg border-2 border-dashed border-gray-300 p-8 dark:border-gray-700"
123145
>
124146
<IconTools class="mb-3 size-12 text-gray-400" />
125-
<p class="mb-2 text-sm font-medium text-gray-900 dark:text-gray-100">
147+
<p class="mb-1 text-sm font-medium text-gray-900 dark:text-gray-100">
126148
No custom servers yet
127149
</p>
128150
<p class="mb-4 text-xs text-gray-600 dark:text-gray-400">
@@ -137,7 +159,7 @@
137159
</button>
138160
</div>
139161
{:else}
140-
<div class="space-y-3">
162+
<div class="grid grid-cols-1 gap-3 md:grid-cols-2">
141163
{#each customServers as server (server.id)}
142164
<ServerCard {server} isSelected={$selectedServerIds.has(server.id)} />
143165
{/each}

src/lib/components/mcp/ServerCard.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@
9595
</script>
9696

9797
<div
98-
class="rounded-lg border transition-colors {isSelected
99-
? 'border-blue-600/20 bg-blue-50 bg-gradient-to-r from-blue-500/5 to-transparent dark:border-blue-700/60 dark:bg-blue-900/10 dark:from-blue-900/20'
100-
: 'border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-800'}"
98+
class="rounded-lg border bg-gradient-to-br transition-colors {isSelected
99+
? 'border-blue-600/20 bg-blue-50 from-blue-500/5 to-transparent dark:border-blue-700/60 dark:bg-blue-900/10 dark:from-blue-900/20'
100+
: 'border-gray-200 bg-white from-black/5 dark:border-gray-700 dark:bg-gray-800 dark:from-white/5'}"
101101
>
102102
<div class="px-4 py-3.5">
103103
<!-- Header -->

0 commit comments

Comments
 (0)