From 79e6138ce2e300986fd736a4f2e32fab81625fb3 Mon Sep 17 00:00:00 2001 From: crazywoola <100913391+crazywoola@users.noreply.github.com> Date: Thu, 28 Aug 2025 03:17:48 -0700 Subject: [PATCH] chore: simplify the workflow details logic (#24714) --- .../components/base/chat/chat/answer/index.tsx | 16 +++------------- .../base/chat/chat/answer/workflow-process.tsx | 10 ++++++---- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/web/app/components/base/chat/chat/answer/index.tsx b/web/app/components/base/chat/chat/answer/index.tsx index 3722556931..993a3a5519 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 = ({ /> ) } - {/** Render the normal steps */} + {/** Render workflow process */} { - workflowProcess && !hideProcessDetail && ( + workflowProcess && ( - ) - } - {/** Hide workflow steps by it's settings in siteInfo */} - { - workflowProcess && hideProcessDetail && appData && ( - ) } 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 4651ff4ab1..0537d3c58b 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 (
!readonly && setCollapse(!collapse)} + className={cn('flex cursor-pointer items-center', !collapse && 'px-1.5')} + onClick={() => setCollapse(!collapse)} > { running && ( @@ -72,10 +74,10 @@ const WorkflowProcessItem = ({
{t('workflow.common.workflowProcess')}
- {!readonly && } +
{ - !collapse && !readonly && ( + !collapse && (
{