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:
yyh
2026-01-19 14:22:25 +08:00
parent 5947e04226
commit 9aed4f830f
5 changed files with 43 additions and 128 deletions

View File

@ -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 === ' ') {