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: workflow auto layout nodes offset & delete node shortcuts (#3484)

zxhlyhd965b91b08db
diff --git a/web/app/components/workflow/index.tsx b/web/app/components/workflow/index.tsx
index bef08122fb4..fdd6d73fad8 100644
--- a/web/app/components/workflow/index.tsx
+++ b/web/app/components/workflow/index.tsx
@@ -138,7 +138,7 @@ const Workflow: FC<WorkflowProps> = 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 9ba156608b3..67bd63799bf 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 })