Do not set execution hint on undo move#11519
Conversation
There were a couple of issues that were causing a node to be set to be executed on undoing an action that consisted of just a move: 1. The 'UsingDefaultValue' property was triggering a property changed even if the deserialized value was the same as the current. This was fixed by checking if the value is the same and not doing anything in that case. 2. Even if the 'IsFrozen' property for the current node had not changed an undo would mark the current and all downstream nodes as if they were modified. This was fixed by relying on the 'IsFrozen' property setter, which correctly handles the cases when the previous should be done.
| { | ||
| usingDefaultValue = value; | ||
| RaisePropertyChanged("UsingDefaultValue"); | ||
| RaisePropertyChanged("ToolTip"); |
There was a problem hiding this comment.
I like the fix here. Also curious does similar problem not exist for other properties, e.g. X, Y etc?
There was a problem hiding this comment.
Yes, this pattern is used in most places. For X and Y, I noticed they are deprecated and there is a Position which is a way to update both. Maybe that's the reason why it's different.
| { | ||
| // For Python nodes, changing the Engine property does not set the node Modified flag. | ||
| // This is done externally in all event handlers, so for Undo we do it here. | ||
| OnNodeModified(); |
| //undo is for toggling freeze. This is ONLY modifying the execution hint. | ||
| // this does not run the graph. | ||
| RaisePropertyChanged(nameof(IsFrozen)); | ||
| MarkDownStreamNodesAsModified(this); |
There was a problem hiding this comment.
Hi @mmisol Did you test that downstream node can be also reverted back to the previous state?
There was a problem hiding this comment.
I'm not sure I follow. Could you mention the steps of the test?
There was a problem hiding this comment.
Sure, if a node is frozen, the downstream nodes are also frozen. The original code seems taking care of correctly marking downstream nodes when undo freezing node as well. Just want to make sure the behavior is the same.
There was a problem hiding this comment.
Oh ok. Yes, I tested that and it works
QilongTang
left a comment
There was a problem hiding this comment.
LGTM with two questions
There were a couple of issues that were causing a node to be set to be executed on undoing an action that consisted of just a move: 1. The 'UsingDefaultValue' property was triggering a property changed even if the deserialized value was the same as the current. This was fixed by checking if the value is the same and not doing anything in that case. 2. Even if the 'IsFrozen' property for the current node had not changed an undo would mark the current and all downstream nodes as if they were modified. This was fixed by relying on the 'IsFrozen' property setter, which correctly handles the cases when the previous should be done.
There were a couple of issues that were causing a node to be set to be executed on undoing an action that consisted of just a move: 1. The 'UsingDefaultValue' property was triggering a property changed even if the deserialized value was the same as the current. This was fixed by checking if the value is the same and not doing anything in that case. 2. Even if the 'IsFrozen' property for the current node had not changed an undo would mark the current and all downstream nodes as if they were modified. This was fixed by relying on the 'IsFrozen' property setter, which correctly handles the cases when the previous should be done.
Purpose
There were a couple of issues that were causing a node to be set to be
executed on undoing an action that consisted of just a move:
The 'UsingDefaultValue' property was triggering a property changed
even if the deserialized value was the same as the current. This was
fixed by checking if the value is the same and not doing anything in
that case.
Even if the 'IsFrozen' property for the current node had not changed
an undo would mark the current and all downstream nodes as if they were
modified. This was fixed by relying on the 'IsFrozen' property
setter, which correctly handles the cases when the previous should be
done.
Declarations
Check these if you believe they are true
*.resxfiles