Moving GetMatchingNodes API to search view model#11146
Moving GetMatchingNodes API to search view model#11146QilongTang merged 4 commits intoNodeAutoCompletefrom
Conversation
| var suggestions = inPorts[1].GetMatchingNodes(); | ||
| var searchViewMode = (ViewModel.CurrentSpaceViewModel.NodeAutoCompleteSearchViewModel as NodeAutoCompleteSearchViewModel); | ||
| searchViewMode.PortViewModel = inPorts[1]; | ||
| var suggestions = searchViewMode.GetMatchingNodes(); |
There was a problem hiding this comment.
@aparajit-pratap And team, curious about your thoughts here. IMHO, the reasons I would like to move this API are below
- The API is about PortView logic.
- The API is getting
NodeSearchElementwhich is more tightly connected to search view model. - We may even want to rename the API based on the reason above.
- Still unit testable this way.
There was a problem hiding this comment.
I'm okay either way. I don't feel strongly about moving it if it's mainly for the reason that it returns NodeSearchElement. We could also make it return plain strings or something else and wrap them into NodeSearchElements inside of PopulateAutocomplateCandidates if that's the concern :)
There was a problem hiding this comment.
Maybe the latter statement I made is not so straightforward; it's easier to just return NodeSearchElement from the API so I'm okay with this change.
There was a problem hiding this comment.
On the opposite I think the current implementation is quite clean, but in the future since we may introduce ML module dependencies, I would rather not put this API under PortViewModel :)
* Initial Commit of NodeAutoComplete MVP * Clean Up * Fix a bug that left over search term was kept for next trigger * Changed to use alt + mouse left key down and change cursor to adapt to connection mode * Fix the in canvas node auto complete glitching issue with a click suppress * Comments * preference setting test * Add test * New Node AutoComplete * Comments * Comments * Use node suggestion API in node autocomplete UI (#11132) * update code comment * add APIs to return matching nodes for input ports * revert temporary changes made for testing * cleanup * merge api with UI * revert unwanted changes * Add null-check (#11144) * add null-check * Clean Up * Moving GetMatchingNodes API to search view model (#11146) * Moving GetMatchingNodes API to search view model * Clean Up * Comments * Create a dedicated test file to prepare for more unit tests * Comments * Comments * Comments * Comments Co-authored-by: aparajit-pratap <[email protected]>
Please Note:
DynamoRevitrepo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after aLGTMlabel is added to the PR.Purpose
Proposed changes to move GetMatchingNodes API to
NodeAutoCompleteSearchViewModelDeclarations
Check these if you believe they are true
*.resxfilesReviewers
@DynamoDS/dynamo
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of