-
Notifications
You must be signed in to change notification settings - Fork 668
Moving GetMatchingNodes API to search view model #11146
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <aparajit.pratap@autodesk.com>
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