From 79fa3c7519a7afcc5753fd8bd8ec55f241b39326 Mon Sep 17 00:00:00 2001 From: HyaCinth <88471803+HyaCiovo@users.noreply.github.com> Date: Thu, 26 Jun 2025 16:45:01 +0800 Subject: [PATCH] fix(web): optimize the pop logic of the tool selector (#21558) (#21559) --- .../multiple-tool-selector/index.tsx | 35 ++++++++++--------- .../workflow/block-selector/types.ts | 2 +- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/web/app/components/plugins/plugin-detail-panel/multiple-tool-selector/index.tsx b/web/app/components/plugins/plugin-detail-panel/multiple-tool-selector/index.tsx index 7f5f22896..fef79644c 100644 --- a/web/app/components/plugins/plugin-detail-panel/multiple-tool-selector/index.tsx +++ b/web/app/components/plugins/plugin-detail-panel/multiple-tool-selector/index.tsx @@ -117,6 +117,7 @@ const MultipleToolSelector = ({ )} {!disabled && ( { + setCollapse(false) setOpen(!open) setPanelShowState(true) }}> @@ -126,23 +127,6 @@ const MultipleToolSelector = ({ {!collapse && ( <> - - } - panelShowState={panelShowState} - onPanelShowStateChange={setPanelShowState} - isEdit={false} - /> {value.length === 0 && (
{t('plugin.detailPanel.toolSelector.empty')}
)} @@ -164,6 +148,23 @@ const MultipleToolSelector = ({ ))} )} + + } + panelShowState={panelShowState} + onPanelShowStateChange={setPanelShowState} + isEdit={false} + /> ) } diff --git a/web/app/components/workflow/block-selector/types.ts b/web/app/components/workflow/block-selector/types.ts index 0abf7b903..f1bdbbfbd 100644 --- a/web/app/components/workflow/block-selector/types.ts +++ b/web/app/components/workflow/block-selector/types.ts @@ -36,7 +36,7 @@ export type ToolValue = { provider_name: string tool_name: string tool_label: string - tool_description: string + tool_description?: string settings?: Record parameters?: Record enabled?: boolean