From 83df78d0c8d431b5c83ee407d03d685de762b18e Mon Sep 17 00:00:00 2001 From: hjlarry Date: Wed, 22 Oct 2025 09:50:37 +0800 Subject: [PATCH] hide comments icon when disable collabrotion mode --- .../components/workflow/operator/control.tsx | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/web/app/components/workflow/operator/control.tsx b/web/app/components/workflow/operator/control.tsx index e80451f8bf..a0e68380bc 100644 --- a/web/app/components/workflow/operator/control.tsx +++ b/web/app/components/workflow/operator/control.tsx @@ -28,6 +28,8 @@ import TipPopup from './tip-popup' import ExportImage from './export-image' import { useOperator } from './hooks' import cn from '@/utils/classnames' +import { useStore as useAppStore } from '@/app/components/app/store' +import { useGlobalPublicStore } from '@/context/global-public-context' const Control = () => { const { t } = useTranslation() @@ -41,6 +43,9 @@ const Control = () => { getNodesReadOnly, } = useNodesReadOnly() const { handleToggleMaximizeCanvas } = useWorkflowCanvasMaximize() + const isCollaborationEnabled = useGlobalPublicStore(s => s.systemFeatures.enable_collaboration_mode) + const appDetail = useAppStore(state => state.appDetail) + const isCommentVisible = isCollaborationEnabled && (appDetail?.mode === 'workflow' || appDetail?.mode === 'advanced-chat') const addNote = (e: MouseEvent) => { if (getNodesReadOnly()) @@ -89,18 +94,20 @@ const Control = () => { - -
- -
-
+ {isCommentVisible && ( + +
+ +
+
+ )}