refactor: Cleanup

This commit is contained in:
Aleksander Grygier 2026-01-25 00:03:01 +01:00
parent ba230c5cce
commit 372202632e
10 changed files with 13 additions and 31 deletions

Binary file not shown.

View File

@ -1,10 +1,10 @@
<script lang="ts">
import {
AgenticContent,
ModelBadge,
ChatMessageAgenticContent,
ChatMessageActions,
ChatMessageStatistics,
MarkdownContent,
ModelBadge,
ModelsSelector
} from '$lib/components/app';
import { useProcessingState } from '$lib/hooks/use-processing-state.svelte';
@ -173,7 +173,11 @@
{#if showRawOutput}
<pre class="raw-output">{messageContent || ''}</pre>
{:else if isStructuredContent}
<AgenticContent content={messageContent || ''} isStreaming={isChatStreaming()} {message} />
<ChatMessageAgenticContent
content={messageContent || ''}
isStreaming={isChatStreaming()}
{message}
/>
{:else}
<MarkdownContent content={messageContent || ''} {message} />
{/if}

View File

@ -17,9 +17,9 @@ export { default as ChatFormHelperText } from './chat/ChatForm/ChatFormHelperTex
export { default as ChatFormPromptPicker } from './chat/ChatForm/ChatFormPromptPicker.svelte';
export { default as ChatFormTextarea } from './chat/ChatForm/ChatFormTextarea.svelte';
export { default as AgenticContent } from './chat/ChatMessages/AgenticContent.svelte';
export { default as ChatMessage } from './chat/ChatMessages/ChatMessage.svelte';
export { default as ChatMessageActions } from './chat/ChatMessages/ChatMessageActions.svelte';
export { default as ChatMessageAgenticContent } from './chat/ChatMessages/ChatMessageAgenticContent.svelte';
export { default as ChatMessageBranchingControls } from './chat/ChatMessages/ChatMessageBranchingControls.svelte';
export { default as ChatMessageStatistics } from './chat/ChatMessages/ChatMessageStatistics.svelte';
export { default as ChatMessageMcpPrompt } from './chat/ChatMessages/ChatMessageMcpPrompt.svelte';

View File

@ -22,10 +22,8 @@
id = 'server'
}: Props = $props();
// Local state for header pairs
let headerPairs = $derived<KeyValuePair[]>(parseHeadersToArray(headers));
// Sync header pairs to parent when they change
function updateHeaderPairs(newPairs: KeyValuePair[]) {
headerPairs = newPairs;
onHeadersChange(serializeHeaders(newPairs));

View File

@ -8,20 +8,16 @@
import { McpServerCard } from '$lib/components/app/mcp/McpServerCard';
import McpServerForm from './McpServerForm.svelte';
import { Skeleton } from '$lib/components/ui/skeleton';
// Use store methods for consistent sorting logic
let servers = $derived(mcpStore.getServersSorted());
// New server form state
let isAddingServer = $state(false);
let newServerUrl = $state('');
let newServerHeaders = $state('');
// Validation for new server URL
let newServerUrlError = $derived.by(() => {
if (!newServerUrl.trim()) return 'URL is required';
try {
new URL(newServerUrl);
return null;
} catch {
return 'Invalid URL format';

View File

@ -51,7 +51,6 @@
const themeStyleId = `highlight-theme-${(window.idxThemeStyle = (window.idxThemeStyle ?? 0) + 1)}`;
let processor = $derived(() => {
// Force reactivity on message changes
void message;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let proc: any = remark().use(remarkGfm); // GitHub Flavored Markdown

View File

@ -5,33 +5,19 @@
import { SearchInput } from '$lib/components/app';
interface Props {
/** Controlled open state */
open?: boolean;
/** Callback when open state changes */
onOpenChange?: (open: boolean) => void;
/** Search input placeholder */
placeholder?: string;
/** Search input value (bindable) */
searchValue?: string;
/** Callback when search value changes */
onSearchChange?: (value: string) => void;
/** Callback for search input keydown events */
onSearchKeyDown?: (event: KeyboardEvent) => void;
/** Content alignment */
align?: 'start' | 'center' | 'end';
/** Content width class */
contentClass?: string;
/** Empty state message */
emptyMessage?: string;
/** Whether to show empty state */
isEmpty?: boolean;
/** Whether the trigger is disabled */
disabled?: boolean;
/** Trigger content */
trigger: Snippet;
/** List items content */
children: Snippet;
/** Optional footer content */
footer?: Snippet;
}

View File

@ -355,8 +355,6 @@ export class ChatService {
return;
}
console.log('[ChatService] Tool call delta received:', JSON.stringify(toolCalls));
aggregatedToolCalls = ChatService.mergeToolCallDeltas(
aggregatedToolCalls,
toolCalls,
@ -371,7 +369,9 @@ export class ChatService {
const serializedToolCalls = JSON.stringify(aggregatedToolCalls);
console.log('[ChatService] Aggregated tool calls:', serializedToolCalls);
if (import.meta.env.DEV) {
console.log('[ChatService] Aggregated tool calls:', serializedToolCalls);
}
if (!serializedToolCalls) {
return;

View File

@ -1,8 +1,7 @@
import { SvelteSet } from 'svelte/reactivity';
import { ModelsService } from '$lib/services/models.service';
import { ServerModelStatus, ModelModality } from '$lib/enums';
import { ModelsService, PropsService } from '$lib/services';
import { serverStore } from '$lib/stores/server.svelte';
import { PropsService } from '$lib/services';
/**
* modelsStore - Reactive store for model management in both MODEL and ROUTER modes