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

Introduce NodeAutoComplete Feature #11120

Merged
merged 20 commits into from
Sep 29, 2020
Merged

Introduce NodeAutoComplete Feature #11120

merged 20 commits into from
Sep 29, 2020

Conversation

QilongTang
Copy link
Contributor

@QilongTang QilongTang commented Sep 15, 2020

Please Note:

  1. Before submitting the PR, please review How to Contribute to Dynamo
  2. Dynamo Team will meet 1x a month to review PRs found on Github (Issues will be handled separately)
  3. PRs will be reviewed from oldest to newest
  4. If a reviewed PR requires changes by the owner, the owner of the PR has 30 days to respond. If the PR has seen no activity by the next session, it will be either closed by the team or depending on its utility will be taken over by someone on the team
  5. PRs should use either Dynamo's default PR template or one of these other template options in order to be considered for review.
  6. PRs that do not have one of the Dynamo PR templates completely filled out with all declarations satisfied will not be reviewed by the Dynamo team.
  7. PRs made to the DynamoRevit repo 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 a LGTM label is added to the PR.

Purpose

Introduce NodeAutoComplete Feature leveraging type matching

NodeAutocompleteCandidates_v3

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

@DynamoDS/dynamo

FYIs

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

@QilongTang QilongTang changed the title [Draft PR] NodeAutoComplete Initial Commit Introduce NodeAutoComplete Feature Sep 18, 2020
@QilongTang QilongTang marked this pull request as ready for review September 18, 2020 18:26
QilongTang and others added 5 commits September 18, 2020 16:46
* 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
* Moving GetMatchingNodes API to search view model

* Clean Up

* Comments

* Create a dedicated test file to prepare for more unit tests
@QilongTang
Copy link
Contributor Author

@aparajit-pratap @mmisol @reddyashish @reddyashish Any other comments I can address for you?

{
ListBoxItem HighlightedItem;

internal event Action<ShowHideFlags> RequestShowNodeAutoCompleteSearch;
Copy link
Contributor

Choose a reason for hiding this comment

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

@QilongTang where is this event registered? How does it work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

That is the call but what method is it registered with? Which method gets called eventually?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it does anything currently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This need to be done on workspace level because we are monitoring all the left click on WS level, so when user left click on anywhere else will dismiss the node autocomplete search bar

Copy link
Contributor

Choose a reason for hiding this comment

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

How is this different from RequestNodeAutoCompleteSearch defined on WorkspaceViewModel?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sry been so long since I wrote this, I debugged and believe it is leveraged as event driven here : https://github.com/DynamoDS/Dynamo/blob/NodeAutoComplete/src/DynamoCoreWpf/Views/Core/WorkspaceView.xaml#L355

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My memory faded so my answer may not be clear before.. There are several kinds of show/hide request handled by different events on different level

  1. request to show by alt+ left click
  2. request to hide by left click on canvas
  3. request to hide when window deactivated, e.g. user switched back to Revit, etc

These requests and events was handled on different level for in-canvas search so I inherited the same architecture, hopefully this answers your questions

@QilongTang
Copy link
Contributor Author

@aparajit-pratap Let me know if you have more thoughts

Copy link
Contributor

@aparajit-pratap aparajit-pratap left a comment

Choose a reason for hiding this comment

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

@QilongTang just one last question and then I think this looks good for now. Are you going to merge this into master?

@QilongTang
Copy link
Contributor Author

QilongTang commented Sep 29, 2020

@aparajit-pratap Addressed your comments! No wonder the window deactivate -> hide node autocomplete search bar workflow did not work for me.. The workflow itself is hard to debug so I thought it was debugging issue. Yes I intend to merge to master, since this is guarded by the preference setting and default to false without introducing new dll to our core delivery, I think these changes should be safe.

@QilongTang QilongTang merged commit 672f94f into master Sep 29, 2020
@QilongTang QilongTang deleted the NodeAutoComplete branch September 29, 2020 18:21
@QilongTang
Copy link
Contributor Author

All tests passed, merging

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