Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix(plugins): enhance search to match name, label and description (#30501)
zhsamad4baf078f732
diff --git a/web/app/components/plugins/plugin-page/plugins-panel.tsx b/web/app/components/plugins/plugin-page/plugins-panel.tsxindex a065e735a83..ff765d39abf 100644--- a/web/app/components/plugins/plugin-page/plugins-panel.tsx+++ b/web/app/components/plugins/plugin-page/plugins-panel.tsx@@ -1,10 +1,13 @@'use client'+import type { PluginDetail } from '../types'import type { FilterState } from './filter-management'import { useDebounceFn } from 'ahooks'import { useMemo } from 'react'import { useTranslation } from 'react-i18next'import Button from '@/app/components/base/button'import PluginDetailPanel from '@/app/components/plugins/plugin-detail-panel'+import { useGetLanguage } from '@/context/i18n'+import { renderI18nObject } from '@/i18n-config'import { useInstalledLatestVersion, useInstalledPluginList, useInvalidateInstalledPluginList } from '@/service/use-plugins'import Loading from '../../base/loading'import { PluginSource } from '../types'@@ -13,8 +16,34 @@ import Empty from './empty'import FilterManagement from './filter-management'import List from './list'+const matchesSearchQuery = (plugin: PluginDetail & { latest_version: string }, query: string, locale: string): boolean => {+ if (!query)+ return true+ const lowerQuery = query.toLowerCase()+ const { declaration } = plugin+ // Match plugin_id+ if (plugin.plugin_id.toLowerCase().includes(lowerQuery))+ return true+ // Match plugin name+ if (plugin.name?.toLowerCase().includes(lowerQuery))+ return true+ // Match declaration name+ if (declaration.name?.toLowerCase().includes(lowerQuery))+ return true+ // Match localized label+ const label = renderI18nObject(declaration.label, locale)+ if (label?.toLowerCase().includes(lowerQuery))+ return true+ // Match localized description+ const description = renderI18nObject(declaration.description, locale)+ if (description?.toLowerCase().includes(lowerQuery))+ return true+ return false+}+const PluginsPanel = () => {const { t } = useTranslation()+ const locale = useGetLanguage()const filters = usePluginPageContext(v => v.filters) as FilterStateconst setFilters = usePluginPageContext(v => v.setFilters)const { data: pluginList, isLoading: isPluginListLoading, isFetching, isLastPage, loadNextPage } = useInstalledPluginList()@@ -48,11 +77,11 @@ const PluginsPanel = () => {return ((categories.length === 0 || categories.includes(plugin.declaration.category))&& (tags.length === 0 || tags.some(tag => plugin.declaration.tags.includes(tag)))- && (searchQuery === '' || plugin.plugin_id.toLowerCase().includes(searchQuery.toLowerCase()))+ && matchesSearchQuery(plugin, searchQuery, locale))})return filteredList- }, [pluginListWithLatestVersion, filters])+ }, [pluginListWithLatestVersion, filters, locale])const currentPluginDetail = useMemo(() => {const detail = pluginListWithLatestVersion.find(plugin => plugin.plugin_id === currentPluginID)