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: zoom in/out click (#12056)

marvin-seasonb281a8015013
diff --git a/web/app/components/workflow/operator/zoom-in-out.tsx b/web/app/components/workflow/operator/zoom-in-out.tsx
index 6c4bed37510..90b5b462563 100644
--- a/web/app/components/workflow/operator/zoom-in-out.tsx
+++ b/web/app/components/workflow/operator/zoom-in-out.tsx
@@ -129,7 +129,7 @@ const ZoomInOut: FC = () => {
crossAxis: -2,
}}
>
- <PortalToFollowElemTrigger asChild onClick={handleTrigger}>
+ <PortalToFollowElemTrigger asChild>
<div className={`
p-0.5 h-9 cursor-pointer text-[13px] backdrop-blur-[5px] rounded-lg
bg-components-actionbar-bg shadow-lg border-[0.5px] border-components-actionbar-border
@@ -144,8 +144,11 @@ const ZoomInOut: FC = () => {
shortcuts={['ctrl', '-']}
>
<div
- className='flex items-center justify-center w-8 h-8 rounded-lg cursor-pointer'
+ className={`flex items-center justify-center w-8 h-8 rounded-lg ${zoom <= 0.25 ? 'cursor-not-allowed' : 'cursor-pointer hover:bg-black/5'}`}
onClick={(e) => {
+ if (zoom <= 0.25)
+ return
+
e.stopPropagation()
zoomOut()
}}
@@ -153,14 +156,17 @@ const ZoomInOut: FC = () => {
<RiZoomOutLine className='w-4 h-4 text-text-tertiary hover:text-text-secondary' />
</div>
</TipPopup>
- <div className={cn('w-[34px] system-sm-medium text-text-tertiary hover:text-text-secondary')}>{parseFloat(`${zoom * 100}`).toFixed(0)}%</div>
+ <div onClick={handleTrigger} className={cn('w-[34px] system-sm-medium text-text-tertiary hover:text-text-secondary')}>{parseFloat(`${zoom * 100}`).toFixed(0)}%</div>
<TipPopup
title={t('workflow.operator.zoomIn')}
shortcuts={['ctrl', '+']}
>
<div
- className='flex items-center justify-center w-8 h-8 rounded-lg cursor-pointer'
+ className={`flex items-center justify-center w-8 h-8 rounded-lg ${zoom >= 2 ? 'cursor-not-allowed' : 'cursor-pointer hover:bg-black/5'}`}
onClick={(e) => {
+ if (zoom >= 2)
+ return
+
e.stopPropagation()
zoomIn()
}}