mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 09:58:04 +08:00
refactor(skill): merge BlankAreaMenu into NodeMenu
Consolidate menu components by extending NodeMenu to support a 'root' type, eliminating the redundant BlankAreaMenu component. This reduces code duplication and simplifies the context menu logic by storing isFolder in the context menu state instead of re-querying tree data.
This commit is contained in:
@ -80,8 +80,9 @@ export function useTreeNodeHandlers({
|
||||
left: e.clientX,
|
||||
type: 'node',
|
||||
nodeId: node.data.id,
|
||||
isFolder,
|
||||
})
|
||||
}, [node.data.id, storeApi])
|
||||
}, [isFolder, node.data.id, storeApi])
|
||||
|
||||
const handleKeyDown = useCallback((e: React.KeyboardEvent) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
|
||||
Reference in New Issue
Block a user