Skip to content

armgit / dify

Public Imported from GitHub
0

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.

fix(web): optimize the pop logic of the tool selector (#21558) (#21559)

HyaCinth79fa3c7519a7
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 7f5f22896a2..fef79644cd6 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 && (
<ActionButton className='mx-1' onClick={() => {
+ setCollapse(false)
setOpen(!open)
setPanelShowState(true)
}}>
@@ -126,23 +127,6 @@ const MultipleToolSelector = ({
</div>
{!collapse && (
<>
- <ToolSelector
- nodeId={nodeId}
- nodeOutputVars={nodeOutputVars}
- availableNodes={availableNodes}
- scope={scope}
- value={undefined}
- selectedTools={value}
- onSelect={handleAdd}
- controlledState={open}
- onControlledStateChange={setOpen}
- trigger={
- <div className=''></div>
- }
- panelShowState={panelShowState}
- onPanelShowStateChange={setPanelShowState}
- isEdit={false}
- />
{value.length === 0 && (
<div className='system-xs-regular flex justify-center rounded-[10px] bg-background-section p-3 text-text-tertiary'>{t('plugin.detailPanel.toolSelector.empty')}</div>
)}
@@ -164,6 +148,23 @@ const MultipleToolSelector = ({
))}
</>
)}
+ <ToolSelector
+ nodeId={nodeId}
+ nodeOutputVars={nodeOutputVars}
+ availableNodes={availableNodes}
+ scope={scope}
+ value={undefined}
+ selectedTools={value}
+ onSelect={handleAdd}
+ controlledState={open}
+ onControlledStateChange={setOpen}
+ trigger={
+ <div className=''></div>
+ }
+ 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 0abf7b90315..f1bdbbfbd90 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<string, any>
parameters?: Record<string, any>
enabled?: boolean