Fix autocomplete popup - #3#11224
Conversation
|
I will also take a look at the test failure. |
| ViewModel.NodeAutoCompleteSearchViewModel.PortViewModel.SetupNodeAutocompleteWindowPlacement(popup); | ||
| } | ||
| popup.IsOpen = displayPopup; | ||
| popup.CustomPopupPlacementCallback = null; |
There was a problem hiding this comment.
Is this a must have or just sanity cleanup?
There was a problem hiding this comment.
Yes, otherwise the CustomPopupPlacementCallback continues pointing to PlaceAutocompletePopup, which can be invoked unexpectedly, say when in-canvas search popup is opened.
|
Changes here looks good to me, but we should fix the analytics somehow and make sure we unify the implementation between incanvas search and node autocomplete. @aparajit-pratap @zeusongit |
Where exactly would you suggest moving this to? |
|
* fix autocomplete popup - part 3 * revert unchanged file * fix failing test, fix analytics for node autocomplete * add null check * review comments
|
@aparajit-pratap Didn't you say the loaded function is not always called? Then why bring that implementation back? |
I'm not sure - it seems like it's now being invoked because the popup does appear every time after moving the placement from the loaded function to explicitly calling it here. If however, I move the call to place the popup back into the loaded function, it will not be called every time. |
|
@aparajit-pratap Regardless of that, the current implementation for analytics looks wrong in this PR because the if check below can't be removed for the analytics call, otherwise initialization of the control will also trigger analytics which gives us an extra use of node autocomplete everytime user launches Dynamo. Please add it back and to the cherry-pick PR. Thanks |
|
@QilongTang the above condition will always be true in the new case. |
Must be I was debugging the old version, but anyway this brings a bug that extra use is reported from analytics.. |
|
|
The loaded function is always called for me when Dynamo is started, see below gif I think that is why I was say earlier that let's move the tracking to https://github.com/DynamoDS/Dynamo/blob/master/src/DynamoCoreWpf/Controls/NodeAutoCompleteSearchControl.xaml.cs#L136 because visibility change is a safer place IMHO. Let me know, if you are not comfortable doing it, I can make a PR because the change need to be done for in canvas search as well. |
|
@QilongTang I'm not confident of how many times and when |
|
| } | ||
| } | ||
|
|
||
| internal double ActualHeight { get; set; } |
There was a problem hiding this comment.
Just curious, can you explain why these were needed?
There was a problem hiding this comment.
These were needed to get the exact height and width from the node view and exposed to the portviewmodel via the nodeviewmodel. The width and height are needed to compute the popup placement positioning.


Purpose
Attempt at fixing autocomplete popup placement one final time. Based on discussion with @zeusongit we decided that the
CustomPopupPlacementCallbackapproach seemed most promising that would work on most machines. This also fixes an existing issue where the autocomplete popup doesn't show up on opening a new workspace.Declarations
Check these if you believe they are true
*.resxfiles