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

Add option to preview or hide preview of all geometry in a group and Fix top menu pixel difference #13702

Merged
merged 7 commits into from
Jan 26, 2023

Conversation

zeusongit
Copy link
Contributor

@zeusongit zeusongit commented Jan 23, 2023

Purpose

https://jira.autodesk.com/browse/DYN-5504

  • Fix one pixel difference in top menu bar.
  • Remove unused login grid from xaml.

Before:
image (1)

After:
Screenshot 2023-01-23 at 4 53 47 PM

https://jira.autodesk.com/browse/DYN-5257

  • Add an option to preview or hide preview of all geometry in a group
    • If the parent group is a nested group, then only nodes in the parent group will be affected.
    • Adding a new node/group to a group with preview disabled, will have no effect on the incoming node/group
    • Removing a node/group from a group with preview disabled, will retain its current state after ungrouping as well.

DynamoSandbox_2SXsm81AcE
DynamoSandbox_77vDHTzMB4

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

Release Notes

  • Add an option to preview or hide preview of all geometry in a group

Reviewers

@DynamoDS/dynamo

FYIs

@Amoursol @Jingyi-Wen

@zeusongit zeusongit added the WIP label Jan 23, 2023
@zeusongit zeusongit removed the WIP label Jan 25, 2023
@zeusongit zeusongit changed the title [WIP] Add option to preview or hide preview of all geometry in a group and Fix top menu pixel difference Add option to preview or hide preview of all geometry in a group and Fix top menu pixel difference Jan 25, 2023
Comment on lines -798 to -804
private double GetPortVerticalOffset(PortModel portModel, int proxyPortIndex)
{
// calculate the vertical offset based on the port index.
double portHeight = portModel.Height;
return verticalOffset + (proxyPortIndex * portHeight) + portVerticalMidPoint;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed because unused method

@zeusongit zeusongit marked this pull request as ready for review January 25, 2023 20:18
@@ -1348,6 +1361,27 @@ private bool BelongsToGroup()
return WorkspaceViewModel.Model.Annotations.ContainsModel(this.annotationModel);
}

