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 package states under dbg mode #11698

Merged
merged 8 commits into from
May 24, 2021
Merged

add package states under dbg mode #11698

merged 8 commits into from
May 24, 2021

Conversation

pinzart90
Copy link
Contributor

@pinzart90 pinzart90 commented May 20, 2021

Purpose

This PR adds package states to the Installed Packages UI.
The UI changes are not final, they UX is still under review.
I also changed around some of the wording used.

UI changes preview
image

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

(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)

(FILL ME IN, optional) Any additional notes to reviewers or testers.

FYIs

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

@@ -113,6 +114,60 @@ public bool MarkedForUninstall
internal set { markedForUninstall = value; RaisePropertyChanged("MarkedForUninstall"); }
}

public bool EnableOldMarkedForUnistallState
Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems that wpf can only bind to public properties...:(
If we want to have it under a debug mode first....we could just tag these temporary public methods...that they should not be used ..?

Copy link
Member

@mjkkirschner mjkkirschner May 20, 2021

Choose a reason for hiding this comment

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

yeah, one thing we've done in the past is to mark them obsolete immediately - it's confusing, but it let's people know to be wary.

Copy link
Contributor

Choose a reason for hiding this comment

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

seems that wpf can only bind to public properties...:(
If we want to have it under a debug mode first....we could just tag these temporary public methods...that they should not be used ..?

yeah, I am supportive of both. Obsolete tag with some comments works well, is there any rule if the team can remove obsolete tag within releases? @mjkkirschner

Copy link
Member

Choose a reason for hiding this comment

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

I don't see any harm to removing an obsolete method that we've explicitly called out as DO NOT USE.

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 see any harm to removing an obsolete method that we've explicitly called out as DO NOT USE.

Yes, that one I agree. I am curious about the case that we obsoleted something but decided that we want to keep it in the end, do we simply remove the obsolete tag?

Copy link
Member

@mjkkirschner mjkkirschner May 20, 2021

Choose a reason for hiding this comment

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

yep :) - Again, what case concerns you? if no one is using the member for fear it might be removed, then what break could keeping it cause?

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@pinzart90
Copy link
Contributor Author

pinzart90 commented May 20, 2021

Not sure about the HIG standards (yet) but this is how I chose to handle long texts:
The package state tag/label will have a max width of 150 pixels
The text will be trimmed after max width is exceeded.
The tooltips have more information : The full text form the label + details.

image
image

<data name="PackageStateUnloadedTooltip" xml:space="preserve">
<value>Skipped.
This package has not been loaded because another conflicting package was loaded before it.</value>
</data>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mjkkirschner @Amoursol @Jingyi-Wen
It has been brought to my attention that the terms used are not really consistent (like loaded vs installed)
What about using the following terms:

  1. Installed - package is loaded into Dynamo and ready to be used.
  2. Scheduled for uninstall - package will be uninstalled after next Dynamo restart.
  3. Skipped - package is available on disk but was not loaded into Dynamo due to conflict with another similar package.
  4. Error - package was not loaded into Dynamo due to an unexpected error

Also what do you think about scheduled vs marked ....for uninstall ?

If you have any alternatives....please tag them with the numbers above so that we know which one is which :)

Copy link
Member

@mjkkirschner mjkkirschner May 21, 2021

Choose a reason for hiding this comment

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

@pinzart @Jingyi-Wen What do you think about 3. Ignored? I mention it because I believe sometimes in our error messages and notifications we use the same term to describe packages that were not loaded. Either is fine with me though.

Copy link
Contributor

@aparajit-pratap aparajit-pratap May 21, 2021

Choose a reason for hiding this comment

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

  1. I would use Loaded vs. Installed since it implies that the package is downloaded as well as loaded in one word.
  2. I wish to clarify what it means to say Scheduled for uninstall - does it mean scheduled for unload or scheduled to be nuked? If not clear, we should probably change it to say Scheduled for deletion or Scheduled to be unloaded
  3. Instead of skipped why don't we just use the term Unloaded?

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 main concern, I guess, is about using Loaded/Unloaded vs Scheduled for uninstall.
What @aparajit-pratap is suggesting is consistent and I would say they seem fine to me

