Skip to content

Commit cbe7432

Browse files
authored
Merge pull request LykosAI#1067 from ionite34/fix-onloaded-stuff-analyzer
2 parents 51f53b5 + 06d036e commit cbe7432

29 files changed

+1328
-155
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
99
### Changed
1010
- Updated Inference Extra Networks (Lora / LyCORIS) base model filtering to consider SDXL variations (e.g., Noob AI / Illustrious) as compatible, unrecognized models or models with no base model will be considered compatible.
1111
- Changed hotkey for Inference prompt weight adjustment to (`⌘+Up`/`⌘+Down`) on macOS
12+
- Improved style consistency of Inference Prompt action buttons on top right
13+
- (Internal) Improved log console formatting & colorization for development
1214
### Fixed
1315
- Fixed Inference hotkey weight adjustment multi-line behavior, now works as expected like the first line.
1416
- Fixed updates to versions with commit hash version parts not being recognized when the current version has no commit hash part.
1517
- Fixed Inference Extra Networks card not updating with newly added model files.
1618
- Fixed incorrect ROCmLibs being installed for RX 6800/6800XT users of Comfy-Zluda or AMDGPU-Forge
1719
- Fixed missing text when missing localized versions for Italian and Chinese languages
20+
- Fixed Python Packages dialog errors and potentially other issues due to concurrent OnLoaded events
1821

1922
## v2.14.0
2023
### Added
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
</Project>

StabilityMatrix.Avalonia/Controls/BetterContentDialog.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,11 @@ private void OnLoaded(object? sender, RoutedEventArgs? e)
391391
}
392392

393393
// Also call the vm's OnLoad
394-
if (Content is Control { DataContext: ViewModelBase viewModel })
394+
// (UserControlBase handles this now, so we don't need to)
395+
/*if (Content is Control { DataContext: ViewModelBase viewModel })
395396
{
396397
viewModel.OnLoaded();
397398
Dispatcher.UIThread.InvokeAsync(viewModel.OnLoadedAsync).SafeFireAndForget();
398-
}
399+
}*/
399400
}
400401
}

StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,14 @@
164164
<ItemGroup>
165165
<ProjectReference Include="..\Avalonia.Gif\Avalonia.Gif.csproj" />
166166
<ProjectReference Include="..\StabilityMatrix.Core\StabilityMatrix.Core.csproj" />
167+
<ProjectReference Include="..\analyzers\StabilityMatrix.Analyzers\StabilityMatrix.Analyzers.csproj"
168+
PrivateAssets="all"
169+
ReferenceOutputAssembly="false"
170+
OutputItemType="Analyzer" />
171+
<ProjectReference Include="..\analyzers\StabilityMatrix.Analyzers.CodeFixes\StabilityMatrix.Analyzers.CodeFixes.csproj"
172+
PrivateAssets="all"
173+
ReferenceOutputAssembly="false"
174+
OutputItemType="Analyzer" />
167175
</ItemGroup>
168176

169177
<ItemGroup Condition="$(SM_IncludeLogWindow) == 'true'">

StabilityMatrix.Avalonia/ViewModels/Dialogs/ConfirmDeleteDialogViewModel.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.IO;
4-
using System.Threading.Tasks;
5-
using Avalonia.Controls.Primitives;
1+
using Avalonia.Controls.Primitives;
62
using CommunityToolkit.Mvvm.ComponentModel;
73
using CommunityToolkit.Mvvm.Input;
84
using Injectio.Attributes;

StabilityMatrix.Avalonia/ViewModels/Dialogs/DownloadResourceViewModel.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using System.Threading.Tasks;
3-
using Avalonia.Controls;
1+
using Avalonia.Controls;
42
using CommunityToolkit.Mvvm.ComponentModel;
53
using CommunityToolkit.Mvvm.Input;
64
using FluentAvalonia.UI.Controls;

StabilityMatrix.Avalonia/ViewModels/Dialogs/EnvVarsViewModel.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
using System;
2-
using System.Collections.ObjectModel;
1+
using System.Collections.ObjectModel;
32
using System.Diagnostics;
43
using Avalonia.Collections;
54
using CommunityToolkit.Mvvm.ComponentModel;
65
using CommunityToolkit.Mvvm.Input;
76
using Injectio.Attributes;
7+
using StabilityMatrix.Avalonia.Controls;
88
using StabilityMatrix.Avalonia.Languages;
99
using StabilityMatrix.Avalonia.ViewModels.Base;
10+
using StabilityMatrix.Avalonia.Views.Dialogs;
1011
using StabilityMatrix.Core.Attributes;
1112
using StabilityMatrix.Core.Models;
1213

1314
namespace StabilityMatrix.Avalonia.ViewModels.Dialogs;
1415

15-
[View(typeof(EnvVarsViewModel))]
16+
[View(typeof(EnvVarsDialog))]
1617
[ManagedService]
1718
[RegisterTransient<EnvVarsViewModel>]
1819
public partial class EnvVarsViewModel : ContentDialogViewModelBase
@@ -43,4 +44,15 @@ private void RemoveSelectedRow(int selectedIndex)
4344
Debug.WriteLine($"RemoveSelectedRow: Index {selectedIndex} out of range");
4445
}
4546
}
47+
48+
public override BetterContentDialog GetDialog()
49+
{
50+
var dialog = base.GetDialog();
51+
52+
dialog.PrimaryButtonText = Resources.Action_Save;
53+
dialog.IsPrimaryButtonEnabled = true;
54+
dialog.CloseButtonText = Resources.Action_Cancel;
55+
56+
return dialog;
57+
}
4658
}

StabilityMatrix.Avalonia/ViewModels/Dialogs/LaunchOptionsViewModel.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Collections.Immutable;
1+
using System.Collections.Immutable;
42
using System.ComponentModel;
5-
using System.Linq;
63
using System.Reactive.Linq;
7-
using System.Threading;
84
using CommunityToolkit.Mvvm.ComponentModel;
95
using FuzzySharp;
106
using Injectio.Attributes;
@@ -58,7 +54,7 @@ public partial class LaunchOptionsViewModel : ContentDialogViewModelBase
5854
{
5955
Title = text.ToLowerInvariant(),
6056
Type = LaunchOptionType.Bool,
61-
Options = Array.Empty<LaunchOption>()
57+
Options = Array.Empty<LaunchOption>(),
6258
};
6359

6460
var extracted = Process.ExtractTop(searchCard, Cards, c => c.Title.ToLowerInvariant());

StabilityMatrix.Avalonia/ViewModels/Dialogs/LykosLoginViewModel.cs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.ComponentModel.DataAnnotations;
1+
using System.ComponentModel.DataAnnotations;
42
using System.Net;
5-
using System.Threading.Tasks;
63
using CommunityToolkit.Mvvm.ComponentModel;
74
using CommunityToolkit.Mvvm.Input;
85
using FluentAvalonia.UI.Controls;
@@ -57,11 +54,11 @@ IServiceManager<ViewModelBase> vmFactory
5754

5855
public string SignupFooterMarkdown { get; } =
5956
"""
60-
By signing up, you are creating a
61-
[lykos.ai](https://lykos.ai) Account and agree to our
62-
[Terms](https://lykos.ai/terms-and-conditions) and
63-
[Privacy Policy](https://lykos.ai/privacy)
64-
""";
57+
By signing up, you are creating a
58+
[lykos.ai](https://lykos.ai) Account and agree to our
59+
[Terms](https://lykos.ai/terms-and-conditions) and
60+
[Privacy Policy](https://lykos.ai/privacy)
61+
""";
6562

6663
private bool CanExecuteContinueButtonClick()
6764
{
@@ -90,12 +87,11 @@ private async Task LoginAsync()
9087
{
9188
LoginError = e.StatusCode switch
9289
{
93-
HttpStatusCode.Unauthorized
94-
=> new AppException(
95-
"Incorrect email or password",
96-
"Please try again or reset your password"
97-
),
98-
_ => new AppException("Failed to login", $"{e.StatusCode} - {e.Message}")
90+
HttpStatusCode.Unauthorized => new AppException(
91+
"Incorrect email or password",
92+
"Please try again or reset your password"
93+
),
94+
_ => new AppException("Failed to login", $"{e.StatusCode} - {e.Message}"),
9995
};
10096
}
10197
}
@@ -136,7 +132,7 @@ public override TaskDialog GetDialog()
136132
dialog.Buttons = new List<TaskDialogButton>
137133
{
138134
GetCommandButton(Resources.Action_Continue, ContinueButtonClickCommand),
139-
GetCloseButton()
135+
GetCloseButton(),
140136
};
141137
return dialog;
142138
}

StabilityMatrix.Avalonia/ViewModels/Dialogs/UpdateViewModel.cs

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
using System;
2-
using System.IO;
3-
using System.Linq;
4-
using System.Net.Http;
5-
using System.Text.RegularExpressions;
6-
using System.Threading.Tasks;
1+
using System.Text.RegularExpressions;
72
using CommunityToolkit.Mvvm.ComponentModel;
83
using CommunityToolkit.Mvvm.Input;
9-
using DynamicData;
104
using Injectio.Attributes;
115
using Microsoft.Extensions.Logging;
126
using Semver;
137
using StabilityMatrix.Avalonia.Languages;
14-
using StabilityMatrix.Avalonia.Models;
158
using StabilityMatrix.Avalonia.ViewModels.Base;
169
using StabilityMatrix.Avalonia.Views.Dialogs;
1710
using StabilityMatrix.Core.Attributes;
@@ -254,21 +247,18 @@ internal async Task<string> GetReleaseNotes(string changelogUrl)
254247

255248
var results = pattern
256249
.Matches(markdown)
257-
.Select(
258-
m =>
259-
new
260-
{
261-
Block = m.Groups[1].Value.Trim(),
262-
Version = SemVersion.TryParse(
263-
m.Groups[2].Value.Trim(),
264-
SemVersionStyles.AllowV,
265-
out var version
266-
)
267-
? version
268-
: null,
269-
Content = m.Groups[3].Value.Trim()
270-
}
271-
)
250+
.Select(m => new
251+
{
252+
Block = m.Groups[1].Value.Trim(),
253+
Version = SemVersion.TryParse(
254+
m.Groups[2].Value.Trim(),
255+
SemVersionStyles.AllowV,
256+
out var version
257+
)
258+
? version
259+
: null,
260+
Content = m.Groups[3].Value.Trim(),
261+
})
272262
.Where(x => x.Version is not null)
273263
.ToList();
274264

@@ -288,8 +278,8 @@ out var version
288278
// Support for previous pre-release without changelogs
289279
if (currentVersionBlock == -1)
290280
{
291-
currentVersionBlock = results.FindIndex(
292-
x => x.Version == currentVersion.WithoutPrereleaseOrMetadata()
281+
currentVersionBlock = results.FindIndex(x =>
282+
x.Version == currentVersion.WithoutPrereleaseOrMetadata()
293283
);
294284

295285
// Add 1 if found to include the current release
@@ -308,15 +298,14 @@ out var version
308298
// Filter out pre-releases
309299
var blocks = results
310300
.Take(currentVersionBlock)
311-
.Where(
312-
x =>
313-
x.Version!.PrereleaseIdentifiers.Count == 0
314-
|| x.Version.PrereleaseIdentifiers[0].Value switch
315-
{
316-
"pre" when maxChannel >= UpdateChannel.Preview => true,
317-
"dev" when maxChannel >= UpdateChannel.Development => true,
318-
_ => false
319-
}
301+
.Where(x =>
302+
x.Version!.PrereleaseIdentifiers.Count == 0
303+
|| x.Version.PrereleaseIdentifiers[0].Value switch
304+
{
305+
"pre" when maxChannel >= UpdateChannel.Preview => true,
306+
"dev" when maxChannel >= UpdateChannel.Development => true,
307+
_ => false,
308+
}
320309
)
321310
.Select(x => x.Block);
322311

0 commit comments

Comments
 (0)