From e1117ca181c344e8eff425797894adc49d330255 Mon Sep 17 00:00:00 2001 From: Niels Laute Date: Wed, 27 Aug 2025 07:42:30 +0200 Subject: [PATCH] Search UX improvements (#41386) ### Fixing visual glitch in the 'Show all results' template: Before image After image ### Displaying "Show results for * search term *" on search results page Before image After image ### Using Accent Color for the search highlight for better visibility and fixing a bug Before ![highlight-bug](https://github.com/user-attachments/assets/2d4c0f5b-4030-4c10-a4ec-c7c5023034f0) After ![fix-accent](https://github.com/user-attachments/assets/62a223a9-9360-4297-9127-5aaef82c162f) --------- Co-authored-by: vanzue --- .../Settings.UI/Helpers/NavigatablePage.cs | 6 +++--- .../Views/SearchResultsPage.xaml.cs | 7 ++++--- .../SettingsXAML/Views/ShellPage.xaml | 11 ++--------- .../Settings.UI/Strings/en-us/Resources.resw | 17 ++++++++++------- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/src/settings-ui/Settings.UI/Helpers/NavigatablePage.cs b/src/settings-ui/Settings.UI/Helpers/NavigatablePage.cs index b52972c68e..68f5b9d1a1 100644 --- a/src/settings-ui/Settings.UI/Helpers/NavigatablePage.cs +++ b/src/settings-ui/Settings.UI/Helpers/NavigatablePage.cs @@ -17,7 +17,7 @@ namespace Microsoft.PowerToys.Settings.UI.Helpers; public abstract partial class NavigatablePage : Page { private const int ExpandWaitDuration = 500; - private const int AnimationDuration = 2000; + private const int AnimationDuration = 1850; private NavigationParams _pendingNavigationParams; @@ -92,9 +92,9 @@ public abstract partial class NavigatablePage : Page dropShadow.Offset = new Vector3(0, 0, 0); var spriteVisual = compositor.CreateSpriteVisual(); - spriteVisual.Size = new Vector2((float)target.ActualWidth, (float)target.ActualHeight); + spriteVisual.Size = new Vector2((float)target.ActualWidth + 8, (float)target.ActualHeight + 8); spriteVisual.Shadow = dropShadow; - spriteVisual.Offset = new Vector3(0, 0, 0); + spriteVisual.Offset = new Vector3(-4, -4, 0); // Insert the shadow visual behind the target element ElementCompositionPreview.SetElementChildVisual(target, spriteVisual); diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/SearchResultsPage.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/Views/SearchResultsPage.xaml.cs index 8163d3b968..8469851ca5 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/SearchResultsPage.xaml.cs +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/SearchResultsPage.xaml.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using CommunityToolkit.WinUI.Controls; using Microsoft.PowerToys.Settings.UI.Helpers; using Microsoft.PowerToys.Settings.UI.Services; using Microsoft.PowerToys.Settings.UI.ViewModels; @@ -32,7 +33,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views if (e.Parameter is SearchResultsNavigationParams searchParams) { ViewModel.SetSearchResults(searchParams.Query, searchParams.Results); - PageControl.ModuleDescription = string.Empty; + PageControl.ModuleDescription = $"{ResourceLoaderInstance.ResourceLoader.GetString("Search_ResultsFor")} '{searchParams.Query}'"; } } @@ -43,7 +44,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views private void ModuleButton_Click(object sender, RoutedEventArgs e) { - if (sender is CommunityToolkit.WinUI.Controls.SettingsCard card && card.DataContext is SettingEntry tagEntry) + if (sender is SettingsCard card && card.DataContext is SettingEntry tagEntry) { NavigateToModule(tagEntry); } @@ -51,7 +52,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views private void SettingButton_Click(object sender, RoutedEventArgs e) { - if (sender is CommunityToolkit.WinUI.Controls.SettingsCard card && card.DataContext is SettingEntry tagEntry) + if (sender is SettingsCard card && card.DataContext is SettingEntry tagEntry) { NavigateToSetting(tagEntry); } diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/ShellPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/ShellPage.xaml index 0bcff4629f..2ab59c1f10 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/ShellPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/ShellPage.xaml @@ -57,12 +57,6 @@ - - + @@ -92,7 +86,6 @@ - diff --git a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw index 91751b4918..55eec4cf6c 100644 --- a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw +++ b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw @@ -2902,20 +2902,19 @@ Right-click to remove the key combination, thereby deactivating the shortcut. An accessibility feature that lets you control the mouse with a single button using guided horizontal and vertical lines - + Initial line speed - + Speed of the horizontal or vertical line when it begins moving - + Reduced line speed - + Speed after slowing down the line with a second shortcut press - - + Custom colors @@ -5272,7 +5271,7 @@ To record a specific window, enter the hotkey with the Alt key in the opposite m All shortcuts function correctly - Resolve conflicts + Resolve conflicts Shortcut conflicts @@ -5293,4 +5292,8 @@ To record a specific window, enter the hotkey with the Alt key in the opposite m Do not prepend spaces to active lines when saving the hosts file + + Results for + Prefix for search string. E.g. "Results for 'shortcut'" + \ No newline at end of file