From 9242029ab71e4a51b46836e04a3cacd23aa781ec Mon Sep 17 00:00:00 2001 From: insomnious Date: Tue, 19 Nov 2024 13:31:55 +0000 Subject: [PATCH 01/18] WIP redesign of health check to move buttons to tabcontrol removed extra markup, moved tabcontrol styles to sep file --- .../Diagnostics/DiagnosticEntryView.axaml | 17 +- .../Diagnostics/List/DiagnosticListView.axaml | 111 ++++++------ .../List/DiagnosticListView.axaml.cs | 69 +++---- .../TabControl/TabControlStyles.axaml | 168 ++++++++++++++++++ .../Styles/StylesIndex.axaml | 1 + .../CollectionDownloadPageStyles.axaml | 102 +---------- .../Diagnostics/DiagnosticEntryStyles.axaml | 32 ++-- 7 files changed, 292 insertions(+), 208 deletions(-) create mode 100644 src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/TabControl/TabControlStyles.axaml diff --git a/src/NexusMods.App.UI/Controls/Diagnostics/DiagnosticEntryView.axaml b/src/NexusMods.App.UI/Controls/Diagnostics/DiagnosticEntryView.axaml index ade5d34571..84e7447a19 100644 --- a/src/NexusMods.App.UI/Controls/Diagnostics/DiagnosticEntryView.axaml +++ b/src/NexusMods.App.UI/Controls/Diagnostics/DiagnosticEntryView.axaml @@ -15,15 +15,12 @@ - - - - - - - - - - + + + + + + + diff --git a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml index 6671f71405..f410ac3ea0 100644 --- a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml +++ b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml @@ -10,69 +10,72 @@ xmlns:icons="clr-namespace:NexusMods.Icons;assembly=NexusMods.Icons" xmlns:resources="clr-namespace:NexusMods.App.UI.Resources" xmlns:diagnostics="clr-namespace:NexusMods.App.UI.Controls.Diagnostics" - mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" + mc:Ignorable="d" d:DesignWidth="1200" d:DesignHeight="450" x:Class="NexusMods.App.UI.Pages.Diagnostics.DiagnosticListView"> - - - - - + + + - - - - - - - + + + + + + + + + + - + - - - + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + - diff --git a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml.cs b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml.cs index baa8c9a4c4..8162cfe036 100644 --- a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml.cs +++ b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml.cs @@ -33,36 +33,41 @@ public DiagnosticListView() var total = numCritical + numWarnings + numSuggestions; // set button texts - AllDiagnosticsButtonText.Text = string.Format(Language.DiagnosticListView_DiagnosticListView_All, total); - CriticalDiagnosticsButtonText.Text = string.Format(Language.DiagnosticListView_DiagnosticListView_Critical, numCritical); - WarningDiagnosticsButtonText.Text = string.Format(Language.DiagnosticListView_DiagnosticListView_Warnings, numWarnings); - SuggestionDiagnosticsButtonText.Text = string.Format(Language.DiagnosticListView_DiagnosticListView_Suggestions, numSuggestions); + AllDiagnosticsTab.Header = string.Format(Language.DiagnosticListView_DiagnosticListView_All, total); + SuggestionDiagnosticsTab.Header = string.Format(Language.DiagnosticListView_DiagnosticListView_Suggestions, numSuggestions); + WarningDiagnosticsTab.Header = string.Format(Language.DiagnosticListView_DiagnosticListView_Warnings, numWarnings); + CriticalDiagnosticsTab.Header = string.Format(Language.DiagnosticListView_DiagnosticListView_Critical, numCritical); + + //AllDiagnosticsButtonText.Text = string.Format(Language.DiagnosticListView_DiagnosticListView_All, total); + //CriticalDiagnosticsButtonText.Text = string.Format(Language.DiagnosticListView_DiagnosticListView_Critical, numCritical); + //WarningDiagnosticsButtonText.Text = string.Format(Language.DiagnosticListView_DiagnosticListView_Warnings, numWarnings); + //SuggestionDiagnosticsButtonText.Text = string.Format(Language.DiagnosticListView_DiagnosticListView_Suggestions, numSuggestions); EmptyState.IsActive = total == 0; }) .DisposeWith(disposable); // toggle commands - this.BindCommand(ViewModel, - vm => vm.ToggleSeverityCommand, - view => view.CriticalDiagnosticsButton, - withParameter: Observable.Return(DiagnosticSeverity.Critical)) - .DisposeWith(disposable); - - this.BindCommand(ViewModel, - vm => vm.ToggleSeverityCommand, - view => view.WarningDiagnosticsButton, - withParameter: Observable.Return(DiagnosticSeverity.Warning)) - .DisposeWith(disposable); - - this.BindCommand(ViewModel, - vm => vm.ToggleSeverityCommand, - view => view.SuggestionDiagnosticsButton, - withParameter: Observable.Return(DiagnosticSeverity.Suggestion)) - .DisposeWith(disposable); - - this.BindCommand(ViewModel, vm => vm.ShowAllCommand, view => view.AllDiagnosticsButton) - .DisposeWith(disposable); + // this.BindCommand(ViewModel, + // vm => vm.ToggleSeverityCommand, + // view => view.CriticalDiagnosticsButton, + // withParameter: Observable.Return(DiagnosticSeverity.Critical)) + // .DisposeWith(disposable); + // + // this.BindCommand(ViewModel, + // vm => vm.ToggleSeverityCommand, + // view => view.WarningDiagnosticsButton, + // withParameter: Observable.Return(DiagnosticSeverity.Warning)) + // .DisposeWith(disposable); + // + // this.BindCommand(ViewModel, + // vm => vm.ToggleSeverityCommand, + // view => view.SuggestionDiagnosticsButton, + // withParameter: Observable.Return(DiagnosticSeverity.Suggestion)) + // .DisposeWith(disposable); + // + // this.BindCommand(ViewModel, vm => vm.ShowAllCommand, view => view.AllDiagnosticsButton) + // .DisposeWith(disposable); // filter changes this.WhenAnyValue(view => view.ViewModel!.Filter) @@ -76,17 +81,17 @@ public DiagnosticListView() if (showCritical && showWarnings && showSuggestions) { - AllDiagnosticsButton.Classes.Add(selectedClass); - CriticalDiagnosticsButton.Classes.Remove(selectedClass); - WarningDiagnosticsButton.Classes.Remove(selectedClass); - SuggestionDiagnosticsButton.Classes.Remove(selectedClass); + //AllDiagnosticsButton.Classes.Add(selectedClass); + //CriticalDiagnosticsButton.Classes.Remove(selectedClass); + //WarningDiagnosticsButton.Classes.Remove(selectedClass); + //SuggestionDiagnosticsButton.Classes.Remove(selectedClass); } else { - AllDiagnosticsButton.Classes.Remove(selectedClass); - CriticalDiagnosticsButton.Classes.ToggleIf(selectedClass, showCritical); - WarningDiagnosticsButton.Classes.ToggleIf(selectedClass, showWarnings); - SuggestionDiagnosticsButton.Classes.ToggleIf(selectedClass, showSuggestions); + // AllDiagnosticsButton.Classes.Remove(selectedClass); + // CriticalDiagnosticsButton.Classes.ToggleIf(selectedClass, showCritical); + // WarningDiagnosticsButton.Classes.ToggleIf(selectedClass, showWarnings); + // SuggestionDiagnosticsButton.Classes.ToggleIf(selectedClass, showSuggestions); } }) .DisposeWith(disposable); diff --git a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/TabControl/TabControlStyles.axaml b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/TabControl/TabControlStyles.axaml new file mode 100644 index 0000000000..4db5812385 --- /dev/null +++ b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/TabControl/TabControlStyles.axaml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/StylesIndex.axaml b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/StylesIndex.axaml index 5ed4749b3f..faa360cc0d 100644 --- a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/StylesIndex.axaml +++ b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/StylesIndex.axaml @@ -29,6 +29,7 @@ + diff --git a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/CollectionDownloadPage/CollectionDownloadPageStyles.axaml b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/CollectionDownloadPage/CollectionDownloadPageStyles.axaml index 9d1312d948..47b3d188d0 100644 --- a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/CollectionDownloadPage/CollectionDownloadPageStyles.axaml +++ b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/CollectionDownloadPage/CollectionDownloadPageStyles.axaml @@ -184,107 +184,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/Diagnostics/DiagnosticEntryStyles.axaml b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/Diagnostics/DiagnosticEntryStyles.axaml index 537c2a42c0..958d28fa5a 100644 --- a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/Diagnostics/DiagnosticEntryStyles.axaml +++ b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/Diagnostics/DiagnosticEntryStyles.axaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:NexusMods.App.UI.Controls;assembly=NexusMods.App.UI"> - + @@ -22,21 +22,31 @@ - - + + + + + + + + + diff --git a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/Diagnostics/DiagnosticEntryStyles.axaml b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/Diagnostics/DiagnosticEntryStyles.axaml index 958d28fa5a..0e1ca0175f 100644 --- a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/Diagnostics/DiagnosticEntryStyles.axaml +++ b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/Diagnostics/DiagnosticEntryStyles.axaml @@ -20,24 +20,11 @@ --> - - - - - - - - From fc9ebdf7393faf8366d1441d08cb6585bf5d802c Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Thu, 12 Dec 2024 13:10:18 +0000 Subject: [PATCH 03/18] add health pictogram --- src/NexusMods.Icons/IconValues.cs | 5 +++++ .../Styles/Controls/Icons/IconsStyles.axaml | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/NexusMods.Icons/IconValues.cs b/src/NexusMods.Icons/IconValues.cs index 61aaf0afd2..52b28ea82e 100644 --- a/src/NexusMods.Icons/IconValues.cs +++ b/src/NexusMods.Icons/IconValues.cs @@ -487,6 +487,11 @@ public static class IconValues #region Brand Pictograms + /// + /// Brand pictogram for Health + /// + public static readonly IconValue PictogramHealth = new IconValue(new AvaloniaSvg("avares://NexusMods.App.UI/Assets/Pictograms/health.svg")); + /// /// Brand pictogram for Games in 3D /// diff --git a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/Icons/IconsStyles.axaml b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/Icons/IconsStyles.axaml index ee0fd61947..db1047caaf 100644 --- a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/Icons/IconsStyles.axaml +++ b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/Icons/IconsStyles.axaml @@ -118,6 +118,9 @@ + + + @@ -561,4 +564,7 @@ + From ab5cd8c7aa8e97e15469032d27662c6d77e54680 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Thu, 12 Dec 2024 13:10:48 +0000 Subject: [PATCH 04/18] reset some tabcontrol styles --- .../Diagnostics/List/DiagnosticListView.axaml | 30 ++++++++++++++----- .../TabControl/TabControlStyles.axaml | 2 +- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml index 3a63767236..4c5853dbe0 100644 --- a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml +++ b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml @@ -10,7 +10,7 @@ xmlns:icons="clr-namespace:NexusMods.Icons;assembly=NexusMods.Icons" xmlns:resources="clr-namespace:NexusMods.App.UI.Resources" xmlns:diagnostics="clr-namespace:NexusMods.App.UI.Controls.Diagnostics" - mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="450" + mc:Ignorable="d" d:DesignWidth="700" d:DesignHeight="450" x:Class="NexusMods.App.UI.Pages.Diagnostics.DiagnosticListView"> @@ -35,14 +35,30 @@ - + + + + + + + + + + - + + - - - + diff --git a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/TabControl/TabControlStyles.axaml b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/TabControl/TabControlStyles.axaml index 92ceb19880..f77d8a08d6 100644 --- a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/TabControl/TabControlStyles.axaml +++ b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/Controls/TabControl/TabControlStyles.axaml @@ -156,7 +156,7 @@ - + diff --git a/src/NexusMods.App.UI/WorkspaceSystem/Page/APageViewModel.cs b/src/NexusMods.App.UI/WorkspaceSystem/Page/APageViewModel.cs index ce93913d51..2eecde742d 100644 --- a/src/NexusMods.App.UI/WorkspaceSystem/Page/APageViewModel.cs +++ b/src/NexusMods.App.UI/WorkspaceSystem/Page/APageViewModel.cs @@ -53,6 +53,11 @@ public IconValue TabIcon private string _tabTitle = Language.PanelTabHeaderViewModel_Title_New_Tab; + protected APageViewModel() + { + WindowManager = null!; + } + /// public string TabTitle { From ef71a32447863dfd7716daf404ca8dc07b18fa43 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Tue, 17 Dec 2024 09:06:35 +0000 Subject: [PATCH 06/18] merge error --- .../Diagnostics/List/DiagnosticListView.axaml | 26 +++++++------------ .../Pages/LoadoutPage/LoadoutView.axaml | 3 +-- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml index f2a8bfa918..17840b79ce 100644 --- a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml +++ b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml @@ -18,30 +18,24 @@ - + + - - + Subtitle="{x:Static resources:Language.DiagnosticListView_EmptyState_Subtitle}"> - + - + @@ -54,13 +48,13 @@ + Text="Review your Loadout for any issues and learn how to resolve them if needed." + Theme="{StaticResource BodyMDNormalTheme}" + Foreground="{StaticResource NeutralStrongBrush}" /> - diff --git a/src/NexusMods.App.UI/Pages/LoadoutPage/LoadoutView.axaml b/src/NexusMods.App.UI/Pages/LoadoutPage/LoadoutView.axaml index 6d6974195d..8887726f95 100644 --- a/src/NexusMods.App.UI/Pages/LoadoutPage/LoadoutView.axaml +++ b/src/NexusMods.App.UI/Pages/LoadoutPage/LoadoutView.axaml @@ -47,8 +47,7 @@ + Header="Header"> From cfcb014d3445699953b0e0520bf6d6985e283c59 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Tue, 17 Dec 2024 10:49:28 +0000 Subject: [PATCH 07/18] Working ScrollViewer, better DesignViewModel --- .../DiagnosticEntryDesignViewModel.cs | 2 + .../Diagnostics/DiagnosticEntryView.axaml | 2 +- .../List/DiagnosticListDesignViewModel.cs | 31 +++++++++-- .../Diagnostics/List/DiagnosticListView.axaml | 54 ++++++++++--------- 4 files changed, 61 insertions(+), 28 deletions(-) diff --git a/src/NexusMods.App.UI/Controls/Diagnostics/DiagnosticEntryDesignViewModel.cs b/src/NexusMods.App.UI/Controls/Diagnostics/DiagnosticEntryDesignViewModel.cs index 44e8ad0458..b76fdb9d1a 100644 --- a/src/NexusMods.App.UI/Controls/Diagnostics/DiagnosticEntryDesignViewModel.cs +++ b/src/NexusMods.App.UI/Controls/Diagnostics/DiagnosticEntryDesignViewModel.cs @@ -6,6 +6,8 @@ namespace NexusMods.App.UI.Controls.Diagnostics; public class DiagnosticEntryDesignViewModel : DiagnosticEntryViewModel { public DiagnosticEntryDesignViewModel() : base(Data, Writer) { } + + public DiagnosticEntryDesignViewModel(Diagnostic diagnostic) : base(diagnostic, Writer) { } private static readonly Diagnostic Data = new() { diff --git a/src/NexusMods.App.UI/Controls/Diagnostics/DiagnosticEntryView.axaml b/src/NexusMods.App.UI/Controls/Diagnostics/DiagnosticEntryView.axaml index 6d29e9faa6..4712fb50f1 100644 --- a/src/NexusMods.App.UI/Controls/Diagnostics/DiagnosticEntryView.axaml +++ b/src/NexusMods.App.UI/Controls/Diagnostics/DiagnosticEntryView.axaml @@ -10,7 +10,7 @@ xmlns:panels="clr-namespace:Avalonia.Labs.Panels;assembly=Avalonia.Labs.Panels" mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="100" x:Class="NexusMods.App.UI.Controls.Diagnostics.DiagnosticEntryView"> - + diff --git a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListDesignViewModel.cs b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListDesignViewModel.cs index 5c0fe8cf5b..4e24b5ee7e 100644 --- a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListDesignViewModel.cs +++ b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListDesignViewModel.cs @@ -1,6 +1,7 @@ using System.Reactive; using JetBrains.Annotations; using NexusMods.Abstractions.Diagnostics; +using NexusMods.Abstractions.Diagnostics.References; using NexusMods.Abstractions.Loadouts; using NexusMods.App.UI.Controls.Diagnostics; using NexusMods.App.UI.WorkspaceSystem; @@ -15,9 +16,33 @@ internal class DiagnosticListDesignViewModel : APageViewModel(), + }), + new DiagnosticEntryDesignViewModel(new Diagnostic + { + Id = new DiagnosticId(), + Title = "Example Diagnostic Title 2", + Severity = DiagnosticSeverity.Critical, + Summary = DiagnosticMessage.From("Example diagnostic summary 2"), + Details = DiagnosticMessage.DefaultValue, + DataReferences = new Dictionary(), + }), + new DiagnosticEntryDesignViewModel(new Diagnostic + { + Id = new DiagnosticId(), + Title = "Example Diagnostic Title 3", + Severity = DiagnosticSeverity.Suggestion, + Summary = DiagnosticMessage.From("Example diagnostic summary 3"), + Details = DiagnosticMessage.DefaultValue, + DataReferences = new Dictionary(), + }), }; public int NumCritical { get; } = 1; diff --git a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml index 17840b79ce..5f7c50c843 100644 --- a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml +++ b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml @@ -10,7 +10,8 @@ xmlns:icons="clr-namespace:NexusMods.Icons;assembly=NexusMods.Icons" xmlns:resources="clr-namespace:NexusMods.App.UI.Resources" xmlns:diagnostics="clr-namespace:NexusMods.App.UI.Controls.Diagnostics" - mc:Ignorable="d" d:DesignWidth="900" d:DesignHeight="450" + xmlns:panels="clr-namespace:Avalonia.Labs.Panels;assembly=Avalonia.Labs.Panels" + mc:Ignorable="d" d:DesignWidth="900" d:DesignHeight="500" x:Class="NexusMods.App.UI.Pages.Diagnostics.DiagnosticListView"> @@ -20,23 +21,28 @@ - --> + - + + - + @@ -55,26 +61,26 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -86,7 +92,7 @@ - + From fc6f3eb0eb05cbb283384d4b013f656b8c5fa387 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Tue, 17 Dec 2024 11:04:33 +0000 Subject: [PATCH 08/18] added filters for diagnosticentries for each tab --- .../Diagnostics/List/DiagnosticListView.axaml | 63 ++++++++-- .../List/DiagnosticListView.axaml.cs | 110 ++++++------------ 2 files changed, 90 insertions(+), 83 deletions(-) diff --git a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml index 5f7c50c843..2fb453f138 100644 --- a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml +++ b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml @@ -20,14 +20,11 @@ - - - - + - + - - + @@ -83,13 +79,58 @@ - + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + diff --git a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml.cs b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml.cs index 8162cfe036..9e6e19abdc 100644 --- a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml.cs +++ b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml.cs @@ -18,84 +18,50 @@ public DiagnosticListView() InitializeComponent(); this.WhenActivated(disposable => - { - this.OneWayBind(ViewModel, vm => vm.DiagnosticEntries, view => view.ItemsControl.ItemsSource) - .DisposeWith(disposable); + { + // update headers whenever the counts change + this.WhenAnyValue( + view => view.ViewModel!.NumCritical, + view => view.ViewModel!.NumWarnings, + view => view.ViewModel!.NumSuggestions + ) + .Subscribe(counts => + { + var (numCritical, numWarnings, numSuggestions) = counts; + var total = numCritical + numWarnings + numSuggestions; - // use counts - this.WhenAnyValue( - view => view.ViewModel!.NumCritical, - view => view.ViewModel!.NumWarnings, - view => view.ViewModel!.NumSuggestions) - .Subscribe(counts => - { - var (numCritical, numWarnings, numSuggestions) = counts; - var total = numCritical + numWarnings + numSuggestions; + // set tab headers + AllDiagnosticsTab.Header = string.Format(Language.DiagnosticListView_DiagnosticListView_All, total); + SuggestionDiagnosticsTab.Header = string.Format(Language.DiagnosticListView_DiagnosticListView_Suggestions, numSuggestions); + WarningDiagnosticsTab.Header = string.Format(Language.DiagnosticListView_DiagnosticListView_Warnings, numWarnings); + CriticalDiagnosticsTab.Header = string.Format(Language.DiagnosticListView_DiagnosticListView_Critical, numCritical); - // set button texts - AllDiagnosticsTab.Header = string.Format(Language.DiagnosticListView_DiagnosticListView_All, total); - SuggestionDiagnosticsTab.Header = string.Format(Language.DiagnosticListView_DiagnosticListView_Suggestions, numSuggestions); - WarningDiagnosticsTab.Header = string.Format(Language.DiagnosticListView_DiagnosticListView_Warnings, numWarnings); - CriticalDiagnosticsTab.Header = string.Format(Language.DiagnosticListView_DiagnosticListView_Critical, numCritical); - - //AllDiagnosticsButtonText.Text = string.Format(Language.DiagnosticListView_DiagnosticListView_All, total); - //CriticalDiagnosticsButtonText.Text = string.Format(Language.DiagnosticListView_DiagnosticListView_Critical, numCritical); - //WarningDiagnosticsButtonText.Text = string.Format(Language.DiagnosticListView_DiagnosticListView_Warnings, numWarnings); - //SuggestionDiagnosticsButtonText.Text = string.Format(Language.DiagnosticListView_DiagnosticListView_Suggestions, numSuggestions); + EmptyState.IsActive = total == 0; + } + ) + .DisposeWith(disposable); - EmptyState.IsActive = total == 0; - }) - .DisposeWith(disposable); + // bind all DiagnosticEntries to the AllItemsControl + this.OneWayBind(ViewModel, vm => vm.DiagnosticEntries, view => view.AllItemsControl.ItemsSource) + .DisposeWith(disposable); - // toggle commands - // this.BindCommand(ViewModel, - // vm => vm.ToggleSeverityCommand, - // view => view.CriticalDiagnosticsButton, - // withParameter: Observable.Return(DiagnosticSeverity.Critical)) - // .DisposeWith(disposable); - // - // this.BindCommand(ViewModel, - // vm => vm.ToggleSeverityCommand, - // view => view.WarningDiagnosticsButton, - // withParameter: Observable.Return(DiagnosticSeverity.Warning)) - // .DisposeWith(disposable); - // - // this.BindCommand(ViewModel, - // vm => vm.ToggleSeverityCommand, - // view => view.SuggestionDiagnosticsButton, - // withParameter: Observable.Return(DiagnosticSeverity.Suggestion)) - // .DisposeWith(disposable); - // - // this.BindCommand(ViewModel, vm => vm.ShowAllCommand, view => view.AllDiagnosticsButton) - // .DisposeWith(disposable); + // need to filter DiagnosticEntries and Bind them to the correct ItemsControl - // filter changes - this.WhenAnyValue(view => view.ViewModel!.Filter) - .Subscribe(filter => - { - var showCritical = filter.HasFlagFast(DiagnosticFilter.Critical); - var showWarnings = filter.HasFlagFast(DiagnosticFilter.Warnings); - var showSuggestions = filter.HasFlagFast(DiagnosticFilter.Suggestions); + this.WhenAnyValue(view => view.ViewModel!.DiagnosticEntries) + .Select(entries => entries.Where(e => e.Severity == DiagnosticSeverity.Critical)) + .BindTo(this, view => view.CriticalItemsControl.ItemsSource) + .DisposeWith(disposable); - const string selectedClass = "Selected"; + this.WhenAnyValue(view => view.ViewModel!.DiagnosticEntries) + .Select(entries => entries.Where(e => e.Severity == DiagnosticSeverity.Warning)) + .BindTo(this, view => view.WarningItemsControl.ItemsSource) + .DisposeWith(disposable); - if (showCritical && showWarnings && showSuggestions) - { - //AllDiagnosticsButton.Classes.Add(selectedClass); - //CriticalDiagnosticsButton.Classes.Remove(selectedClass); - //WarningDiagnosticsButton.Classes.Remove(selectedClass); - //SuggestionDiagnosticsButton.Classes.Remove(selectedClass); - } - else - { - // AllDiagnosticsButton.Classes.Remove(selectedClass); - // CriticalDiagnosticsButton.Classes.ToggleIf(selectedClass, showCritical); - // WarningDiagnosticsButton.Classes.ToggleIf(selectedClass, showWarnings); - // SuggestionDiagnosticsButton.Classes.ToggleIf(selectedClass, showSuggestions); - } - }) - .DisposeWith(disposable); - }); + this.WhenAnyValue(view => view.ViewModel!.DiagnosticEntries) + .Select(entries => entries.Where(e => e.Severity == DiagnosticSeverity.Suggestion)) + .BindTo(this, view => view.SuggestionItemsControl.ItemsSource) + .DisposeWith(disposable); + } + ); } } - From 955556fee850a25295844f15cd3f374e374307ee Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Tue, 17 Dec 2024 12:03:11 +0000 Subject: [PATCH 09/18] remove design styles --- .../Pages/Diagnostics/List/DiagnosticListView.axaml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml index 2fb453f138..ff86a694e6 100644 --- a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml +++ b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListView.axaml @@ -20,13 +20,6 @@ - - - - - - + Date: Tue, 17 Dec 2024 13:24:38 +0000 Subject: [PATCH 10/18] Updated style for SortOrdersTabControl --- .../SortingSelectionView.axaml | 55 +++++++++++-------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/src/NexusMods.App.UI/Pages/Sorting/SortingSelection/SortingSelectionView.axaml b/src/NexusMods.App.UI/Pages/Sorting/SortingSelection/SortingSelectionView.axaml index 698c9de212..16a435459b 100644 --- a/src/NexusMods.App.UI/Pages/Sorting/SortingSelection/SortingSelectionView.axaml +++ b/src/NexusMods.App.UI/Pages/Sorting/SortingSelection/SortingSelectionView.axaml @@ -1,4 +1,5 @@ - - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + From 5b2f7247b6b28961825542ac43efcc3b2d14e2c5 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Tue, 17 Dec 2024 13:38:39 +0000 Subject: [PATCH 11/18] removed extra constructor --- src/NexusMods.App.UI/WorkspaceSystem/Page/APageViewModel.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/NexusMods.App.UI/WorkspaceSystem/Page/APageViewModel.cs b/src/NexusMods.App.UI/WorkspaceSystem/Page/APageViewModel.cs index 2eecde742d..ce93913d51 100644 --- a/src/NexusMods.App.UI/WorkspaceSystem/Page/APageViewModel.cs +++ b/src/NexusMods.App.UI/WorkspaceSystem/Page/APageViewModel.cs @@ -53,11 +53,6 @@ public IconValue TabIcon private string _tabTitle = Language.PanelTabHeaderViewModel_Title_New_Tab; - protected APageViewModel() - { - WindowManager = null!; - } - /// public string TabTitle { From 8ff04b7c147f4543cca177e50eebd267aaacd530 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Tue, 17 Dec 2024 15:23:44 +0000 Subject: [PATCH 12/18] change background color --- .../Styles/UserControls/Diagnostics/DiagnosticEntryStyles.axaml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/Diagnostics/DiagnosticEntryStyles.axaml b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/Diagnostics/DiagnosticEntryStyles.axaml index 0e1ca0175f..e419744060 100644 --- a/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/Diagnostics/DiagnosticEntryStyles.axaml +++ b/src/Themes/NexusMods.Themes.NexusFluentDark/Styles/UserControls/Diagnostics/DiagnosticEntryStyles.axaml @@ -25,6 +25,7 @@ + + + From 4f09ea785725b8cf2cdc64ac42068a6a246a1351 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Mon, 6 Jan 2025 15:13:21 +0000 Subject: [PATCH 14/18] Update src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs Co-authored-by: erri120 --- .../Diagnostics/List/DiagnosticListViewModel.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs index 96eb194ef4..3218d47190 100644 --- a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs +++ b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs @@ -53,20 +53,6 @@ public DiagnosticListViewModel( Settings = settingsManager.Get(); settingsManager.GetChanges().OnUI().BindToVM(this, vm => vm.Settings); - // ToggleSeverityCommand = ReactiveCommand.Create(severity => - // { - // var flag = SeverityToFilter(severity); - // - // if (Filter == AllFilter) Filter = flag; - // else Filter = flag; - // - // if (Filter == DiagnosticFilter.None) Filter = AllFilter; - // }); - // - // ShowAllCommand = ReactiveCommand.Create(() => - // { - // Filter = AllFilter; - // }); this.WhenActivated(disposable => { From 8464637a1199e2074eae24ff87179791a9eac2ed Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Mon, 6 Jan 2025 15:13:30 +0000 Subject: [PATCH 15/18] Update src/NexusMods.App.UI/Pages/Diagnostics/List/IDiagnosticListViewModel.cs Co-authored-by: erri120 --- .../Pages/Diagnostics/List/IDiagnosticListViewModel.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/NexusMods.App.UI/Pages/Diagnostics/List/IDiagnosticListViewModel.cs b/src/NexusMods.App.UI/Pages/Diagnostics/List/IDiagnosticListViewModel.cs index b26818429b..f623459b5a 100644 --- a/src/NexusMods.App.UI/Pages/Diagnostics/List/IDiagnosticListViewModel.cs +++ b/src/NexusMods.App.UI/Pages/Diagnostics/List/IDiagnosticListViewModel.cs @@ -21,7 +21,6 @@ public interface IDiagnosticListViewModel : IPageViewModelInterface public DiagnosticFilter Filter { get; set; } - //ReactiveCommand ToggleSeverityCommand { get; } //ReactiveCommand ShowAllCommand { get; } } From cfcb9f2e327554618c77fcd6e96d464492ef0a58 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Mon, 6 Jan 2025 15:13:37 +0000 Subject: [PATCH 16/18] Update src/NexusMods.App.UI/Pages/Diagnostics/List/IDiagnosticListViewModel.cs Co-authored-by: erri120 --- .../Pages/Diagnostics/List/IDiagnosticListViewModel.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/NexusMods.App.UI/Pages/Diagnostics/List/IDiagnosticListViewModel.cs b/src/NexusMods.App.UI/Pages/Diagnostics/List/IDiagnosticListViewModel.cs index f623459b5a..b61dd9eb34 100644 --- a/src/NexusMods.App.UI/Pages/Diagnostics/List/IDiagnosticListViewModel.cs +++ b/src/NexusMods.App.UI/Pages/Diagnostics/List/IDiagnosticListViewModel.cs @@ -22,7 +22,6 @@ public interface IDiagnosticListViewModel : IPageViewModelInterface public DiagnosticFilter Filter { get; set; } - //ReactiveCommand ShowAllCommand { get; } } [Flags] From 9ec0fff001a8a8141bd26b9558b51b844c06d0d7 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Mon, 6 Jan 2025 15:13:51 +0000 Subject: [PATCH 17/18] Update src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs Co-authored-by: erri120 --- .../Pages/Diagnostics/List/DiagnosticListViewModel.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs index 3218d47190..95f0d575a4 100644 --- a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs +++ b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs @@ -34,7 +34,6 @@ internal class DiagnosticListViewModel : APageViewModel ToggleSeverityCommand { get; } - //public ReactiveCommand ShowAllCommand { get; } private const DiagnosticFilter AllFilter = DiagnosticFilter.Critical | DiagnosticFilter.Warnings | DiagnosticFilter.Suggestions; From 40c4da33de4bb3d1e13ac9c750262440b768136a Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Mon, 6 Jan 2025 15:13:58 +0000 Subject: [PATCH 18/18] Update src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs Co-authored-by: erri120 --- .../Pages/Diagnostics/List/DiagnosticListViewModel.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs index 95f0d575a4..06fbac0072 100644 --- a/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs +++ b/src/NexusMods.App.UI/Pages/Diagnostics/List/DiagnosticListViewModel.cs @@ -32,7 +32,6 @@ internal class DiagnosticListViewModel : APageViewModel ToggleSeverityCommand { get; } private const DiagnosticFilter AllFilter = DiagnosticFilter.Critical | DiagnosticFilter.Warnings | DiagnosticFilter.Suggestions;