DYN-8494 - Group Cluster Node and Wire Creation into One Undo#16148
DYN-8494 - Group Cluster Node and Wire Creation into One Undo#16148QilongTang merged 9 commits intoDynamoDS:masterfrom
Conversation
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-8494
| RecordUndoModels(wsViewModel.Model, newNodesAndWires); | ||
| } | ||
|
|
||
| private void RecordUndoModels(WorkspaceModel workspace, List<ModelBase> undoItems) |
There was a problem hiding this comment.
Saw a similar implementation somewhere else, maybe we dont have to repeat it and can put this as a utility function in the DynamoUtility class/project?
There was a problem hiding this comment.
I went ahead and reused the method from the DynamoModel (where it is currently).
|
|
||
|
|
||
| RecordUndoGraphLayout(workspace, isGroupLayout, reuseUndoRedoGroup); | ||
| //only record graph layout undo when it is not node autocomplete |
There was a problem hiding this comment.
Curious what does this mean?
There was a problem hiding this comment.
Since we are using the layout method that exists in Dynamo already, it adds an undo for the auto layout. So if we skip it when triggered from node autocomplete it helps minimize the undos
| dynamoViewModel.Model.ExecuteCommand(new DynamoModel.CreateNodeCommand(Guid.NewGuid().ToString(), typeInfo.FullName, xoffset, node.NodeModel.Y, false, false)); | ||
|
|
||
| //disallow the node creation command from the undo group, we group node creation and wires below | ||
| wsViewModel.Model.UndoRecorder.PopFromUndoGroup(); |
There was a problem hiding this comment.
oh interesting, I guess with this we can keep the current implementation with commands?
Purpose
This PR expands upon DYN-8494 by grouping actions within the cluster creation into one undo group. It also disallows undo of clusters that were previewed, but not used.
Also related to DYN-8632
Behavior Before:

Behavior Now:


Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
N/A
Reviewers
@BogdanZavu (after vacation) @QilongTang @chubakueno
FYIs
@Amoursol @Jingyi-Wen