mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
Fix CmdPal apps extension ignoring the fallback results limit setting (#45716)
## Summary MainListPage hardcoded _appResultLimit = 10 instead of reading from AllAppsCommandProvider.TopLevelResultLimit, which correctly parses the user's SearchResultLimit setting. This meant changing the results limit in settings had no effect on the apps extension fallback results. ## Changes - `MainListPage.cs` — Replaced the hardcoded _appResultLimit = 10 field with a computed property AppResultLimit that delegates to AllAppsCommandProvider.TopLevelResultLimit. - `MainListPageResultFactoryTests.cs` — Added three regression tests: - `Merge_AppLimitOfOne_ReturnsOnlyTopApp` — verifies limit of 1 returns only the top app - `Merge_AppLimitOfZero_ReturnsNoApps` — verifies limit of 0 returns no apps - `Merge_AppLimitOfOne_WithOtherResults_AppsAreLimited` — verifies apps are limited even when mixed with other result types ## Validation - [X] Existing tests pass - [X] New regression tests cover edge cases for the appResultLimit parameter ## Linked Issues - Fixes #45654 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -47,7 +47,8 @@ public sealed partial class MainListPage : DynamicListPage,
|
||||
|
||||
private bool _includeApps;
|
||||
private bool _filteredItemsIncludesApps;
|
||||
private int _appResultLimit = 10;
|
||||
|
||||
private int AppResultLimit => AllAppsCommandProvider.TopLevelResultLimit;
|
||||
|
||||
private InterlockedBoolean _refreshRunning;
|
||||
private InterlockedBoolean _refreshRequested;
|
||||
@@ -190,7 +191,7 @@ public sealed partial class MainListPage : DynamicListPage,
|
||||
validScoredFallbacks,
|
||||
_filteredApps,
|
||||
validFallbacks,
|
||||
_appResultLimit);
|
||||
AppResultLimit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user