-
Notifications
You must be signed in to change notification settings - Fork 634
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
//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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mmisol Did you test that downstream node can be also reverted back to the previous state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow. Could you mention the steps of the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok. Yes, I tested that and it works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
*.resx
files