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

Dyn-5473 workspace toolbar #14483

Merged
merged 5 commits into from
Oct 23, 2023
Merged

Dyn-5473 workspace toolbar #14483

merged 5 commits into from
Oct 23, 2023

Conversation

jesusalvino
Copy link
Contributor

Purpose

Implementing the Tech debt https://jira.autodesk.com/browse/DYN-5473 to deal with the Toolbar overlapping over the workspace tabs.

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
  • This PR contains no files larger than 50 MB

Reviewers

@QilongTang
@reddyashish

FYIs

@RobertGlobant20
@Enzo707

@jesusalvino
Copy link
Contributor Author

jesusalvino commented Oct 13, 2023

@@ -830,11 +830,19 @@ void Watch3DViewModelPropertyChanged(object sender, PropertyChangedEventArgs e)
}
}

internal event EventHandler WindowRezised;
internal void OnWindowResized(object lessthan1000)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a good idea to have numerics in variable name. Change to something else?

this.dynamoViewModel.RequestReturnFocusToView += OnRequestReturnFocusToView;
this.dynamoViewModel.Model.WorkspaceSaving += OnWorkspaceSaving;
this.dynamoViewModel.Model.WorkspaceOpened += OnWorkspaceOpened;
this.dynamoViewModel.Model.WorkspaceAdded += OwnWorkspaceAdded;
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo OnWorkspaceAdded*


private void DynamoViewModel_WindowRezised(object sender, System.EventArgs e)
{
ViewButtonsText = !(bool)sender;
Copy link
Contributor

@reddyashish reddyashish Oct 13, 2023

Choose a reason for hiding this comment

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

It would be good to make validate that a bool value is passed here, otherwise the casting will throw an exception.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can use Show/HideText, it is not guaranteed a button either, right? One of the case is a menu item

CalculateWindowThreshold();
}

internal void CalculateWindowThreshold()
Copy link
Contributor

Choose a reason for hiding this comment

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

Comments, what does it do?

dynamoViewModel.OnWindowResized(dynamoViewModel.Model.PreferenceSettings.WindowW <= threshold);
}

internal void CalculateWindowMinWidth()
Copy link
Contributor

Choose a reason for hiding this comment

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

Comments, what does it do?


public ShortcutToolbarViewModel(DynamoViewModel dynamoViewModel)
{
NotificationsNumber = 0;
authManager = dynamoViewModel.Model.AuthenticationManager;
ValidateWorkSpaceBeforeToExportAsImageCommand = new DelegateCommand(dynamoViewModel.ValidateWorkSpaceBeforeToExportAsImage);
SignOutCommand = new DelegateCommand(authManager.ToggleLoginState);
authManager.LoginStateChanged += (o) => { RaisePropertyChanged(nameof(LoginState)); };
authManager.LoginStateChanged += (o) => { RaisePropertyChanged(nameof(LoginState)); };
dynamoViewModel.WindowRezised += DynamoViewModel_WindowRezised;
Copy link
Contributor

Choose a reason for hiding this comment

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

unsubscribe?

@@ -70,5 +78,18 @@ public bool IsNotificationsCounterVisible
return true;
}
}

public bool ViewButtonsText
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update name and add comments as suggested above

@avidit avidit changed the title Dyn 5473 workspace toolbar Dyn-5473 workspace toolbar Oct 16, 2023
@reddyashish reddyashish added this to the 3.0 milestone Oct 19, 2023
@reddyashish
Copy link
Contributor

@jesusalvino It looks like there are failures on this PR. Can you take a look at it once.

1 similar comment
@reddyashish
Copy link
Contributor

@jesusalvino It looks like there are failures on this PR. Can you take a look at it once.

@jesusalvino
Copy link
Contributor Author

@jesusalvino It looks like there are failures on this PR. Can you take a look at it once.

that's weird, lot of tests failed but most of them passed locally, anyway already started them on the master-15

@@ -70,5 +81,24 @@ public bool IsNotificationsCounterVisible
return true;
}
}

public bool ShowMenuItemText
Copy link
Contributor

Choose a reason for hiding this comment

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

comments please

@@ -101,6 +103,8 @@ public partial class DynamoView : Window, IDisposable
get { return preferencesWindow; }
}

internal double DefaultMinWidth = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

comments please, especially this is defined in DynamoView

@@ -84,6 +84,8 @@ public partial class DynamoView : Window, IDisposable
private bool isPSSCalledOnViewModelNoCancel = false;
private readonly DispatcherTimer _workspaceResizeTimer = new DispatcherTimer { Interval = new TimeSpan(0, 0, 0, 0, 500), IsEnabled = false };
private ViewLoadedParams sharedViewExtensionLoadedParams;
private double toolBarRightMenuWidth = 0;
private double additionalWidth = 50;
Copy link
Contributor

Choose a reason for hiding this comment

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

comments please, especially this is defined in DynamoView

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 last comments, as long as regressions are addressed

@jesusalvino
Copy link
Contributor Author

Some last comments, as long as regressions are addressed

Done

@QilongTang QilongTang merged commit bdc6ba4 into DynamoDS:master Oct 23, 2023
16 of 17 checks passed
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