Skip to content

Add auto layout controls using elkjs to node editor #8239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

skunkworxdark
Copy link
Contributor

Summary

Introduces auto layout functionality for the workflow editor using elkjs, including a new UI popover for layout options (placement strategy, layering, spacing, direction). Adds related state and actions to workflowSettingsSlice, updates translations, and ensures elkjs is included in dependencies.

If you select nodes, only those will have auto layout applied. Otherwise, all nodes in a workflow will be affected.

Related Issues / Discussions

NA

QA Instructions

Load a workflow and Auto Layout. With and without nodes selected.

Merge Plan

NA

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

Introduces auto layout functionality for the node editor using elkjs, including a new UI popover for layout options (placement strategy, layering, spacing, direction). Adds related state and actions to workflowSettingsSlice, updates translations, and ensures elkjs is included in optimized dependencies.
@github-actions github-actions bot added frontend-deps PRs that change frontend dependencies frontend PRs that change frontend files labels Jul 8, 2025
@skunkworxdark
Copy link
Contributor Author

skunkworxdark commented Jul 8, 2025

Here is a video showing the current operation:

workflow-autolayout.mp4

This is my first frontend change to invoke, and it was done heavily with the aid of Gemini. So be brutal in reviewing it, as I am sure I will have made glaring mistakes and poor coding style choices.

- The auto-layout settings panel is updated to use `Select` dropdowns and `NumberInput`
- The layout algorithm now uses the actual rendered dimensions of nodes from the DOM, falling back to estimates only when necessary. This results in a much more accurate and predictable layout.
- The ELKjs library integration is refactored to fix some warnings
@skunkworxdark
Copy link
Contributor Author

skunkworxdark commented Jul 11, 2025

  • Updated the auto layout settings to be dropdowns and added number picker to the sliders. look much neater.
  • Updated the node size detection to take from the rendered DOM. (not sure if there is a better way of doing this.
  • Refactored some imports to fix some warnings
workflow-autolayout2.mp4

@psychedelicious
Copy link
Collaborator

Will review and get this into v6.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend PRs that change frontend files frontend-deps PRs that change frontend dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants