Integrate ELKjs for automatic diagram layout#152
Merged
ricardozanini merged 6 commits intoMay 22, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Integrates ELK-based auto-layout into the diagram editor and expands test coverage around layout graph conversion, application, and error handling.
Changes:
- Add
elkjsdependency and introduceprocessElkLayoutcore helper. - Replace the previous placeholder auto-layout with ELK graph building + layout application (including edge bendpoints).
- Update Diagram rendering/tests to use
ReactFlowProviderand add extensive layout-focused tests.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Adds elkjs to the workspace catalog for consistent versioning. |
| packages/serverless-workflow-diagram-editor/package.json | Consumes elkjs from the workspace catalog. |
| packages/serverless-workflow-diagram-editor/src/core/index.ts | Re-exports new ELK layout helper from core. |
| packages/serverless-workflow-diagram-editor/src/core/elkjs.ts | Adds processElkLayout wrapper around ELK with error handling. |
| packages/serverless-workflow-diagram-editor/src/react-flow/diagram/autoLayout.ts | Implements ELK graph conversion, layout application, and bendpoint mapping. |
| packages/serverless-workflow-diagram-editor/src/react-flow/diagram/diagramBuilder.ts | Stops applying auto-layout inside the builder; returns raw nodes/edges. |
| packages/serverless-workflow-diagram-editor/src/react-flow/diagram/Diagram.tsx | Applies auto-layout asynchronously on model changes and fits view. |
| packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx | Adds ReactFlowProvider to support useReactFlow() usage. |
| packages/serverless-workflow-diagram-editor/tests/react-flow/diagram/Diagram.test.tsx | Wraps Diagram with ReactFlowProvider in tests. |
| packages/serverless-workflow-diagram-editor/tests/react-flow/diagram/autoLayout.integration.test.ts | Replaces old placeholder assertions with detailed auto-layout unit/integration coverage. |
| packages/serverless-workflow-diagram-editor/tests/core/elkjs.test.ts | Adds unit tests for processElkLayout success and error scenarios. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fantonangeli
suggested changes
May 21, 2026
Member
fantonangeli
left a comment
There was a problem hiding this comment.
@handreyrc I left some comment. Please let me know what you think
Contributor
Author
|
@fantonangeli @kumaradityaraj, This PR is ready for reviews again. Thanks! |
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com> # Conflicts: # packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
40c903f to
96b2245
Compare
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
fantonangeli
approved these changes
May 22, 2026
Contributor
Author
|
If do not have any consideration, this PR is good enouth to be merged! Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #54
Summary
This PR replaces the dummy auto-layout placeholder for an actual layout engine capable of layout nodes and edges.
Changes