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.

allow editing of hidden inputs in preview (#24370)

znn4d8b8f92105b
diff --git a/web/app/components/workflow/nodes/_base/components/before-run-form/form-item.tsx b/web/app/components/workflow/nodes/_base/components/before-run-form/form-item.tsx
index fd1cd01abfe..d6f56b8c43f 100644
--- a/web/app/components/workflow/nodes/_base/components/before-run-form/form-item.tsx
+++ b/web/app/components/workflow/nodes/_base/components/before-run-form/form-item.tsx
@@ -118,8 +118,20 @@ const FormItem: FC<Props> = ({
<div className={cn(className)}>
{!isArrayLikeType && !isBooleanType && (
<div className='system-sm-semibold mb-1 flex h-6 items-center gap-1 text-text-secondary'>
- <div className='truncate'>{typeof payload.label === 'object' ? nodeKey : payload.label}</div>
- {!payload.required && <span className='system-xs-regular text-text-tertiary'>{t('workflow.panel.optional')}</span>}
+ <div className='truncate'>
+ {typeof payload.label === 'object' ? nodeKey : payload.label}
+ </div>
+ {payload.hide === true ? (
+ <span className='system-xs-regular text-text-tertiary'>
+ {t('workflow.panel.optional_and_hidden')}
+ </span>
+ ) : (
+ !payload.required && (
+ <span className='system-xs-regular text-text-tertiary'>
+ {t('workflow.panel.optional')}
+ </span>
+ )
+ )}
</div>
)}
<div className='grow'>
diff --git a/web/app/components/workflow/panel/debug-and-preview/index.tsx b/web/app/components/workflow/panel/debug-and-preview/index.tsx
index baf4c21dcdb..9c64849dc5f 100644
--- a/web/app/components/workflow/panel/debug-and-preview/index.tsx
+++ b/web/app/components/workflow/panel/debug-and-preview/index.tsx
@@ -39,7 +39,7 @@ const DebugAndPreview = () => {
const selectedNode = nodes.find(node => node.data.selected)
const startNode = nodes.find(node => node.data.type === BlockEnum.Start)
const variables = startNode?.data.variables || []
- const visibleVariables = variables.filter(v => v.hide !== true)
+ const visibleVariables = variables
const [showConversationVariableModal, setShowConversationVariableModal] = useState(false)
diff --git a/web/app/components/workflow/panel/debug-and-preview/user-input.tsx b/web/app/components/workflow/panel/debug-and-preview/user-input.tsx
index 0670d9a52b9..b7ed2a54fd1 100644
--- a/web/app/components/workflow/panel/debug-and-preview/user-input.tsx
+++ b/web/app/components/workflow/panel/debug-and-preview/user-input.tsx
@@ -14,10 +14,11 @@ import cn from '@/utils/classnames'
const UserInput = () => {
const workflowStore = useWorkflowStore()
const inputs = useStore(s => s.inputs)
+ const showDebugAndPreviewPanel = useStore(s => s.showDebugAndPreviewPanel)
const nodes = useNodes<StartNodeType>()
const startNode = nodes.find(node => node.data.type === BlockEnum.Start)
const variables = startNode?.data.variables || []
- const visibleVariables = variables.filter(v => v.hide !== true)
+ const visibleVariables = showDebugAndPreviewPanel ? variables : variables.filter(v => v.hide !== true)
const handleValueChange = (variable: string, v: string) => {
const {
diff --git a/web/i18n/en-US/workflow.ts b/web/i18n/en-US/workflow.ts
index a5862bef860..01d17a4111c 100644
--- a/web/i18n/en-US/workflow.ts
+++ b/web/i18n/en-US/workflow.ts
@@ -340,6 +340,7 @@ const translation = {
optional: '(optional)',
maximize: 'Maximize Canvas',
minimize: 'Exit Full Screen',
+ optional_and_hidden: '(optional & hidden)',
},
nodes: {
common: {
diff --git a/web/i18n/zh-Hans/workflow.ts b/web/i18n/zh-Hans/workflow.ts
index a497bca56ae..441c0a707ed 100644
--- a/web/i18n/zh-Hans/workflow.ts
+++ b/web/i18n/zh-Hans/workflow.ts
@@ -340,6 +340,7 @@ const translation = {
moveToThisNode: '定位至此节点',
maximize: '最大化画布',
minimize: '退出最大化',
+ optional_and_hidden: '(选填 & 隐藏)',
},
nodes: {
common: {