CmdPal: Add settings to control which fallbacks are enabled (#40505)

This adds settings to each provider to allow us to control if individual
fallback items are enabled or not, regardless of the provider being
enabled.

This is relevant to _all the threads where disabling fallback commands
came up_

This just adds another section to each provider's settings page, with a
list of the fallback commands.

This also has nothing to do with the "top-level apps search", which is
not really a fallback command - it's its own thing.

Ref #38288. Doesn't close that, because this only controls
enable/disable, not ranking.

From here, we should be able to add a dedicated page in the SUI that
shows all the fallbacks across all providers. That's where we'll enable
the ordering.
This commit is contained in:
Mike Griese
2025-07-09 22:01:38 -05:00
committed by GitHub
parent 5c6166bc9f
commit cfa5f75862
18 changed files with 178 additions and 26 deletions

View File

@@ -13,7 +13,7 @@ internal sealed partial class FallbackLogItem : FallbackCommandItem
private readonly LogMessagesPage _logMessagesPage;
public FallbackLogItem()
: base(new LogMessagesPage(), Resources.builtin_log_subtitle)
: base(new LogMessagesPage() { Id = "com.microsoft.cmdpal.log" }, Resources.builtin_log_subtitle)
{
_logMessagesPage = (LogMessagesPage)Command!;
Title = string.Empty;

View File

@@ -12,7 +12,9 @@ internal sealed partial class FallbackReloadItem : FallbackCommandItem
private readonly ReloadExtensionsCommand _reloadCommand;
public FallbackReloadItem()
: base(new ReloadExtensionsCommand(), Properties.Resources.builtin_reload_display_title)
: base(
new ReloadExtensionsCommand() { Id = "com.microsoft.cmdpal.reload" },
Properties.Resources.builtin_reload_display_title)
{
_reloadCommand = (ReloadExtensionsCommand)Command!;
Title = string.Empty;

View File

@@ -13,6 +13,7 @@ public partial class QuitCommand : InvokableCommand, IFallbackHandler
{
public QuitCommand()
{
Id = "com.microsoft.cmdpal.quit";
Icon = new IconInfo("\uE711");
}