From e18ecead2c5acca2d0f00f1b4091b79fc9b2d754 Mon Sep 17 00:00:00 2001 From: lyzno1 Date: Wed, 22 Oct 2025 15:07:46 +0800 Subject: [PATCH] fix: hide All tools when searching --- .../workflow/block-selector/all-tools.tsx | 61 ++++++++++--------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/web/app/components/workflow/block-selector/all-tools.tsx b/web/app/components/workflow/block-selector/all-tools.tsx index 9a84c4679f..3ed89a8131 100644 --- a/web/app/components/workflow/block-selector/all-tools.tsx +++ b/web/app/components/workflow/block-selector/all-tools.tsx @@ -174,9 +174,9 @@ const AllTools = ({ const isSupportGroupView = [ToolTypeEnum.All, ToolTypeEnum.BuiltIn].includes(activeTab) const isShowRAGRecommendations = isInRAGPipeline && activeTab === ToolTypeEnum.All && !hasFilter - const hasToolsContent = tools.length > 0 + const hasToolsListContent = tools.length > 0 || isShowRAGRecommendations const hasPluginContent = enable_marketplace && notInstalledPlugins.length > 0 - const shouldShowEmptyState = hasFilter && !hasToolsContent && !hasPluginContent + const shouldShowEmptyState = hasFilter && !hasToolsListContent && !hasPluginContent const shouldShowFeatured = showFeatured && enable_marketplace && !isInRAGPipeline @@ -239,32 +239,37 @@ const AllTools = ({ )} -
- {t('tools.allTools')} -
- - {/* Plugins from marketplace */} - {enable_marketplace && ( - } - list={notInstalledPlugins} - searchText={searchText} - toolContentClassName={toolContentClassName} - tags={tags} - /> + {(hasToolsListContent || hasPluginContent) && ( + <> +
+ {t('tools.allTools')} +
+ {hasToolsListContent && ( + + )} + {hasPluginContent && ( + } + list={notInstalledPlugins} + searchText={searchText} + toolContentClassName={toolContentClassName} + tags={tags} + /> + )} + )}