From 2f0e081e90d08c5d0df42dca90da3a013423f5cd Mon Sep 17 00:00:00 2001 From: JT Date: Tue, 12 Mar 2024 23:16:43 -0700 Subject: [PATCH 1/2] - Fixed crash on startup when library directory is not set - Fixed One-Click install progress dialog not disappearing after completion - Fixed ComfyUI with Inference pop-up during one-click install appearing below the visible scroll area - Made PackageModificationRunner's ModificationCompleteMessage a required property - Made the initial window size bigger to account for the size of the new one click installer dialog --- CHANGELOG.md | 5 ++- .../DesignData/DesignData.cs | 3 +- .../Dialogs/NewOneClickInstallViewModel.cs | 7 +++- .../Dialogs/OneClickInstallViewModel.cs | 7 +++- .../ViewModels/PackageManagerViewModel.cs | 2 +- .../Dialogs/NewOneClickInstallDialog.axaml | 39 +++++++++++++++++++ .../Views/MainWindow.axaml | 4 +- .../Models/PackageDifficulty.cs | 12 +++--- .../IPackageModificationRunner.cs | 2 +- .../PackageModificationRunner.cs | 2 +- .../Models/Packages/ComfyUI.cs | 2 +- .../Models/Packages/SDWebForge.cs | 2 + 12 files changed, 72 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da50b733..32366334 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2 ## v2.10.0-dev.3 ### Fixed -- Fix model download location options for VAEs in the CivitAI Model Browser +- Fixed model download location options for VAEs in the CivitAI Model Browser +- Fixed crash on startup when library directory is not set +- Fixed One-Click install progress dialog not disappearing after completion +- Fixed ComfyUI with Inference pop-up during one-click install appearing below the visible scroll area ## v2.10.0-dev.2 ### Added diff --git a/StabilityMatrix.Avalonia/DesignData/DesignData.cs b/StabilityMatrix.Avalonia/DesignData/DesignData.cs index d6e74cbd..f6d7d011 100644 --- a/StabilityMatrix.Avalonia/DesignData/DesignData.cs +++ b/StabilityMatrix.Avalonia/DesignData/DesignData.cs @@ -417,7 +417,8 @@ public static class DesignData new PackageInstallProgressItemViewModel( new PackageModificationRunner { - CurrentProgress = new ProgressReport(0.5f, "Installing package...") + CurrentProgress = new ProgressReport(0.5f, "Installing package..."), + ModificationCompleteMessage = "Package installed successfully" } ) } diff --git a/StabilityMatrix.Avalonia/ViewModels/Dialogs/NewOneClickInstallViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/Dialogs/NewOneClickInstallViewModel.cs index 197c17da..f6164bd0 100644 --- a/StabilityMatrix.Avalonia/ViewModels/Dialogs/NewOneClickInstallViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/Dialogs/NewOneClickInstallViewModel.cs @@ -75,7 +75,7 @@ public partial class NewOneClickInstallViewModel : ContentDialogViewModelBase .Connect() .DeferUntilLoaded() .Filter(incompatiblePredicate) - .Filter(p => p.OfferInOneClickInstaller || ShowIncompatiblePackages) + .Filter(p => p.OfferInOneClickInstaller) .Sort( SortExpressionComparer .Ascending(p => p.InstallerSortOrder) @@ -85,6 +85,10 @@ public partial class NewOneClickInstallViewModel : ContentDialogViewModelBase .Subscribe(); AllPackagesCache.AddOrUpdate(packageFactory.GetAllAvailablePackages()); + if (ShownPackages.Count > 0) + return; + + ShowIncompatiblePackages = true; } [RelayCommand] @@ -182,6 +186,7 @@ public partial class NewOneClickInstallViewModel : ContentDialogViewModelBase { ShowDialogOnStart = false, HideCloseButton = false, + ModificationCompleteMessage = $"{installedPackage.DisplayName} Install Complete", }; runner diff --git a/StabilityMatrix.Avalonia/ViewModels/Dialogs/OneClickInstallViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/Dialogs/OneClickInstallViewModel.cs index 0e28b8fd..d815fb12 100644 --- a/StabilityMatrix.Avalonia/ViewModels/Dialogs/OneClickInstallViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/Dialogs/OneClickInstallViewModel.cs @@ -192,7 +192,12 @@ public partial class OneClickInstallViewModel : ContentDialogViewModelBase var addInstalledPackageStep = new AddInstalledPackageStep(settingsManager, installedPackage); steps.Add(addInstalledPackageStep); - var runner = new PackageModificationRunner { ShowDialogOnStart = true, HideCloseButton = true, }; + var runner = new PackageModificationRunner + { + ShowDialogOnStart = true, + HideCloseButton = true, + ModificationCompleteMessage = "Install complete" + }; EventManager.Instance.OnPackageInstallProgressAdded(runner); await runner.ExecuteSteps(steps); diff --git a/StabilityMatrix.Avalonia/ViewModels/PackageManagerViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/PackageManagerViewModel.cs index dfe8757a..9d59df05 100644 --- a/StabilityMatrix.Avalonia/ViewModels/PackageManagerViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/PackageManagerViewModel.cs @@ -120,7 +120,7 @@ public partial class PackageManagerViewModel : PageViewModelBase public override async Task OnLoadedAsync() { - if (Design.IsDesignMode) + if (Design.IsDesignMode || !settingsManager.IsLibraryDirSet) return; installedPackages.EditDiff(settingsManager.Settings.InstalledPackages, InstalledPackage.Comparer); diff --git a/StabilityMatrix.Avalonia/Views/Dialogs/NewOneClickInstallDialog.axaml b/StabilityMatrix.Avalonia/Views/Dialogs/NewOneClickInstallDialog.axaml index d9b40644..8c818563 100644 --- a/StabilityMatrix.Avalonia/Views/Dialogs/NewOneClickInstallDialog.axaml +++ b/StabilityMatrix.Avalonia/Views/Dialogs/NewOneClickInstallDialog.axaml @@ -62,6 +62,27 @@ VerticalAlignment="Top"> + + + + + +