Skip to content

feat(graph): add basic "Rearrange" mode for Dag graph view#68171

Open
TomasCorreia2003 wants to merge 2 commits into
apache:mainfrom
TomasCorreia2003:feature/graph-view-manual-node-layout-55796
Open

feat(graph): add basic "Rearrange" mode for Dag graph view#68171
TomasCorreia2003 wants to merge 2 commits into
apache:mainfrom
TomasCorreia2003:feature/graph-view-manual-node-layout-55796

Conversation

@TomasCorreia2003

Copy link
Copy Markdown

This feature addresses #55796 by adding a "Rearrange" button which when pressed, allows users to drag and drop nodes when in a DAG's graph view. For this, it adds node collision-avoidance on node drop and real-time edge recalculation to provide users with a responsive and helpful experience. Users cannot control edges as they represent dependencies. We also decided to make any changes while in "Rearrange mode" not persistent as the feature is simply meant to be a viewing aid for confusing graphs such as the ones spawned from complex DAGs.
This will be a great start for anyone attempting to make this mode persistent or any other QoL or functional improvements.

Closes #55796

Adds ability to drag and drop nodes in Dag graph view.
Adds node collision avoidance and edge rerouting for "Rearrange" mode.
When leaving graph view or toggling "Rearrange" off, the graph returns
to its previous unaltered state.

Closes apache#55796

Co-authored-by: Bernardo Borges de Sousa <bernardogbsousa2@tecnico.ulisboa.pt>
@boring-cyborg

boring-cyborg Bot commented Jun 7, 2026

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@choo121600

Copy link
Copy Markdown
Member

Could you attach before/after screenshots or a short recording for this UI change?
It would help with the review.

@bbovenzi

bbovenzi commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Echoing @choo121600, a GIF would also be very helpful

@TomasCorreia2003

Copy link
Copy Markdown
Author

Hey Fellas,

Here is a video demonstrating the added functionality as requested:

https://youtu.be/L2mZPwV_6q0

(skip to 3 mins for the feature showcase)

@jscheffl

Copy link
Copy Markdown
Contributor

Okay, from the demo a "nice feature" - but do I see it right that after existing the rearrange-mode the state is lost? Or is the re-arranged state somehow kept for the user?

@BernardoGBS1

Copy link
Copy Markdown

Hey @jscheffl,

In the future this feature is a great stepping-stone to make this "rearrange mode" into a "manual layout mode" by adding persistence. However, @TomasCorreia2003 states in his description:
"We also decided to make any changes while in "Rearrange mode" not persistent as the feature is simply meant to be a viewing aid for confusing graphs such as the ones spawned from complex DAGs."

Therefore the feature is actually working as intended and I apologize for not making this clearer in the video.

@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Jun 25, 2026

@pierrejeambrun pierrejeambrun 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.

This doesn't play well with tasks gruops and assets expressions:

Screen.Recording.2026-06-25.at.18.46.05.mov

Also I don't understand why just setting the 'rearrange' mode, directly changes the edges. I would expect them to remain the same until the user actually drag something and changes the layout

@BernardoGBS1

Copy link
Copy Markdown

Hey @pierrejeambrun,

We'll submit a fix for this very soon, thank you for bringing this issue to our attention.

Use React Flow parentId for expanded task group children so their positions stay relative to the group.

Preserve absolute ELK edge coordinates and make manual collision checks parent-aware.

Add regression coverage for open task groups and graph flattening.
@TomasCorreia2003

Copy link
Copy Markdown
Author

Hey @pierrejeambrun,

We have pushed some changes addressing the issues you mentioned. We have come up with a solution. Let us know if you still think something else could be improved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:translations area:UI Related to UI/UX. For Frontend Developers. ready for maintainer review Set after triaging when all criteria pass. translation:default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ability to manually move nodes in Graph View

7 participants