From 97e1abaa90267ceaf3d61bd4ead3a992ea486e39 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Tue, 28 Oct 2025 22:54:59 +0100 Subject: [PATCH 1/3] Fix: Focus issue if profile filter is open --- .../ConfigurationInfo.cs | 21 +++++++++++++++++++ Source/NETworkManager/MainWindow.xaml.cs | 10 +++++++-- .../ViewModels/PowerShellHostViewModel.cs | 21 ++++++++++++------- .../Views/PowerShellHostView.xaml | 1 + .../Views/PowerShellHostView.xaml.cs | 7 ++++++- 5 files changed, 50 insertions(+), 10 deletions(-) diff --git a/Source/NETworkManager.Settings/ConfigurationInfo.cs b/Source/NETworkManager.Settings/ConfigurationInfo.cs index b092949113..bf5686edc9 100644 --- a/Source/NETworkManager.Settings/ConfigurationInfo.cs +++ b/Source/NETworkManager.Settings/ConfigurationInfo.cs @@ -451,6 +451,27 @@ public bool IsChildWindowOpen } } + /// + /// Private variable for . + /// + private bool _isProfileFilterPopupOpen; + + /// + /// Indicates if a profile filter popup is open. + /// + public bool IsProfileFilterPopupOpen + { + get => _isProfileFilterPopupOpen; + set + { + if (value == _isProfileFilterPopupOpen) + return; + + _isProfileFilterPopupOpen = value; + OnPropertyChanged(); + } + } + /// /// Private variable for . /// diff --git a/Source/NETworkManager/MainWindow.xaml.cs b/Source/NETworkManager/MainWindow.xaml.cs index 2283b044c9..b3935b33cc 100644 --- a/Source/NETworkManager/MainWindow.xaml.cs +++ b/Source/NETworkManager/MainWindow.xaml.cs @@ -1443,7 +1443,7 @@ private async void LoadProfile(ProfileFileInfo info, bool showWrongPassword = fa }, info.Name, showWrongPassword); childWindow.Title = Strings.UnlockProfileFile; - + childWindow.DataContext = viewModel; ConfigurationManager.OnDialogOpen(); @@ -2004,10 +2004,16 @@ private async void FocusEmbeddedWindow() - Settings are opened - Profile file DropDown is opened - Application search TextBox is opened + - Profile filter (tags) popup is opened - Dialog over an embedded window is opened (FixAirspace) */ - if (SelectedApplication == null || SettingsViewIsOpen || IsProfileFileDropDownOpened || + if (SelectedApplication == null || + // MainWindow + SettingsViewIsOpen || + IsProfileFileDropDownOpened || TextBoxApplicationSearchIsFocused || + // Global dialogs + ConfigurationManager.Current.IsProfileFilterPopupOpen || ConfigurationManager.Current.FixAirspace) return; diff --git a/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs b/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs index e8b95e1c10..7836fb0e0b 100644 --- a/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs @@ -233,10 +233,10 @@ public bool IsProfileFilterSet OnPropertyChanged(); } } - + private readonly GroupExpanderStateStore _groupExpanderStateStore = new(); public GroupExpanderStateStore GroupExpanderStateStore => _groupExpanderStateStore; - + private bool _canProfileWidthChange = true; private double _tempProfileWidth; @@ -492,6 +492,8 @@ private void ClearSearchAction() private void OpenProfileFilterAction() { + ConfigurationManager.Current.IsProfileFilterPopupOpen = true; + ProfileFilterIsOpen = true; } @@ -517,7 +519,7 @@ private void ClearProfileFilterAction() IsProfileFilterSet = false; ProfileFilterIsOpen = false; } - + public ICommand ExpandAllProfileGroupsCommand => new RelayCommand(_ => ExpandAllProfileGroupsAction()); private void ExpandAllProfileGroupsAction() @@ -531,7 +533,7 @@ private void CollapseAllProfileGroupsAction() { SetIsExpandedForAllProfileGroups(false); } - + public ICommand OpenSettingsCommand => new RelayCommand(_ => OpenSettingsAction()); private static void OpenSettingsAction() @@ -674,7 +676,7 @@ private void SetIsExpandedForAllProfileGroups(bool isExpanded) foreach (var group in Profiles.Groups.Cast()) GroupExpanderStateStore[group.Name.ToString()] = isExpanded; } - + private void ResizeProfile(bool dueToChangedSize) { _canProfileWidthChange = false; @@ -766,7 +768,7 @@ private void CreateTags() ProfileFilterTags.Add(new ProfileFilterTagsInfo(false, tag)); } } - + private void SetProfilesView(ProfileFilterInfo filter, ProfileInfo profile = null) { Profiles = new CollectionViewSource @@ -809,6 +811,11 @@ private void RefreshProfiles() }, SelectedProfile); } + public void OnProfileFilterClosed() + { + ConfigurationManager.Current.IsProfileFilterPopupOpen = false; + } + public void OnProfileManagerDialogOpen() { ConfigurationManager.OnDialogOpen(); @@ -841,7 +848,7 @@ private void WriteDefaultProfileToRegistry() private void ProfileManager_OnProfilesUpdated(object sender, EventArgs e) { CreateTags(); - + RefreshProfiles(); } diff --git a/Source/NETworkManager/Views/PowerShellHostView.xaml b/Source/NETworkManager/Views/PowerShellHostView.xaml index 2d79c15ab9..1491d03108 100644 --- a/Source/NETworkManager/Views/PowerShellHostView.xaml +++ b/Source/NETworkManager/Views/PowerShellHostView.xaml @@ -360,6 +360,7 @@ Date: Tue, 28 Oct 2025 22:57:14 +0100 Subject: [PATCH 2/3] Docs: #3219 --- Website/docs/changelog/next-release.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index a7094d287f..ad3a9ca3c4 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -31,6 +31,8 @@ Release date: **xx.xx.2025** ## Bug Fixes +- The new profile filter popup indroduced in version `2025.10.18.0` was instantly closed when a `PuTTY`, `PowerShell` or `AWS Session Manager` session was opened and the respective application / view was selected. [#3219](https://github.com/BornToBeRoot/NETworkManager/pull/3219) + ## Dependencies, Refactoring & Documentation - Documentation updated From 5316f7af28bacdbac41443fdacb2470c095d13d1 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Sat, 1 Nov 2025 00:35:10 +0100 Subject: [PATCH 3/3] Fix: ProfileFilterPopup with focus window --- .../ViewModels/AWSSessionManagerHostViewModel.cs | 7 +++++++ Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs | 7 +++++++ .../NETworkManager/Views/AWSSessionManagerHostView.xaml | 1 + .../Views/AWSSessionManagerHostView.xaml.cs | 8 +++++++- Source/NETworkManager/Views/PuTTYHostView.xaml | 1 + Source/NETworkManager/Views/PuTTYHostView.xaml.cs | 8 +++++++- 6 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Source/NETworkManager/ViewModels/AWSSessionManagerHostViewModel.cs b/Source/NETworkManager/ViewModels/AWSSessionManagerHostViewModel.cs index dbeee6c554..98433b6b12 100644 --- a/Source/NETworkManager/ViewModels/AWSSessionManagerHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/AWSSessionManagerHostViewModel.cs @@ -599,6 +599,8 @@ public ICommand TextBoxSearchLostFocusCommand private void OpenProfileFilterAction() { + ConfigurationManager.Current.IsProfileFilterPopupOpen = true; + ProfileFilterIsOpen = true; } @@ -1183,6 +1185,11 @@ private void RefreshProfiles() IsProfileFilterSet = !string.IsNullOrEmpty(filter.Search) || filter.Tags.Any(); } + public void OnProfileFilterClosed() + { + ConfigurationManager.Current.IsProfileFilterPopupOpen = false; + } + public void OnProfileManagerDialogOpen() { ConfigurationManager.OnDialogOpen(); diff --git a/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs b/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs index 2c37057a90..3223efcfc3 100644 --- a/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs @@ -503,6 +503,8 @@ public ICommand TextBoxSearchLostFocusCommand private void OpenProfileFilterAction() { + ConfigurationManager.Current.IsProfileFilterPopupOpen = true; + ProfileFilterIsOpen = true; } @@ -901,6 +903,11 @@ private void RefreshProfiles() IsProfileFilterSet = !string.IsNullOrEmpty(filter.Search) || filter.Tags.Any(); } + public void OnProfileFilterClosed() + { + ConfigurationManager.Current.IsProfileFilterPopupOpen = false; + } + public void OnProfileManagerDialogOpen() { ConfigurationManager.OnDialogOpen(); diff --git a/Source/NETworkManager/Views/AWSSessionManagerHostView.xaml b/Source/NETworkManager/Views/AWSSessionManagerHostView.xaml index 8c15b314fc..3a66a61e2f 100644 --- a/Source/NETworkManager/Views/AWSSessionManagerHostView.xaml +++ b/Source/NETworkManager/Views/AWSSessionManagerHostView.xaml @@ -402,6 +402,7 @@