feat(workflow): add edge context menu with delete support (#33391)

This commit is contained in:
yyh
2026-03-13 15:11:24 +08:00
committed by GitHub
parent 1104d35bbb
commit fe561ef3d0
15 changed files with 1051 additions and 54 deletions

View File

@ -2,7 +2,6 @@ import type { Node } from './types'
import { useClickAway } from 'ahooks'
import {
memo,
useEffect,
useRef,
} from 'react'
import useNodes from '@/app/components/workflow/store/workflow/use-nodes'
@ -13,13 +12,9 @@ import { useStore } from './store'
const NodeContextmenu = () => {
const ref = useRef(null)
const nodes = useNodes()
const { handleNodeContextmenuCancel, handlePaneContextmenuCancel } = usePanelInteractions()
const { handleNodeContextmenuCancel } = usePanelInteractions()
const nodeMenu = useStore(s => s.nodeMenu)
const currentNode = nodes.find(node => node.id === nodeMenu?.nodeId) as Node
useEffect(() => {
if (nodeMenu)
handlePaneContextmenuCancel()
}, [nodeMenu, handlePaneContextmenuCancel])
useClickAway(() => {
handleNodeContextmenuCancel()