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

Adjust the node position when a Node-Autocompletion element is connected. #11775

Merged
merged 4 commits into from
Jun 23, 2021

Conversation

reddyashish
Copy link
Contributor

Purpose

This PR is to adjust the position of the new nodes that are created from Node-Autocompletion functionality.

In the current algorithm, the X-axis position of the new node is relative to position of the port and that looks fine. But the Y-axis position of the new node was not being set relative to parent node so that is set accordingly in these changes. If the input node is a slider, we want to adjust the X-axis position(move left) to compensate for the extra width of the slider node. For all other nodes, the current algorithm works fine.

For the output port, we need a solution to handle placement of multiple nodes as it will be hard to compute how many nodes are already connected to that port and based on that we will need to set the location of the new node. @zeusongit are you covering this part in your task?

Before:

NodeAutocomplete_NotHonoringLocationOfNode.mov

After:
NodeAutocompletion node alignment

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 @zeusongit @Amoursol

@reddyashish reddyashish changed the title Adjust the position for Node-Autocompletion elements. Adjust the node position when a Node-Autocompletion element is connected. Jun 22, 2021
@@ -278,16 +279,22 @@ protected virtual void CreateAndConnectToPort(object parameter)

// Create a new node based on node creation name and connection ports
dynamoViewModel.ExecuteCommand(new DynamoModel.CreateAndConnectNodeCommand(id, initialNode.GUID,
Model.CreationName, 0, Model.AutoCompletionNodeElementInfo.PortToConnect, adjustedX, 0, createAsDownStreamNode, false, true));
Model.CreationName, 0, Model.AutoCompletionNodeElementInfo.PortToConnect, adjustedX, adjustedY, createAsDownStreamNode, false, true));
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we made the adjusted Y 0 on purpose, @aparajit-pratap @zeusongit can you confirm? Maybe we thought the auto layout algorithm will simply solve that? Anyway, the solution here looks simple enough to be consistent

Copy link
Contributor

@zeusongit zeusongit Jun 22, 2021

Choose a reason for hiding this comment

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

There was some back-and-forth on this I remember. But I dont recall the problem. Anyway it seems to work fine at the moment.

Copy link
Contributor

@QilongTang QilongTang left a comment

Choose a reason for hiding this comment

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

Some small comments, the end results looks quite appealing

@Amoursol
Copy link
Contributor

@reddyashish looks much better! 😊 Can you please check in the zoomed out way on the new PR to see if it still behaves correctly?

@reddyashish
Copy link
Contributor Author

@Amoursol yes verified that the new node is created relative to the node sizes in the workspace(zoomed in/out).

@reddyashish
Copy link
Contributor Author

Merging this. Will have to verify if these changes cause of any of UI automation tests to fail.

@reddyashish reddyashish merged commit 18a112a into DynamoDS:master Jun 23, 2021
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.

4 participants