internal void ToggleIsVisibleGroup(object parameters)
{
DynamoSelection.Instance.ClearSelection();
Copy link
Contributor

Choose a reason for hiding this comment

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

why is it necessary to clear the selection?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to clear any other groups/notes/nodes that may be present in the selection, as we only want to target the current group and its contents.

@filipeotero
Copy link
Contributor

LGTM with one question

@Amoursol
Copy link
Contributor

@zeusongit - can we please change the text here from "Preview" to "Preview Geometry"? And also make that change inside the single node variant of Preview? Should both simply be textual changes.

@zeusongit
Copy link
Contributor Author

Updated Menu Text
Screenshot 2023-01-26 at 2 02 47 PM
Screenshot 2023-01-26 at 2 02 54 PM

@zeusongit zeusongit merged commit 7262a78 into DynamoDS:master Jan 26, 2023
zeusongit added a commit to zeusongit/Dynamo that referenced this pull request Feb 6, 2023
…Fix top menu pixel difference (DynamoDS#13702)

* Adjust border to fix 1 pixel anomaly

* remove unused login grid

* add logic to toggle preview for group

* add analytics

* Preview > Preview Geometry

* ensure that signout option no seen when user sign out
@zeusongit zeusongit mentioned this pull request Feb 6, 2023
7 tasks
zeusongit added a commit that referenced this pull request Feb 7, 2023
* Dyn 5347 unified UI information icons (#13706)

* standardizing information icons in the preference settings

* Defending code (#13696)

* Defending code

* refining code

* Improve Package Manager search sort order (#13700)

* add search sort order

* Add option to preview or hide preview of all geometry in a group and Fix top menu pixel difference (#13702)

* Adjust border to fix 1 pixel anomaly

* remove unused login grid

* add logic to toggle preview for group

* add analytics

* Preview > Preview Geometry

* ensure that signout option no seen when user sign out

* DYN-4964-WorkingRange-Popup (#13656)

* DYN-4964-WorkingRange-Popup

I've added a new button in the Workspace that when is clicked will show a popup containing the working ranges and the one currently selected.
This new button will show a different image when the mouse is hover and when is clicked, also I've added a tooltip.
For implementing this functionality I've added a new Popup (GeometryScalingPopup.xaml) and it's corresponding ViewModel. Finally I've added a converter that will receive as a parameter the current Working Range and will return a Brush with a specific color so the checkmark will be visible or not.

* DYN-4964-WorkingRange-Popup CodeReview1

Added functionality for the new DefaultGeometryScaling property that will be serialized in the DynamoSettings.xml.
Also I've disconnected the functionality of selecting the Geometry Scale for the current Workspace in the Preferences panel, now will be selected from the Dynamo workspace and will be serialized in the dyn file (as currently is happening).

* DYN-4964-WorkingRange-Popup CodeReview1

Updated the string shown in Preferences panel (Geometry Scaling section) and the tooltip showed when the mouse is over the new Workspace button.

* Build Fix

When merging master to my branch there were some changed that I didn't noticed in the PR so I'm reverting back those changes.

* DYN-4964-WorkingRange-Popup CodeReview 2

Fixed several comments also several methods were removed (like RadioGeometryScaling_Checked method) or moved
The property GeoScalingViewModel was moved from DynamoViewModel to WorkspaceViewModel..
The property CurrentGeometryScaling was deleted due that was duplicating a functionality.

* DYN-4964-WorkingRange-Popup CodeReview 2

When changing the Workspace Geometry Scaling it was not running the graph so I did some changes so it will be running the graph every time is updated.

* DYN-4964-WorkingRange-Popup CodeReview 2

Add functionality for when a custom node is created the Workspace Scale Factor is set.
Updating and removing some comments and also I started to add the unit test.

* DYN-4964-WorkingRange-Popup CodeReview2

Updating Unit Test

* DYN-4964-WorkingRange-Popup Fixing Tests

I did the next fixes:
The test TestImportCopySettings() was failing due that was reading the DynamoSettings-NewSettings.xml and comparing against the properties in PreferencesSetting so the DefaultScaleFactor was missing in the DynamoSettings-NewSettings.xml file.

The test PreferencesGeoScaling_RunGraph_Automatic due that was opening the Preferences panel and changing the Geometry Scaling value for the workspace but now that this value was moved to the Workspace in a Popup then the code needed some changes so we can change the Geometry Scaling value using the Popup.

* Dyn 4964 popup geo scaling bugs (#13717)

* DYN-4964-PopupGeoScaling-Bugs

Fixing the next bugs reported by Aabi:
- The Popup was not closing when clicking in the Dynamo workspace (adding a similar fix like the Workspace ContextMenu).
- Adding a shadow over the new Geometry Scaling popup icon.

* DYN-4964-WorkingRange-Popup Bug fixes

There was a missing case that when the user click a Dynamo menu the Popup was not closing then I added some extra code to close it.

* DYN-4964-WorkingRange-Popup Bug Code Review1

Removing extra trailing spaces.

* Do not force user login for package search operation (#13725)

* restrict user login for pkg search

* check login state

* Revert "Dyn 4964 popup geo scaling bugs (#13717)"

This reverts commit 35005c3.

* Revert "DYN-4964-WorkingRange-Popup (#13656)"

This reverts commit a526390.

* Markdown procedural image location (#13693)

* Markdown procedural image location

- fixed hard-coded image location
- now identifies image location

* Fixed Failing Tests

- caught a bug causing issues when no image is present

* Revert "Markdown procedural image location (#13693)"

This reverts commit 299bbe9.

* Address review comments for 2.17.1 cherrypick PR (#13729)

---------

Co-authored-by: filipeotero <89042471+filipeotero@users.noreply.github.com>
Co-authored-by: jesusalvino <96534278+jesusalvino@users.noreply.github.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.

3 participants