mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 01:36:31 +02:00
CmdPal: Update CommunityToolkit.WinUI to 8.2.251219 and remove SearchBar debouncer hacks (#46027)
## Summary of the Pull Request Updates all `CommunityToolkit.WinUI` packages from `8.2.250402` to `8.2.251219` (latest stable) and removes three workaround hacks from `SearchBar.xaml.cs` that were added to paper over bugs in the `CommunityToolkit.WinUI.Extensions` debouncer (`Debounce` with `immediate: true` not firing correctly). Those bugs were fixed upstream and are included in `8.2.251219`. ## PR Checklist - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx ## Detailed Description of the Pull Request / Additional comments ### Package update (`Directory.Packages.props`) All `CommunityToolkit.WinUI` packages bumped from `8.2.250402` → `8.2.251219`: - `CommunityToolkit.WinUI.Animations` - `CommunityToolkit.WinUI.Collections` - `CommunityToolkit.WinUI.Controls.Primitives` - `CommunityToolkit.WinUI.Controls.SettingsControls` - `CommunityToolkit.WinUI.Controls.Segmented` - `CommunityToolkit.WinUI.Controls.Sizers` - `CommunityToolkit.WinUI.Converters` - `CommunityToolkit.WinUI.Extensions` ### Hack removals (`SearchBar.xaml.cs`) All three hacks were in `SearchBar.xaml.cs` (`Controls/`), tagged `TODO GH #245`: - **`FilterBox_TextChanged` — "TERRIBLE HACK"**: Forced `DoFilterBoxUpdate()` immediately for any single-character input, then returned early—bypassing the debouncer entirely. Now the debouncer's `immediate: FilterBox.Text.Length <= 1` path handles this correctly. - **Escape key handler**: After `FilterBox.Text = string.Empty`, manually pushed the empty string to `CurrentPageViewModel.SearchTextBox`. The `TextChanged` event fires after the assignment and the debouncer (with `immediate: true` for length 0) now handles propagation. - **Backspace key handler (`else if (e.Key == VirtualKey.Back)` block)**: Pre-emptively set `CurrentPageViewModel.SearchTextBox` to the *pre-deletion* text in `FilterBox_KeyDown`. Entire block removed; `TextChanged` + debouncer handle the post-deletion update correctly. ## Validation Steps Performed Manually verified in CmdPal that: - Typing aliases (single-character triggers) still activates filtering immediately - Pressing Escape clears the search box and resets the filter - Pressing Backspace correctly updates search results after each deletion <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Update to the latest `CommunityToolkit.WinUI.Extensions` and remove hacks</issue_title> > <issue_description>_originally filed by @zadjii-msft_ > > See https://github.com/zadjii-msft/PowerToys/pull/236#discussion_r1887714771 > > I had to stick a couple of HACKs into `SearchBar.xaml.cs` to work around bugs in the toolkit debouncer. Those bugs have since been fixed upstream, hooray! We just need a new version of the package shipped and we can get rid of them. > > ref https://github.com/zadjii-msft/PowerToys/issues/236 > > ---- > > Also! > > Revert > > ``` > // TODO(stefan): REVERT THIS TO DASHBOARD PAGE!!!! SPELCHHHHEEK FAIL > ``` > > from https://github.com/zadjii-msft/PowerToys/issues/215</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > <comment_new><author>@niels9001</author><body> > @zadjii-msft @michaeljolley I assume we are on a later version now? Do we still need to remove the hacks?</body></comment_new> > <comment_new><author>@zadjii-msft</author><body> > We sure do! > > There's the SearchBar.xaml.cs ones, and I also had to manually copy over the `TypedEventHandlerExtensions.cs`</body></comment_new> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes microsoft/PowerToys#38285 <!-- START COPILOT CODING AGENT TIPS --> --- 🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com> Co-authored-by: Niels Laute <niels.laute@live.nl>
This commit is contained in:
@@ -18,15 +18,15 @@
|
||||
<PackageVersion Include="SixLabors.ImageSharp" Version="2.1.12" />
|
||||
<PackageVersion Include="CommunityToolkit.Common" Version="8.4.0" />
|
||||
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Animations" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Collections" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Converters" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Extensions" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls.DataGrid" Version="7.1.2" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Animations" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Collections" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Converters" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Extensions" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls.DataGrid" Version="7.1.2" />
|
||||
<PackageVersion Include="CommunityToolkit.Labs.WinUI.Controls.MarkdownTextBlock" Version="0.1.260116-build.2514" />
|
||||
<PackageVersion Include="ControlzEx" Version="6.0.0" />
|
||||
<PackageVersion Include="HelixToolkit" Version="2.24.0" />
|
||||
|
||||
@@ -157,12 +157,6 @@ public sealed partial class SearchBar : UserControl,
|
||||
{
|
||||
// Clear the search box
|
||||
FilterBox.Text = string.Empty;
|
||||
|
||||
// hack TODO GH #245
|
||||
if (CurrentPageViewModel is not null)
|
||||
{
|
||||
CurrentPageViewModel.SearchTextBox = FilterBox.Text;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -170,14 +164,6 @@ public sealed partial class SearchBar : UserControl,
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
else if (e.Key == VirtualKey.Back)
|
||||
{
|
||||
// hack TODO GH #245
|
||||
if (CurrentPageViewModel is not null)
|
||||
{
|
||||
CurrentPageViewModel.SearchTextBox = FilterBox.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void FilterBox_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
|
||||
@@ -332,19 +318,6 @@ public sealed partial class SearchBar : UserControl,
|
||||
private void FilterBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
// Logger.LogInfo($"FilterBox_TextChanged: {FilterBox.Text}");
|
||||
|
||||
// TERRIBLE HACK TODO GH #245
|
||||
// There's weird wacky bugs with debounce currently. We're trying
|
||||
// to get them ingested, but while we wait for the toolkit feeds to
|
||||
// bubble, just manually send the first character, always
|
||||
// (otherwise aliases just stop working)
|
||||
if (FilterBox.Text.Length == 1)
|
||||
{
|
||||
DoFilterBoxUpdate();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (InSuggestion)
|
||||
{
|
||||
// Logger.LogInfo($"-- skipping, in suggestion --");
|
||||
|
||||
Reference in New Issue
Block a user