feat: Always show Mcp Selector
This commit is contained in:
parent
4c095df509
commit
bc07e0723d
|
|
@ -5,16 +5,13 @@
|
|||
import * as Tooltip from '$lib/components/ui/tooltip';
|
||||
import { FILE_TYPE_ICONS } from '$lib/constants/icons';
|
||||
import { FileTypeCategory } from '$lib/enums';
|
||||
import McpLogo from '$lib/components/app/misc/McpLogo.svelte';
|
||||
|
||||
interface Props {
|
||||
class?: string;
|
||||
disabled?: boolean;
|
||||
hasAudioModality?: boolean;
|
||||
hasVisionModality?: boolean;
|
||||
showMcpOption?: boolean;
|
||||
onFileUpload?: (fileType?: FileTypeCategory) => void;
|
||||
onMcpClick?: () => void;
|
||||
onSystemPromptClick?: () => void;
|
||||
}
|
||||
|
||||
|
|
@ -23,13 +20,11 @@
|
|||
disabled = false,
|
||||
hasAudioModality = false,
|
||||
hasVisionModality = false,
|
||||
showMcpOption = false,
|
||||
onFileUpload,
|
||||
onMcpClick,
|
||||
onSystemPromptClick
|
||||
}: Props = $props();
|
||||
|
||||
const fileUploadTooltipText = 'Add files or MCP servers';
|
||||
const fileUploadTooltipText = 'Add files';
|
||||
|
||||
function handleFileUpload(fileType?: FileTypeCategory) {
|
||||
onFileUpload?.(fileType);
|
||||
|
|
@ -127,18 +122,6 @@
|
|||
{/if}
|
||||
</Tooltip.Root>
|
||||
|
||||
{#if showMcpOption}
|
||||
<DropdownMenu.Separator />
|
||||
<DropdownMenu.Item
|
||||
class="flex cursor-pointer items-center gap-2"
|
||||
onclick={() => onMcpClick?.()}
|
||||
>
|
||||
<McpLogo style="width: 1rem; height: 1rem;" />
|
||||
|
||||
<span>MCP Servers</span>
|
||||
</DropdownMenu.Item>
|
||||
{/if}
|
||||
|
||||
<DropdownMenu.Separator />
|
||||
<Tooltip.Root>
|
||||
<Tooltip.Trigger class="w-full">
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
import { chatStore } from '$lib/stores/chat.svelte';
|
||||
import { activeMessages, usedModalities } from '$lib/stores/conversations.svelte';
|
||||
import { useModelChangeValidation } from '$lib/hooks/use-model-change-validation.svelte';
|
||||
import { parseMcpServerSettings } from '$lib/config/mcp';
|
||||
|
||||
interface Props {
|
||||
canSend?: boolean;
|
||||
|
|
@ -168,10 +167,6 @@
|
|||
});
|
||||
|
||||
let showMcpDialog = $state(false);
|
||||
|
||||
// MCP servers state (simplified - just need to check if any exist)
|
||||
let mcpServers = $derived(parseMcpServerSettings(currentConfig.mcpServers));
|
||||
let hasMcpServers = $derived(mcpServers.length > 0);
|
||||
</script>
|
||||
|
||||
<div class="flex w-full items-center gap-3 {className}" style="container-type: inline-size">
|
||||
|
|
@ -180,15 +175,11 @@
|
|||
{disabled}
|
||||
{hasAudioModality}
|
||||
{hasVisionModality}
|
||||
showMcpOption={!hasMcpServers}
|
||||
onMcpClick={() => (showMcpDialog = true)}
|
||||
{onFileUpload}
|
||||
{onSystemPromptClick}
|
||||
/>
|
||||
|
||||
{#if hasMcpServers}
|
||||
<McpSelector {disabled} onSettingsClick={() => (showMcpDialog = true)} />
|
||||
{/if}
|
||||
<McpSelector {disabled} onSettingsClick={() => (showMcpDialog = true)} />
|
||||
</div>
|
||||
|
||||
<div class="ml-auto flex items-center gap-1.5">
|
||||
|
|
|
|||
Loading…
Reference in New Issue