Skip to content
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

Use node suggestion API in node autocomplete UI #11132

Merged

Conversation

aparajit-pratap
Copy link
Contributor

Purpose

Call node suggestion API from node autocomplete UI.

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated

Reviewers

@QilongTang

FYIs

(FILL ME IN, Optional) Names of anyone else you wish to be notified of

@aparajit-pratap aparajit-pratap changed the title Nodeautocomplete2 Use node suggestion API in node autocomplete UI Sep 21, 2020

internal void PopulateAutoCompleteCandidates()
{
var searchElements = PortViewModel.GetMatchingNodes();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for moving it. But I was hoping we can move all of the code from PortViewModel to the customized search view model here given that 1. those code are not really related to PortView 2. I feel PortViewModel does not necessarily obtain knowledge about search elements 3. We still have access to DynamoViewModel from here. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't moved the code yet. Doing so now.

@@ -121,7 +121,8 @@ private void OnNodeAutoCompleteSearchControlVisibilityChanged(object sender, Dep
Dispatcher.BeginInvoke(new Action(() =>
{
SearchTextBox.Focus();
ViewModel.InitializeDefaultAutoCompleteCandidates();
//ViewModel.InitializeDefaultAutoCompleteCandidates();
ViewModel.PopulateAutoCompleteCandidates();
Copy link
Contributor

@QilongTang QilongTang Sep 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to consider returning the number of filtered results in PopulateAutoCompleteCandidates(), if the number is 0 which means we failed to find any match, then we still call InitializeDefaultAutoCompleteCandidates().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I commented this out was I noticed issues with this. On a mouse up, the node suggestion list was reverting to this default list each time.

@aparajit-pratap aparajit-pratap merged commit 319d858 into DynamoDS:NodeAutoComplete Sep 21, 2020
QilongTang added a commit that referenced this pull request Sep 29, 2020
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants