- Notifications
You must be signed in to change notification settings - Fork1.4k
Collapsed subprocess paste & undo bugfix#2275
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:develop
Are you sure you want to change the base?
Conversation
…ollapsed subprocess
chore(test): remove incorrect attributes from fixture diagram
de8e5d6
to0a7dd88
CompareI've spent some more time debugging this and updated the top comment with my latest conclusions. The proposed solution of moving children elements after
I'd like to come back to this in a paired debugging session. cc.@barmac@nikku |
@jarekdanielak It seems like this PR stalled, and we did not get time to look into it. I'm moving it (and the linked issue) to |
Uh oh!
There was an error while loading.Please reload this page.
Problem
If you copy & paste a collapsed subprocess with some elements inside and try to undo this action, editor crashes.
Root cause
When a collapsed subprocess is pasted,
elements.create
command is triggered and triggers following actions:shape.create
for a new subprocess element.elements.move
for subprocess children (triggered post-shape.create
by `SubProcessPlaneBehavior)shape.create
for each child.When this action is being undone, subprocess children are first removed (revert
shape.create
) and then are attempted to be moved back to their original parent/position (revertelements.move
) which doesn't make sense as those elements are already removed.Proposed solution
I believe the correct implementation of subprocess plane behavior should move the elements onto the new plane after they are all created, so on
postExecuted
ofelements.create
instead ofshape.create
.This pull requests does it and therefore solve the paste & undo bug.
New problem
Unfortunately, the subprocess element in the
context
ofelements.create
handler doesn't have all its children. It's missing labels and text annotations. Those elements are still copied, but remain hidden on the root plane.Additional context
Initial discussion and debugging session:bpmn-io/diagram-js#957 (comment).
Closes#2269
Checklist
To ensure you provided everything we need to look at your PR:
@bpmn-io/sr
toolCloses {LINK_TO_ISSUE}
orRelated to {LINK_TO_ISSUE}