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: remove chat variable in workflow mode (#18696)

zxhlyh13f647feaa40
diff --git a/web/app/components/workflow-app/components/workflow-header/chat-variable-trigger.tsx b/web/app/components/workflow-app/components/workflow-header/chat-variable-trigger.tsx
index df939142854..0299d53ac9f 100644
--- a/web/app/components/workflow-app/components/workflow-header/chat-variable-trigger.tsx
+++ b/web/app/components/workflow-app/components/workflow-header/chat-variable-trigger.tsx
@@ -3,9 +3,15 @@ import ChatVariableButton from '@/app/components/workflow/header/chat-variable-b
import {
useNodesReadOnly,
} from '@/app/components/workflow/hooks'
+import { useIsChatMode } from '../../hooks'
const ChatVariableTrigger = () => {
const { nodesReadOnly } = useNodesReadOnly()
+ const isChatMode = useIsChatMode()
+
+ if (!isChatMode)
+ return null
+
return <ChatVariableButton disabled={nodesReadOnly} />
}
export default memo(ChatVariableTrigger)
diff --git a/web/app/components/workflow-app/components/workflow-panel.tsx b/web/app/components/workflow-app/components/workflow-panel.tsx
index 3c1b5c8aacd..dd368660cec 100644
--- a/web/app/components/workflow-app/components/workflow-panel.tsx
+++ b/web/app/components/workflow-app/components/workflow-panel.tsx
@@ -74,7 +74,7 @@ const WorkflowPanelOnRight = () => {
)
}
{
- showChatVariablePanel && (
+ showChatVariablePanel && isChatMode && (
<ChatVariablePanel />
)
}