generated from nhcarrigan/template
chore: clean up build warnings in frontend components
- Remove unused .animate-spin CSS from PluginManagementPanel and McpManagementPanel - Replace deprecated <svelte:component> with Svelte 5 dynamic component syntax - Add for/id associations to MCP add-server form labels - Change display-only <label> elements in MCP details panel to <p> - Add missing a11y_click_events_have_key_events suppression to overlay divs - Add onwarn filter to svelte.config.js for intentional patterns
This commit is contained in:
@@ -190,10 +190,13 @@
|
|||||||
<h3 class="text-sm font-medium text-[var(--text-primary)] mb-3">Add MCP Server</h3>
|
<h3 class="text-sm font-medium text-[var(--text-primary)] mb-3">Add MCP Server</h3>
|
||||||
<div class="space-y-3">
|
<div class="space-y-3">
|
||||||
<div>
|
<div>
|
||||||
<label class="text-xs text-[var(--text-secondary)] uppercase tracking-wider block mb-1"
|
<label
|
||||||
|
for="mcp-new-name"
|
||||||
|
class="text-xs text-[var(--text-secondary)] uppercase tracking-wider block mb-1"
|
||||||
>Server Name</label
|
>Server Name</label
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
|
id="mcp-new-name"
|
||||||
type="text"
|
type="text"
|
||||||
bind:value={newServerName}
|
bind:value={newServerName}
|
||||||
placeholder="my-server"
|
placeholder="my-server"
|
||||||
@@ -201,10 +204,13 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="text-xs text-[var(--text-secondary)] uppercase tracking-wider block mb-1"
|
<label
|
||||||
|
for="mcp-new-transport"
|
||||||
|
class="text-xs text-[var(--text-secondary)] uppercase tracking-wider block mb-1"
|
||||||
>Transport</label
|
>Transport</label
|
||||||
>
|
>
|
||||||
<select
|
<select
|
||||||
|
id="mcp-new-transport"
|
||||||
bind:value={newServerTransport}
|
bind:value={newServerTransport}
|
||||||
class="w-full px-3 py-2 bg-[var(--bg-primary)] border border-[var(--border-color)] rounded-lg text-[var(--text-primary)] text-sm focus:outline-none focus:border-[var(--accent-primary)]"
|
class="w-full px-3 py-2 bg-[var(--bg-primary)] border border-[var(--border-color)] rounded-lg text-[var(--text-primary)] text-sm focus:outline-none focus:border-[var(--accent-primary)]"
|
||||||
>
|
>
|
||||||
@@ -214,10 +220,14 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="text-xs text-[var(--text-secondary)] uppercase tracking-wider block mb-1">
|
<label
|
||||||
|
for="mcp-new-url"
|
||||||
|
class="text-xs text-[var(--text-secondary)] uppercase tracking-wider block mb-1"
|
||||||
|
>
|
||||||
{newServerTransport === "stdio" ? "Command" : "URL"}
|
{newServerTransport === "stdio" ? "Command" : "URL"}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
|
id="mcp-new-url"
|
||||||
type="text"
|
type="text"
|
||||||
bind:value={newServerUrl}
|
bind:value={newServerUrl}
|
||||||
placeholder={newServerTransport === "stdio"
|
placeholder={newServerTransport === "stdio"
|
||||||
@@ -266,6 +276,7 @@
|
|||||||
{:else}
|
{:else}
|
||||||
<div class="space-y-2">
|
<div class="space-y-2">
|
||||||
{#each servers as server (server.name)}
|
{#each servers as server (server.name)}
|
||||||
|
{@const TransportIcon = getTransportIcon(server.transport)}
|
||||||
<button
|
<button
|
||||||
onclick={() => loadServerDetails(server.name)}
|
onclick={() => loadServerDetails(server.name)}
|
||||||
class="w-full bg-[var(--bg-secondary)]/50 rounded-lg p-3 border border-[var(--border-color)] hover:border-[var(--accent-primary)]/50 transition-all text-left"
|
class="w-full bg-[var(--bg-secondary)]/50 rounded-lg p-3 border border-[var(--border-color)] hover:border-[var(--accent-primary)]/50 transition-all text-left"
|
||||||
@@ -274,10 +285,7 @@
|
|||||||
<div class="flex items-start justify-between">
|
<div class="flex items-start justify-between">
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<h4 class="font-medium text-[var(--text-primary)] flex items-center gap-2">
|
<h4 class="font-medium text-[var(--text-primary)] flex items-center gap-2">
|
||||||
<svelte:component
|
<TransportIcon class="w-4 h-4 {getTransportColor(server.transport)}" />
|
||||||
this={getTransportIcon(server.transport)}
|
|
||||||
class="w-4 h-4 {getTransportColor(server.transport)}"
|
|
||||||
/>
|
|
||||||
{server.name}
|
{server.name}
|
||||||
{#if server.status}
|
{#if server.status}
|
||||||
{#if server.status.includes("Connected")}
|
{#if server.status.includes("Connected")}
|
||||||
@@ -323,25 +331,19 @@
|
|||||||
<RefreshCw class="w-6 h-6 animate-spin text-[var(--text-secondary)]" />
|
<RefreshCw class="w-6 h-6 animate-spin text-[var(--text-secondary)]" />
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
|
{@const TransportIcon = getTransportIcon(selectedServer.transport)}
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
<!-- Name -->
|
<!-- Name -->
|
||||||
<div>
|
<div>
|
||||||
<label class="text-xs text-[var(--text-secondary)] uppercase tracking-wider"
|
<p class="text-xs text-[var(--text-secondary)] uppercase tracking-wider">Name</p>
|
||||||
>Name</label
|
|
||||||
>
|
|
||||||
<p class="text-sm text-[var(--text-primary)] mt-1">{selectedServer.name}</p>
|
<p class="text-sm text-[var(--text-primary)] mt-1">{selectedServer.name}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Transport -->
|
<!-- Transport -->
|
||||||
<div>
|
<div>
|
||||||
<label class="text-xs text-[var(--text-secondary)] uppercase tracking-wider"
|
<p class="text-xs text-[var(--text-secondary)] uppercase tracking-wider">Transport</p>
|
||||||
>Transport</label
|
|
||||||
>
|
|
||||||
<p class="text-sm text-[var(--text-primary)] mt-1 flex items-center gap-2">
|
<p class="text-sm text-[var(--text-primary)] mt-1 flex items-center gap-2">
|
||||||
<svelte:component
|
<TransportIcon class="w-4 h-4 {getTransportColor(selectedServer.transport)}" />
|
||||||
this={getTransportIcon(selectedServer.transport)}
|
|
||||||
class="w-4 h-4 {getTransportColor(selectedServer.transport)}"
|
|
||||||
/>
|
|
||||||
{selectedServer.transport.toUpperCase()}
|
{selectedServer.transport.toUpperCase()}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -349,9 +351,7 @@
|
|||||||
<!-- URL or Command -->
|
<!-- URL or Command -->
|
||||||
{#if selectedServer.url}
|
{#if selectedServer.url}
|
||||||
<div>
|
<div>
|
||||||
<label class="text-xs text-[var(--text-secondary)] uppercase tracking-wider"
|
<p class="text-xs text-[var(--text-secondary)] uppercase tracking-wider">URL</p>
|
||||||
>URL</label
|
|
||||||
>
|
|
||||||
<p
|
<p
|
||||||
class="text-sm text-[var(--text-primary)] mt-1 break-all font-mono bg-[var(--bg-primary)] p-2 rounded border border-[var(--border-color)]"
|
class="text-sm text-[var(--text-primary)] mt-1 break-all font-mono bg-[var(--bg-primary)] p-2 rounded border border-[var(--border-color)]"
|
||||||
>
|
>
|
||||||
@@ -362,9 +362,7 @@
|
|||||||
|
|
||||||
{#if selectedServer.command}
|
{#if selectedServer.command}
|
||||||
<div>
|
<div>
|
||||||
<label class="text-xs text-[var(--text-secondary)] uppercase tracking-wider"
|
<p class="text-xs text-[var(--text-secondary)] uppercase tracking-wider">Command</p>
|
||||||
>Command</label
|
|
||||||
>
|
|
||||||
<p
|
<p
|
||||||
class="text-sm text-[var(--text-primary)] mt-1 font-mono bg-[var(--bg-primary)] p-2 rounded border border-[var(--border-color)]"
|
class="text-sm text-[var(--text-primary)] mt-1 font-mono bg-[var(--bg-primary)] p-2 rounded border border-[var(--border-color)]"
|
||||||
>
|
>
|
||||||
@@ -376,9 +374,9 @@
|
|||||||
<!-- Environment Variables -->
|
<!-- Environment Variables -->
|
||||||
{#if selectedServer.env}
|
{#if selectedServer.env}
|
||||||
<div>
|
<div>
|
||||||
<label class="text-xs text-[var(--text-secondary)] uppercase tracking-wider"
|
<p class="text-xs text-[var(--text-secondary)] uppercase tracking-wider">
|
||||||
>Environment</label
|
Environment
|
||||||
>
|
</p>
|
||||||
<pre
|
<pre
|
||||||
class="text-xs text-[var(--text-primary)] mt-1 font-mono bg-[var(--bg-primary)] p-2 rounded border border-[var(--border-color)] overflow-x-auto">{JSON.stringify(
|
class="text-xs text-[var(--text-primary)] mt-1 font-mono bg-[var(--bg-primary)] p-2 rounded border border-[var(--border-color)] overflow-x-auto">{JSON.stringify(
|
||||||
selectedServer.env,
|
selectedServer.env,
|
||||||
@@ -391,9 +389,9 @@
|
|||||||
<!-- Full Server Details -->
|
<!-- Full Server Details -->
|
||||||
{#if serverDetails}
|
{#if serverDetails}
|
||||||
<div>
|
<div>
|
||||||
<label class="text-xs text-[var(--text-secondary)] uppercase tracking-wider"
|
<p class="text-xs text-[var(--text-secondary)] uppercase tracking-wider">
|
||||||
>Full Details</label
|
Full Details
|
||||||
>
|
</p>
|
||||||
<pre
|
<pre
|
||||||
class="text-xs text-[var(--text-primary)] mt-1 font-mono bg-[var(--bg-primary)] p-2 rounded border border-[var(--border-color)] overflow-x-auto whitespace-pre-wrap">{serverDetails}</pre>
|
class="text-xs text-[var(--text-primary)] mt-1 font-mono bg-[var(--bg-primary)] p-2 rounded border border-[var(--border-color)] overflow-x-auto whitespace-pre-wrap">{serverDetails}</pre>
|
||||||
</div>
|
</div>
|
||||||
@@ -416,18 +414,3 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
|
||||||
@keyframes spin {
|
|
||||||
from {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.animate-spin {
|
|
||||||
animation: spin 1s linear infinite;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -430,18 +430,3 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
|
||||||
@keyframes spin {
|
|
||||||
from {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.animate-spin {
|
|
||||||
animation: spin 1s linear infinite;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -471,6 +471,7 @@
|
|||||||
tabindex="0"
|
tabindex="0"
|
||||||
onkeydown={(e) => e.key === "Escape" && (showClearAllConfirm = false)}
|
onkeydown={(e) => e.key === "Escape" && (showClearAllConfirm = false)}
|
||||||
>
|
>
|
||||||
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||||
<div
|
<div
|
||||||
class="bg-[var(--bg-primary)] border border-red-500/30 rounded-lg shadow-xl max-w-md w-full p-6"
|
class="bg-[var(--bg-primary)] border border-red-500/30 rounded-lg shadow-xl max-w-md w-full p-6"
|
||||||
onclick={(e) => e.stopPropagation()}
|
onclick={(e) => e.stopPropagation()}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
onClose();
|
onClose();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
<!-- svelte-ignore a11y_no_static_element_interactions a11y_click_events_have_key_events -->
|
||||||
<div
|
<div
|
||||||
bind:this={menuElement}
|
bind:this={menuElement}
|
||||||
class="menu-content"
|
class="menu-content"
|
||||||
|
|||||||
@@ -30,9 +30,9 @@
|
|||||||
|
|
||||||
<svelte:window onkeydown={handleKeydown} />
|
<svelte:window onkeydown={handleKeydown} />
|
||||||
|
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
<!-- svelte-ignore a11y_no_static_element_interactions a11y_click_events_have_key_events -->
|
||||||
<div class="dialog-overlay" onclick={onCancel}>
|
<div class="dialog-overlay" onclick={onCancel}>
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
<!-- svelte-ignore a11y_no_static_element_interactions a11y_click_events_have_key_events -->
|
||||||
<div class="dialog-content" onclick={(e) => e.stopPropagation()}>
|
<div class="dialog-content" onclick={(e) => e.stopPropagation()}>
|
||||||
<h2 class="dialog-title">{title}</h2>
|
<h2 class="dialog-title">{title}</h2>
|
||||||
<p class="dialog-message">{message}</p>
|
<p class="dialog-message">{message}</p>
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
onClose();
|
onClose();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
<!-- svelte-ignore a11y_no_static_element_interactions a11y_click_events_have_key_events -->
|
||||||
<div
|
<div
|
||||||
bind:this={menuElement}
|
bind:this={menuElement}
|
||||||
class="menu-content"
|
class="menu-content"
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
|
|
||||||
<svelte:window onkeydown={handleKeydown} />
|
<svelte:window onkeydown={handleKeydown} />
|
||||||
|
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
<!-- svelte-ignore a11y_no_static_element_interactions a11y_click_events_have_key_events -->
|
||||||
<div
|
<div
|
||||||
class="menu-overlay"
|
class="menu-overlay"
|
||||||
onclick={onClose}
|
onclick={onClose}
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
onClose();
|
onClose();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
<!-- svelte-ignore a11y_no_static_element_interactions a11y_click_events_have_key_events -->
|
||||||
<div
|
<div
|
||||||
bind:this={menuElement}
|
bind:this={menuElement}
|
||||||
class="menu-content"
|
class="menu-content"
|
||||||
|
|||||||
@@ -50,9 +50,9 @@
|
|||||||
|
|
||||||
<svelte:window onkeydown={handleKeydown} />
|
<svelte:window onkeydown={handleKeydown} />
|
||||||
|
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
<!-- svelte-ignore a11y_no_static_element_interactions a11y_click_events_have_key_events -->
|
||||||
<div class="dialog-overlay" onclick={onCancel}>
|
<div class="dialog-overlay" onclick={onCancel}>
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
<!-- svelte-ignore a11y_no_static_element_interactions a11y_click_events_have_key_events -->
|
||||||
<div class="dialog-content" onclick={(e) => e.stopPropagation()}>
|
<div class="dialog-content" onclick={(e) => e.stopPropagation()}>
|
||||||
<h2 class="dialog-title">{title}</h2>
|
<h2 class="dialog-title">{title}</h2>
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,17 @@ import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
|||||||
/** @type {import('@sveltejs/kit').Config} */
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
const config = {
|
const config = {
|
||||||
preprocess: vitePreprocess(),
|
preprocess: vitePreprocess(),
|
||||||
|
// Suppress specific build-time warnings that are intentional patterns:
|
||||||
|
// - a11y_click_events_have_key_events: all overlay/context-menu divs use svelte:window handlers
|
||||||
|
// - state_referenced_locally: InputDialog intentionally captures the initial prop value
|
||||||
|
onwarn: (warning, handler) => {
|
||||||
|
if (
|
||||||
|
warning.code === "a11y_click_events_have_key_events" ||
|
||||||
|
warning.code === "state_referenced_locally"
|
||||||
|
)
|
||||||
|
return;
|
||||||
|
handler(warning);
|
||||||
|
},
|
||||||
kit: {
|
kit: {
|
||||||
adapter: adapter({
|
adapter: adapter({
|
||||||
fallback: "index.html",
|
fallback: "index.html",
|
||||||
|
|||||||
Reference in New Issue
Block a user