CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 658
DYN-4361: enabled clipboard copy for preview bubbles and watch nodes #15844
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
DYN-4361: enabled clipboard copy for preview bubbles and watch nodes #15844
Conversation
- enabled clipboard copy on Ctrl+C for info bubbles and watch nodes - added test coverage
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.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-4361
So far testing locally with copying various data and arrow key navigation, this looks pretty good to me. |
{ | ||
if (prevWatchViewModel != null) | ||
if (prevWatchViewModel != null || Models.DynamoModel.IsTestMode) |
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.
Is prevWatchViewModel
value null when in TestMode?
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.
no it shouldn't be null.
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.
then I am confused, why add the IsTestMode
condition?
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.
It was null, yes. At least when reusing the design pattern of the existing watchnode/info-bubble tests. I didn't feel I should go out of my way to look into creating the view model, as this solution worked and I have used it (bypassing checks based on Dynamo.IsTestMode
) in the past in similar circumstances.
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.
All tests of this test suite passed locally as well.
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.
@dnenov Thank you for the new changes, looks clean and better.
Is there any unit test present for this functionality? Which tests are being affected, causing the need for IsTestMode check.
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 will remove the IsTestMode
, you are right! Apologies.
Is this going to be in 3.5? |
Yes |
@@ -34,6 +43,8 @@ public WatchTree(WatchViewModel vm) | |||
DataContext = vm; | |||
this.Loaded += WatchTree_Loaded; | |||
this.Unloaded += WatchTree_Unloaded; | |||
|
|||
_ctrlResetTimer.Tick += _ctrlResetTimer_Tick; |
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.
We are using this pattern inside the DynamoView (_workspaceResizeTimer.Tick += _resizeTimer_Tick;
) without unsubscribing, I assumed this is safe.
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.
Can we unsubscribe to it? If possible? Probably add a Dispose method?
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.
Of course. The Watchnode does not have a Dispose
, but a similar thing is happening inside the Loaded/Unloaded handlers.
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.
@zeusongit I removed the timer altogether. Sporadic tests were failing, I don't know if that was due to a leak, but I was able to remove the timer while tinkering. Sadly, I cannot figure out a way to test for the Keyboard.Modifiers
combination, as far as I can see it's impossible to set that programmatically. So I don't have a way of Unit testing that functionality. I don't know if we have a different framework for Integration tests that we use to simulate clicks and user interactions, but probably that would be the way to do it.
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.
Thanks @dnenov, I was iffy with the timer approach myself, so thanks for looking into it. I will ask if this is something AGT tests can cover.
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.
Definitely ^
- moved subscribe/unsubscribe from timer events inside the loaded/unloaded parts of the watchnode
@dnenov One failed test that looks new, Dynamo.Tests.SerializationTests.InPortDescriptionDeserilizationTest |
…d-copy-watchnode
- tooltip text change for the color node was causing a test to fail, fixing that although it's not part of the scope of this PR
I fixed the test, although it was not related to this PR. Now a different test is failing, which passes locally Could it be that changes to the master are interfering? This PR should not be affecting these tests. |
- now uses `Keyboard.Modifiers ` to detect Ctrl+C combination, which eliminates the need for a timer altogether - no longer able to do a wpf test, I found it impossible to simulate the hardware keyboard.modifiers necessary for the test to run
RemovesScriptTagsFromLoadedHtml has been flaky on CI jobs. |
@@ -782,7 +782,7 @@ public void InPortDescriptionDeserilizationTest() | |||
Assert.AreEqual(ztNode.InPorts.First().ToolTip, "1st point of arc\n\nPoint"); | |||
|
|||
var nodeModelNode = this.CurrentDynamoModel.CurrentWorkspace.Nodes.Where(x => x.GUID == new Guid("c848cc3cb24a477f8248e53fc9304cc1")).First(); | |||
Assert.AreEqual(nodeModelNode.InPorts.First().ToolTip, "List of colors to include in the range"); | |||
Assert.AreEqual(nodeModelNode.InPorts.First().ToolTip, "List of colors to include in the range (disabled)"); |
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.
Why is this changed?
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.
Is this for fixing the unrelated failing test? https://master-5.jenkins.autodesk.com/job/Dynamo/job/DynamoSelfServe/job/pullRequestValidation/17216/testReport/Dynamo.Tests/SerializationTests/InPortDescriptionDeserilizationTest/
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 don't think this is the expected fix here @dnenov , need to dig why and when was the tooltip changed. Also I think the expected and actual variables are inverted in 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.
Yes, it looks to me that this tooltip recently changed - I think it's on the Color node, or similar. And it's hard-coded inside the test, so that's the fix of it.
- remove unnecessary code
Purpose
Addresses the following Jira issue - Enable Ctrl + C to copy selected data out of preview bubbles/watch nodes
The solution was not as straightforward as the text nodes to copy from were children of a
TreeView
element.TreeViewItem
manipulation, which was already working to enable the up/down navigation.Ctrl
occurrences.Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
Reviewers
@achintyabhat
@reddyashish
@zeusongit
FYIs
@QilongTang
@johnpierson