From dfd25deb681936c2480ed6d366890fcf5bbf5f75 Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Thu, 26 Mar 2026 00:56:24 +0800 Subject: [PATCH] feat(web): hide deprecated KnowledgeRetriever plugins from marketplace KnowledgeRetriever has been superseded by KnowledgeEngine. Filter out plugins that only contain KnowledgeRetriever components from both the main plugin list and recommendation lists, and remove the now-unused deprecated badge UI. --- .../plugin-market/PluginMarketComponent.tsx | 10 ++++- .../plugin-market/RecommendationLists.tsx | 6 ++- .../PluginMarketCardComponent.tsx | 38 ------------------- 3 files changed, 14 insertions(+), 40 deletions(-) diff --git a/web/src/app/home/plugins/components/plugin-market/PluginMarketComponent.tsx b/web/src/app/home/plugins/components/plugin-market/PluginMarketComponent.tsx index 25d14fc6..9bd6f4f0 100644 --- a/web/src/app/home/plugins/components/plugin-market/PluginMarketComponent.tsx +++ b/web/src/app/home/plugins/components/plugin-market/PluginMarketComponent.tsx @@ -152,7 +152,15 @@ function MarketPageContent({ ); const data: ApiRespMarketplacePlugins = response; - const newPlugins = data.plugins.map(transformToVO); + const newPlugins = data.plugins + .filter((plugin) => { + // Hide plugins that only contain deprecated KnowledgeRetriever components + const keys = Object.keys(plugin.components || {}); + return !( + keys.length > 0 && keys.every((k) => k === 'KnowledgeRetriever') + ); + }) + .map(transformToVO); const total = data.total; if (reset || page === 1) { diff --git a/web/src/app/home/plugins/components/plugin-market/RecommendationLists.tsx b/web/src/app/home/plugins/components/plugin-market/RecommendationLists.tsx index dadadb4f..01ce0b4a 100644 --- a/web/src/app/home/plugins/components/plugin-market/RecommendationLists.tsx +++ b/web/src/app/home/plugins/components/plugin-market/RecommendationLists.tsx @@ -59,7 +59,11 @@ function RecommendationListRow({ const [perPage, setPerPage] = useState(4); const gridRef = useRef(null); - const plugins = list.plugins || []; + const plugins = (list.plugins || []).filter((plugin) => { + // Hide plugins that only contain deprecated KnowledgeRetriever components + const keys = Object.keys(plugin.components || {}); + return !(keys.length > 0 && keys.every((k) => k === 'KnowledgeRetriever')); + }); // Measure how many columns the CSS grid actually renders const measureCols = useCallback(() => { diff --git a/web/src/app/home/plugins/components/plugin-market/plugin-market-card/PluginMarketCardComponent.tsx b/web/src/app/home/plugins/components/plugin-market/plugin-market-card/PluginMarketCardComponent.tsx index 56c0a074..e0d5a3a2 100644 --- a/web/src/app/home/plugins/components/plugin-market/plugin-market-card/PluginMarketCardComponent.tsx +++ b/web/src/app/home/plugins/components/plugin-market/plugin-market-card/PluginMarketCardComponent.tsx @@ -1,12 +1,6 @@ import { PluginMarketCardVO } from './PluginMarketCardVO'; import { useTranslation } from 'react-i18next'; import { Badge } from '@/components/ui/badge'; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from '@/components/ui/tooltip'; import { Wrench, AudioWaveform, @@ -15,7 +9,6 @@ import { ExternalLink, Book, FileText, - Info, } from 'lucide-react'; import { useState, useRef, useEffect } from 'react'; import { Button } from '@/components/ui/button'; @@ -90,13 +83,6 @@ export default function PluginMarketCardComponent({ Parser: , }; - // Plugins that only contain KnowledgeRetriever components are deprecated - const isDeprecated = (() => { - if (!cardVO.components) return false; - const keys = Object.keys(cardVO.components); - return keys.length > 0 && keys.every((k) => k === 'KnowledgeRetriever'); - })(); - return (
{cardVO.label}
- {isDeprecated && ( - - - e.preventDefault()} - > - - {t('market.deprecated')} - - - - - {t('market.deprecatedTooltip')} - - - - )}