Skip to content

Fix parent nodes bad edges routing#181

Merged
ricardozanini merged 6 commits into
serverlessworkflow:mainfrom
handreyrc:fix-edge-routing
Jun 18, 2026
Merged

Fix parent nodes bad edges routing#181
ricardozanini merged 6 commits into
serverlessworkflow:mainfrom
handreyrc:fix-edge-routing

Conversation

@handreyrc

Copy link
Copy Markdown
Contributor

Closes #179

Summary

This PR fix a series of path distortions around edges routing involving parent nodes

Changes

  • Added coordinates compensation in the conversion from ELK waypoints to reactflow SVG path.
  • Added full support to calculated waypoints and auto-layout routing inside parent nodes.
  • Enhanced the logic that handles edges pointing to nodes outside the scope of the source node to work with nested parents.
  • Added explicit ELK south / north port definitions to edges preventing the auto-layout engine to dynamically switch ports causing edges to be rendered bethind nodes in reactflow.
  • Tweaked ELK layout options to straighten edges.
  • Tweaked ELK layout options to work with fixed ports and the combination of algorithms and strategies to produce better layered graphs, cycle breaking and edges routing.
  • Added tests covering changes around edges handling and SVG coordinates compensation.

Signed-off-by: handreyrc <handrey.cunha@gmail.com>

# Conflicts:
#	packages/serverless-workflow-diagram-editor/src/react-flow/diagram/autoLayout.ts
#	packages/serverless-workflow-diagram-editor/tests/react-flow/diagram/autoLayout.integration.test.ts
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Copilot AI review requested due to automatic review settings June 16, 2026 20:26
@netlify

netlify Bot commented Jun 16, 2026

Copy link
Copy Markdown

Deploy Preview for swf-editor ready!

Name Link
🔨 Latest commit 52df137
🔍 Latest deploy log https://app.netlify.com/projects/swf-editor/deploys/6a32e6933cd1310008c7709b
😎 Deploy Preview https://deploy-preview-181--swf-editor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@handreyrc handreyrc self-assigned this Jun 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates diagram layout and edge routing to better support orthogonal paths and nested/parent-node scenarios, including port-based connections and revised waypoint handling.

Changes:

  • Updated edge path generation to produce orthogonal (right-angled) segments between points.
  • Revised ELK auto-layout configuration, added output ports to parent nodes, and adjusted waypoint mapping (incl. absolute coords for nested edges).
  • Expanded/updated unit + integration tests and snapshots to match new routing/layout behavior.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
packages/serverless-workflow-diagram-editor/src/react-flow/edges/Edges.tsx Generates orthogonal SVG paths from waypoints.
packages/serverless-workflow-diagram-editor/src/react-flow/diagram/autoLayout.ts Adjusts ELK layout options, adds parent ports, and updates waypoint extraction/coordinate handling.
packages/serverless-workflow-diagram-editor/src/core/graph.ts Redirects edges crossing parent boundaries and prevents duplicate redirect edges.
packages/serverless-workflow-diagram-editor/tests/react-flow/edges/Edges.test.tsx Updates expected paths for new orthogonal routing behavior.
packages/serverless-workflow-diagram-editor/tests/react-flow/edges/snapshots/Edges.test.tsx.snap Updates snapshot to reflect new path geometry.
packages/serverless-workflow-diagram-editor/tests/react-flow/diagram/autoLayout.integration.test.ts Adds/updates test cases for ports, waypoint semantics, and nested-edge coordinate conversion.
packages/serverless-workflow-diagram-editor/tests/core/graph.test.ts Adds coverage for new edge redirection behavior across nested parents.
packages/serverless-workflow-diagram-editor/tests/side-panel/NodeDetailsView.test.tsx Minor test cleanup (unused import) and string formatting adjustment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/edges/Edges.tsx Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/edges/Edges.tsx Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/diagram/autoLayout.ts Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/diagram/autoLayout.ts Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/diagram/autoLayout.ts Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/diagram/autoLayout.ts Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/diagram/autoLayout.ts Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/core/graph.ts Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/core/graph.ts Outdated
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
@handreyrc handreyrc added the bug Something isn't working label Jun 16, 2026
@handreyrc handreyrc moved this from Backlog to In Progress in Editor Project Tracker Jun 16, 2026
@handreyrc handreyrc moved this from In Progress to In review in Editor Project Tracker Jun 16, 2026

@fantonangeli fantonangeli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@handreyrc I think this is a nice improvement to add in the changeset, but "up to you".

Comment thread packages/serverless-workflow-diagram-editor/src/core/graph.ts Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/diagram/autoLayout.ts Outdated
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Copilot AI review requested due to automatic review settings June 17, 2026 14:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Comment thread packages/serverless-workflow-diagram-editor/src/core/graph.ts Outdated
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
@handreyrc handreyrc requested a review from fantonangeli June 17, 2026 14:53
Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/diagram/autoLayout.ts Outdated
@lornakelly

Copy link
Copy Markdown
Contributor

Thanks @handreyrc , looks really nice, just one small comment

Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Copilot AI review requested due to automatic review settings June 17, 2026 18:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

@handreyrc handreyrc requested a review from lornakelly June 17, 2026 18:33

@fantonangeli fantonangeli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lornakelly lornakelly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@handreyrc handreyrc requested a review from ricardozanini June 18, 2026 12:53
@handreyrc

Copy link
Copy Markdown
Contributor Author

@ricardozanini

If you do not have further considerations this PR is good enough to be merged.

Thanks

@ricardozanini ricardozanini merged commit a80f319 into serverlessworkflow:main Jun 18, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Editor Project Tracker Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: Parent nodes bad edges routing

6 participants