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: support hide env & conversation var in prompt editor (#7256)

KVOJJJin429e85f5d6a4
diff --git a/web/app/components/workflow/nodes/_base/hooks/use-available-var-list.ts b/web/app/components/workflow/nodes/_base/hooks/use-available-var-list.ts
index ef3d6659102..b81feab8053 100644
--- a/web/app/components/workflow/nodes/_base/hooks/use-available-var-list.ts
+++ b/web/app/components/workflow/nodes/_base/hooks/use-available-var-list.ts
@@ -7,12 +7,16 @@ import {
import type { ValueSelector, Var } from '@/app/components/workflow/types'
type Params = {
onlyLeafNodeVar?: boolean
+ hideEnv?: boolean
+ hideChatVar?: boolean
filterVar: (payload: Var, selector: ValueSelector) => boolean
}
const useAvailableVarList = (nodeId: string, {
onlyLeafNodeVar,
filterVar,
+ hideEnv,
+ hideChatVar,
}: Params = {
onlyLeafNodeVar: false,
filterVar: () => true,
@@ -32,6 +36,8 @@ const useAvailableVarList = (nodeId: string, {
beforeNodes: availableNodes,
isChatMode,
filterVar,
+ hideEnv,
+ hideChatVar,
})
return {
diff --git a/web/app/components/workflow/nodes/answer/panel.tsx b/web/app/components/workflow/nodes/answer/panel.tsx
index feb07c36c9a..daa5be4e666 100644
--- a/web/app/components/workflow/nodes/answer/panel.tsx
+++ b/web/app/components/workflow/nodes/answer/panel.tsx
@@ -23,6 +23,8 @@ const Panel: FC<NodePanelProps<AnswerNodeType>> = ({
const { availableVars, availableNodesWithParent } = useAvailableVarList(id, {
onlyLeafNodeVar: false,
+ hideChatVar: true,
+ hideEnv: true,
filterVar,
})