From 13d81d3d56197509ffa098cd559d1a6d662630f1 Mon Sep 17 00:00:00 2001 From: silentoplayz Date: Thu, 30 Jul 2026 21:54:52 -0400 Subject: [PATCH] feat: add search to the Tools and Skills lists in the Integrations menu --- .../chat/MessageInput/IntegrationsMenu.svelte | 45 ++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/MessageInput/IntegrationsMenu.svelte b/src/lib/components/chat/MessageInput/IntegrationsMenu.svelte index 98494e8b58..39452ddc37 100644 --- a/src/lib/components/chat/MessageInput/IntegrationsMenu.svelte +++ b/src/lib/components/chat/MessageInput/IntegrationsMenu.svelte @@ -35,6 +35,7 @@ import ChevronRight from '$lib/components/icons/ChevronRight.svelte'; import ChevronLeft from '$lib/components/icons/ChevronLeft.svelte'; import LinkSlash from '$lib/components/icons/LinkSlash.svelte'; + import SearchInput from './InputMenu/SearchInput.svelte'; const i18n = getContext('i18n'); @@ -66,6 +67,34 @@ let tools = null; let skills = null; + let toolsQuery = ''; + let skillsQuery = ''; + + const matchesQuery = (item, query: string) => { + const q = query.trim().toLowerCase(); + if (!q) { + return true; + } + return ( + (item?.name ?? '').toLowerCase().includes(q) || + (item?.description ?? '').toLowerCase().includes(q) + ); + }; + + $: filteredToolIds = tools + ? Object.keys(tools).filter((id) => matchesQuery(tools[id], toolsQuery)) + : []; + $: filteredSkillIds = skills + ? Object.keys(skills).filter((id) => matchesQuery(skills[id], skillsQuery)) + : []; + + $: if (tab !== 'tools') { + toolsQuery = ''; + } + $: if (tab !== 'skills') { + skillsQuery = ''; + } + $: if (show) { init(); } @@ -391,7 +420,13 @@ - {#each Object.keys(tools) as toolId} + + + {#if filteredToolIds.length === 0} +
{$i18n.t('No results found')}
+ {/if} + + {#each filteredToolIds as toolId} - {#each Object.keys(skills) as skillId} + + + {#if filteredSkillIds.length === 0} +
{$i18n.t('No results found')}
+ {/if} + + {#each filteredSkillIds as skillId}