Choose a reason for hiding this comment

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

  1. I agree with @aparajit-pratap on using Loaded, since we call the window "Installed packages". And generally I think install and uninstall sounds more like user behaviors while load and unload sounds more like Dynamo behaviors
  2. Agree on Scheduled for unloaded or deletion. Same reason above
  3. Not loaded or Unloaded makes sense to me

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. I'm also in favour of Loaded as it uses stronger language (Installed could still theoretically fail to load)
  2. Scheduled for Uninstall/Unload/Deletion is still the one that feels most ambiguous, but I don't have a better suggestion. In lieu of that I would lean towards Scheduled for Deletion/Unload as above.
  3. Unloaded makes most sense to me here to match the inverse of the Loaded state.
  4. Error is perfect here - can the user see the error message and do something about it in this state @pinzart?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Amoursol Regarding the error state. Hopefully we can display something meaningful to the user....but that work will probably be a part of this jira task https://jira.autodesk.com/browse/DYN-3670

@pinzart90 pinzart90 added PTAL Please Take A Look 👀 and removed WIP labels May 21, 2021

/// <summary>
/// Looks up a localized string similar to Error.
///This package has not been installed due to an unexpected error..
Copy link
Contributor

Choose a reason for hiding this comment

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

Does installed mean downloaded and loaded here?

}

/// <summary>
/// Looks up a localized string similar to Scheduled for uninstall.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does Uninstall mean completely deleted here or just unloaded?

<data name="PackageStateUnloadedTooltip" xml:space="preserve">
<value>Skipped.
This package has not been loaded because another conflicting package was loaded before it.</value>
</data>
Copy link
Contributor

@aparajit-pratap aparajit-pratap May 21, 2021

Choose a reason for hiding this comment

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

  1. I would use Loaded vs. Installed since it implies that the package is downloaded as well as loaded in one word.
  2. I wish to clarify what it means to say Scheduled for uninstall - does it mean scheduled for unload or scheduled to be nuked? If not clear, we should probably change it to say Scheduled for deletion or Scheduled to be unloaded
  3. Instead of skipped why don't we just use the term Unloaded?

@@ -777,6 +778,10 @@ internal void SetPackageState(PackageDownloadHandle packageDownloadHandle, strin
Package dynPkg;
if (packageDownloadHandle.Extract(DynamoViewModel.Model, downloadPath, out dynPkg))
{
if (DebugModes.IsEnabled("DynamoPackageStates"))
{
dynPkg.PackageState = Package.PackageStates.Loaded;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we set this only after the call to LoadPackages?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm...I did not attempt to properly set all the states.
I only focused on the UI/UX side of it.

It may make sense to actually set the states in the PackageManagerExtension.PackageLoader ...since we may have more visibility into error states there. Or maybe some other notification system...Not sure yet

I can add a comment that this specific code is temporary...and should be moved somewhere else...And I can move it below as well

@@ -89,12 +89,30 @@
FontSize="11"
Foreground="#CCC"></TextBlock>
<TextBlock Text="{x:Static p:Resources.InstalledPackageViewPendingInstallButton}"
Visibility="{Binding Path=Model.MarkedForUninstall, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}"
Visibility="{Binding Path=Model.EnableOldMarkedForUnistallState, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Little confused here, why couldn't you simply change the implementation of the MarkedForUninstall property instead of introducing a new one?

Copy link
Contributor Author

@pinzart90 pinzart90 May 21, 2021

Choose a reason for hiding this comment

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

I introduced another property because MarkedForUninstall is used in other parts of Dynamo, not only used in the UI...and I did not want to break that existing functionality by introducing the DebugMode flag into the equation.
Basically, if I had done : bool MarkedForUninstall { get {return !DebugModes.IsActive() && isMarkedForUninstall; } } then, while having the DebugMode active, the other parts of the Dynamo that use MarkedForUninstall would not work anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MarkedForUninstall...should probably be replaced by the PackageStates ...when the implementation is ready

</data>
<data name="PackageStateErrorTooltip" xml:space="preserve">
<value>Unloaded.
This package has not been loaded due to an unexpected error.</value>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we can be more specific about the errors...once we know where/how to set the package states in the Dynamo code

</data>
<data name="PackageStateUnloadedTooltip" xml:space="preserve">
<value>Unloaded.
This package has not been loaded because another conflicting package was loaded before it.</value>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above, we may be able to specify which package caused the current one to get into an Unloaded state

@pinzart90 pinzart90 requested a review from aparajit-pratap May 21, 2021 20:33
@pinzart90
Copy link
Contributor Author

Latest screenshot
image

Copy link
Contributor

@sm6srw sm6srw left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

@pinzart90 pinzart90 merged commit f656121 into master May 24, 2021
@pinzart90 pinzart90 deleted the package_states branch May 24, 2021 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PTAL Please Take A Look 👀 UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants