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(web): stabilize workflow node panel operator dropdown trigger (#35352)

Coding On Stareaddd4a132de
diff --git a/eslint-suppressions.json b/eslint-suppressions.json
index 763d94af9a6..173a3a7bd77 100644
--- a/eslint-suppressions.json
+++ b/eslint-suppressions.json
@@ -4679,11 +4679,6 @@
"count": 1
}
},
- "web/app/components/workflow/nodes/_base/components/node-control.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
"web/app/components/workflow/nodes/_base/components/node-handle.tsx": {
"react/set-state-in-effect": {
"count": 1
diff --git a/web/app/components/workflow/nodes/_base/components/node-control.tsx b/web/app/components/workflow/nodes/_base/components/node-control.tsx
index aab4b5065d9..547d0b1daa0 100644
--- a/web/app/components/workflow/nodes/_base/components/node-control.tsx
+++ b/web/app/components/workflow/nodes/_base/components/node-control.tsx
@@ -9,7 +9,11 @@ import { useTranslation } from 'react-i18next'
import {
Stop,
} from '@/app/components/base/icons/src/vender/line/mediaAndDevices'
-import Tooltip from '@/app/components/base/tooltip'
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from '@/app/components/base/ui/tooltip'
import { useWorkflowStore } from '@/app/components/workflow/store'
import {
useNodesInteractions,
@@ -46,7 +50,8 @@ const NodeControl: FC<NodeControlProps> = ({
`}
>
<div
- className="flex h-6 items-center rounded-lg border-[0.5px] border-components-actionbar-border bg-components-actionbar-bg px-0.5 text-text-tertiary shadow-md backdrop-blur-[5px]"
+ className="nodrag nopan nowheel flex h-6 items-center rounded-lg border-[0.5px] border-components-actionbar-border bg-components-actionbar-bg px-0.5 text-text-tertiary shadow-md backdrop-blur-[5px]"
+ onMouseDown={e => e.stopPropagation()}
onClick={e => e.stopPropagation()}
>
{
@@ -71,11 +76,13 @@ const NodeControl: FC<NodeControlProps> = ({
isSingleRunning
? <Stop className="h-3 w-3" />
: (
- <Tooltip
- popupContent={t('panel.runThisStep', { ns: 'workflow' })}
- asChild={false}
- >
- <span className="i-ri-play-large-line h-3 w-3" />
+ <Tooltip>
+ <TooltipTrigger
+ render={<span className="i-ri-play-large-line h-3 w-3" />}
+ />
+ <TooltipContent>
+ {t('panel.runThisStep', { ns: 'workflow' })}
+ </TooltipContent>
</Tooltip>
)
}
diff --git a/web/app/components/workflow/nodes/_base/components/panel-operator/index.tsx b/web/app/components/workflow/nodes/_base/components/panel-operator/index.tsx
index 2109365d756..7b3469aabaf 100644
--- a/web/app/components/workflow/nodes/_base/components/panel-operator/index.tsx
+++ b/web/app/components/workflow/nodes/_base/components/panel-operator/index.tsx
@@ -1,10 +1,12 @@
import type { OffsetOptions } from '@floating-ui/react'
import type { Node } from '@/app/components/workflow/types'
+import { cn } from '@langgenius/dify-ui/cn'
import {
memo,
useCallback,
useState,
} from 'react'
+import { useTranslation } from 'react-i18next'
import {
DropdownMenu,
DropdownMenuContent,
@@ -32,6 +34,7 @@ const PanelOperator = ({
onOpenChange,
showHelpLink = true,
}: PanelOperatorProps) => {
+ const { t } = useTranslation()
const [open, setOpen] = useState(false)
const sideOffset = typeof offset === 'number'
? offset
@@ -54,17 +57,16 @@ const PanelOperator = ({
open={open}
onOpenChange={handleOpenChange}
>
- <DropdownMenuTrigger render={<div />}>
- <div
- className={`
- flex h-6 w-6 cursor-pointer items-center justify-center rounded-md
- hover:bg-state-base-hover
- ${open && 'bg-state-base-hover'}
- ${triggerClassName}
- `}
- >
- <span aria-hidden className="i-ri-more-fill h-4 w-4 text-text-tertiary" />
- </div>
+ <DropdownMenuTrigger
+ render={<button type="button" />}
+ aria-label={t('operation.more', { ns: 'common' })}
+ className={cn(
+ 'nodrag nopan nowheel flex h-6 w-6 cursor-pointer items-center justify-center rounded-md hover:bg-state-base-hover',
+ open && 'bg-state-base-hover',
+ triggerClassName,
+ )}
+ >
+ <span aria-hidden className="i-ri-more-fill h-4 w-4 text-text-tertiary" />
</DropdownMenuTrigger>
<DropdownMenuContent
placement="bottom-end"