chore: Formatting & linting

This commit is contained in:
Aleksander Grygier 2026-02-09 02:03:19 +01:00
parent 0e31958cdc
commit d65fdde77d
6 changed files with 25 additions and 37 deletions

View File

@ -66,21 +66,9 @@
</div>
{/if}
<div class="flex justify-end mt-8 gap-2">
<Button
type="button"
size="sm"
onclick={onCancel}
variant="secondary"
>
Cancel
</Button>
<div class="mt-8 flex justify-end gap-2">
<Button type="button" size="sm" onclick={onCancel} variant="secondary">Cancel</Button>
<Button
size="sm"
type="submit"
>
Use Prompt
</Button>
<Button size="sm" type="submit">Use Prompt</Button>
</div>
</form>

View File

@ -12,7 +12,6 @@
interface Props {
onSelect?: (resource: MCPResourceInfo, shiftKey?: boolean) => void;
onToggle?: (resource: MCPResourceInfo, checked: boolean) => void;
onAttach?: (resource: MCPResourceInfo) => void;
selectedUris?: Set<string>;
expandToUri?: string;
class?: string;
@ -109,7 +108,12 @@
</script>
<div class={cn('flex flex-col gap-2', className)}>
<McpResourceBrowserHeader {isLoading} onRefresh={handleRefresh} onSearch={(q) => searchQuery = q} searchQuery={searchQuery} />
<McpResourceBrowserHeader
{isLoading}
onRefresh={handleRefresh}
onSearch={(q) => (searchQuery = q)}
{searchQuery}
/>
<div class="flex flex-col gap-1">
{#if filteredResources.size === 0}
@ -126,7 +130,7 @@
onToggleFolder={toggleFolder}
{onSelect}
{onToggle}
searchQuery={searchQuery}
{searchQuery}
/>
{/each}
{/if}

View File

@ -1,7 +1,6 @@
<script lang="ts">
import { RefreshCw, Loader2, Search } from '@lucide/svelte';
import { RefreshCw, Loader2 } from '@lucide/svelte';
import { Button } from '$lib/components/ui/button';
import { Input } from '$lib/components/ui/input';
import SearchInput from '../../forms/SearchInput.svelte';
interface Props {
@ -15,7 +14,7 @@
</script>
<div class="flex flex-col gap-2">
<div class="flex items-center gap-4 mb-2">
<div class="mb-2 flex items-center gap-4">
<SearchInput
placeholder="Search resources..."
value={searchQuery}

View File

@ -27,8 +27,7 @@ export function getDisplayName(pathPart: string): string {
function resourceMatchesSearch(resource: MCPResource, query: string): boolean {
return (
resource.title?.toLowerCase().includes(query) ||
resource.uri.toLowerCase().includes(query)
resource.title?.toLowerCase().includes(query) || resource.uri.toLowerCase().includes(query)
);
}
@ -63,11 +62,11 @@ export function buildResourceTree(
}
const query = searchQuery.toLowerCase();
// Build tree with filtering
for (const resource of resourceList) {
if (!resourceMatchesSearch(resource, query)) continue;
const pathParts = parseResourcePath(resource.uri);
let current = root;
@ -87,27 +86,27 @@ export function buildResourceTree(
isFiltered: true
});
}
// Clean up empty folders that don't match
function cleanupEmptyFolders(node: ResourceTreeNode): boolean {
if (node.resource) return true;
const toDelete: string[] = [];
for (const [name, child] of node.children.entries()) {
if (!cleanupEmptyFolders(child)) {
toDelete.push(name);
}
}
for (const name of toDelete) {
node.children.delete(name);
}
return node.children.size > 0;
}
cleanupEmptyFolders(root);
return root;
}

View File

@ -106,9 +106,7 @@
/>
<div class="flex items-center justify-end gap-2">
<Button variant="secondary" size="sm" onclick={cancelAddServer}>
Cancel
</Button>
<Button variant="secondary" size="sm" onclick={cancelAddServer}>Cancel</Button>
<Button
variant="default"

View File

@ -1037,7 +1037,7 @@ class ChatStore {
let appendedContent = '',
hasReceivedContent = false,
isReasoningOpen = hasUnclosedReasoningTag(originalContent);
const updateStreamingContent = (fullContent: string) => {
this.setChatStreaming(msg.convId, fullContent, msg.id);
conversationsStore.updateMessageAtIndex(idx, { content: fullContent });
@ -1351,13 +1351,13 @@ class ChatStore {
if (isRouterMode()) {
const modelContextSize = selectedModelContextSize();
if (typeof modelContextSize === 'number' && modelContextSize > 0) {
return modelContextSize;
}
} else {
const propsContextSize = contextSize();
if (typeof propsContextSize === 'number' && propsContextSize > 0) {
return propsContextSize;
}