diff --git a/packages/client/ui-settings-integrations/src/client/IntegrationsSection.tsx b/packages/client/ui-settings-integrations/src/client/IntegrationsSection.tsx index 43d2cd2dd5..b488337ca7 100644 --- a/packages/client/ui-settings-integrations/src/client/IntegrationsSection.tsx +++ b/packages/client/ui-settings-integrations/src/client/IntegrationsSection.tsx @@ -165,6 +165,8 @@ export function IntegrationsSection(props: IntegrationsSectionProps) { /** Connector skill whose instructions are open in a popup on the connector page. */ const [connectorSkillId, setConnectorSkillId] = useState() const [query, setQuery] = useState('') + /** What the Connectors list is filtered by: a provider's name, description, or connected account names. */ + const [connectorQuery, setConnectorQuery] = useState('') /** Which half of the Skills page is showing; nothing installed yet means the catalog. */ const [mode, setMode] = useState<'library' | 'catalog'>('library') const [chosenMode, setChosenMode] = useState(false) @@ -627,6 +629,25 @@ export function IntegrationsSection(props: IntegrationsSectionProps) { ? displayMenu : } : undefined + const connectorSearch =
+ { setConnectorQuery(event.currentTarget.value) }} + /> +
+ /** Providers whose name, description, or connected accounts contain every word of the search, in list order. */ + const matchingProviders = (snapshot?.providers ?? []).filter((provider) => { + const words = connectorQuery.trim().toLowerCase().split(/\s+/).filter(word => word !== '') + if (words.length === 0) return true + const accounts = (snapshot?.connectors ?? []) + .filter(connection => connection.provider === provider.provider).map(connection => connection.name) + const text = [t(provider.provider), t(`${provider.provider}Description`), ...accounts].join(' ').toLowerCase() + return words.every(word => text.includes(word)) + }) const catalogVisible = (page === 'skills' ? selectedSkillId : selectedConnector) === undefined // Nothing the list owns is drawn while the first read is in flight, so the // page shows the header and the spinner alone. @@ -785,7 +806,9 @@ export function IntegrationsSection(props: IntegrationsSectionProps) { : snapshot !== undefined &&

{t('skillMissing')}

} : <> - {providerDetail === undefined ?
{snapshot?.providers.map(provider =>
{t('noConnectorMatches')}

} + {providerDetail === undefined ?
{matchingProviders.map(provider =>
diff --git a/packages/client/ui-settings-integrations/src/client/locales.ts b/packages/client/ui-settings-integrations/src/client/locales.ts index 0e08d6339f..c18b111286 100644 --- a/packages/client/ui-settings-integrations/src/client/locales.ts +++ b/packages/client/ui-settings-integrations/src/client/locales.ts @@ -7,7 +7,7 @@ export const en = { on: 'On', off: 'Off', reconnectHint: 'Sign-in expired. Turn it on to sign in again.', serverUnavailable: 'Not reachable. Remove it and add it again.', useToken: 'Use an access token instead', addServer: 'Add server', - noMatches: 'No skills match your search.', skillMissing: 'This skill is no longer in your library.', + noMatches: 'No skills match your search.', searchConnectors: 'Search connectors', noConnectorMatches: 'No connectors match your search.', skillMissing: 'This skill is no longer in your library.', removeSkill: 'Remove skill', connectorSkillsHint: 'These skills are enabled with the connector.', noConnectorSkills: 'This connector exposes its discovered tools directly and has no bundled skills.', @@ -162,7 +162,7 @@ export const zh: Record = { on: '开', off: '关', reconnectHint: '登录已过期。开启即可重新登录。', serverUnavailable: '无法访问。请移除后重新添加。', useToken: '改用访问令牌', addServer: '添加服务器', - noMatches: '没有匹配的技能。', skillMissing: '此技能已不在您的技能库中。', + noMatches: '没有匹配的技能。', searchConnectors: '搜索连接器', noConnectorMatches: '没有匹配的连接器。', skillMissing: '此技能已不在您的技能库中。', removeSkill: '移除技能', connectorSkillsHint: '这些技能随连接器一起启用。', noConnectorSkills: '此连接器直接提供已发现的工具,没有附带技能。', @@ -314,7 +314,7 @@ export const es = { on: 'Activado', off: 'Desactivado', reconnectHint: 'La sesión expiró. Actívalo para iniciar sesión de nuevo.', serverUnavailable: 'No se puede acceder. Elimínalo y agrégalo otra vez.', useToken: 'Usar un token de acceso en su lugar', addServer: 'Agregar servidor', - noMatches: 'Ninguna habilidad coincide con tu búsqueda.', skillMissing: 'Esta habilidad ya no está en tu biblioteca.', + noMatches: 'Ninguna habilidad coincide con tu búsqueda.', searchConnectors: 'Buscar conectores', noConnectorMatches: 'Ningún conector coincide con tu búsqueda.', skillMissing: 'Esta habilidad ya no está en tu biblioteca.', removeSkill: 'Eliminar habilidad', connectorSkillsHint: 'Estas habilidades se activan con el conector.', noConnectorSkills: 'Este conector expone directamente sus herramientas detectadas y no incluye habilidades.',