From d965b91b08dbabdc9a9a05f8cecc4afd86a77164 Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Mon, 15 Apr 2024 14:05:20 +0800 Subject: [PATCH] fix: workflow auto layout nodes offset & delete node shortcuts (#3484) --- web/app/components/workflow/index.tsx | 2 +- web/app/components/workflow/utils.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/app/components/workflow/index.tsx b/web/app/components/workflow/index.tsx index bef08122f..fdd6d73fa 100644 --- a/web/app/components/workflow/index.tsx +++ b/web/app/components/workflow/index.tsx @@ -138,7 +138,7 @@ const Workflow: FC = memo(({ }) useKeyPress(['delete'], handleEdgeDelete) - useKeyPress(['delete'], handleNodeDeleteSelected) + useKeyPress(['delete', 'backspace'], handleNodeDeleteSelected) useKeyPress(['ctrl.c', 'meta.c'], handleNodeCopySelected) useKeyPress(['ctrl.x', 'meta.x'], handleNodeCut) useKeyPress(['ctrl.v', 'meta.v'], handleNodePaste) diff --git a/web/app/components/workflow/utils.ts b/web/app/components/workflow/utils.ts index 9ba156608..67bd63799 100644 --- a/web/app/components/workflow/utils.ts +++ b/web/app/components/workflow/utils.ts @@ -175,8 +175,8 @@ export const getLayoutByDagre = (originNodes: Node[], originEdges: Edge[]) => { dagreGraph.setGraph({ rankdir: 'LR', align: 'UL', - nodesep: 64, - ranksep: 40, + nodesep: 40, + ranksep: 60, }) nodes.forEach((node) => { dagreGraph.setNode(node.id, { width: node.width, height: node.height })