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.

chore: simplify the workflow details logic (#24714)

crazywoola79e6138ce2e3
diff --git a/web/app/components/base/chat/chat/answer/index.tsx b/web/app/components/base/chat/chat/answer/index.tsx
index 37225569319..993a3a55199 100644
--- a/web/app/components/base/chat/chat/answer/index.tsx
+++ b/web/app/components/base/chat/chat/answer/index.tsx
@@ -137,24 +137,14 @@ const Answer: FC<AnswerProps> = ({
/>
)
}
- {/** Render the normal steps */}
+ {/** Render workflow process */}
{
- workflowProcess && !hideProcessDetail && (
+ workflowProcess && (
<WorkflowProcessItem
data={workflowProcess}
item={item}
hideProcessDetail={hideProcessDetail}
- />
- )
- }
- {/** Hide workflow steps by it's settings in siteInfo */}
- {
- workflowProcess && hideProcessDetail && appData && (
- <WorkflowProcessItem
- data={workflowProcess}
- item={item}
- hideProcessDetail={hideProcessDetail}
- readonly={!appData.site.show_workflow_steps}
+ readonly={hideProcessDetail && appData ? !appData.site.show_workflow_steps : undefined}
/>
)
}
diff --git a/web/app/components/base/chat/chat/answer/workflow-process.tsx b/web/app/components/base/chat/chat/answer/workflow-process.tsx
index 4651ff4ab10..0537d3c58b5 100644
--- a/web/app/components/base/chat/chat/answer/workflow-process.tsx
+++ b/web/app/components/base/chat/chat/answer/workflow-process.tsx
@@ -39,6 +39,8 @@ const WorkflowProcessItem = ({
setCollapse(!expand)
}, [expand])
+ if (readonly) return null
+
return (
<div
className={cn(
@@ -51,8 +53,8 @@ const WorkflowProcessItem = ({
)}
>
<div
- className={cn('flex cursor-pointer items-center', !collapse && 'px-1.5', readonly && 'cursor-default')}
- onClick={() => !readonly && setCollapse(!collapse)}
+ className={cn('flex cursor-pointer items-center', !collapse && 'px-1.5')}
+ onClick={() => setCollapse(!collapse)}
>
{
running && (
@@ -72,10 +74,10 @@ const WorkflowProcessItem = ({
<div className={cn('system-xs-medium text-text-secondary', !collapse && 'grow')}>
{t('workflow.common.workflowProcess')}
</div>
- {!readonly && <RiArrowRightSLine className={cn('ml-1 h-4 w-4 text-text-tertiary', !collapse && 'rotate-90')} />}
+ <RiArrowRightSLine className={cn('ml-1 h-4 w-4 text-text-tertiary', !collapse && 'rotate-90')} />
</div>
{
- !collapse && !readonly && (
+ !collapse && (
<div className='mt-1.5'>
{
<TracingPanel