Compare commits

...

2 Commits

Author SHA1 Message Date
Gordon Lam (SH)
41cfa20163 Make the feature default to be off 2025-06-30 11:00:55 +08:00
Clint Rutkas
e9af20a1d6 commenting out action framework code 2025-06-28 08:56:23 -07:00
2 changed files with 12 additions and 2 deletions

View File

@@ -14,6 +14,15 @@ namespace Microsoft.CmdPal.Ext.Indexer.Data;
internal sealed partial class IndexerListItem : ListItem
{
internal static readonly bool IsActionsFeatureEnabled = GetFeatureFlag();
private static bool GetFeatureFlag()
{
var env = System.Environment.GetEnvironmentVariable("CMDPAL_ENABLE_ACTIONS_LIST");
return !string.IsNullOrEmpty(env) &&
(env == "1" || env.Equals("true", System.StringComparison.OrdinalIgnoreCase));
}
internal string FilePath { get; private set; }
public IndexerListItem(
@@ -45,7 +54,7 @@ internal sealed partial class IndexerListItem : ListItem
..context,
new CommandContextItem(new OpenWithCommand(indexerItem))];
if (ApiInformation.IsApiContractPresent("Windows.AI.Actions.ActionsContract", 4))
if (IsActionsFeatureEnabled && ApiInformation.IsApiContractPresent("Windows.AI.Actions.ActionsContract", 4))
{
var actionsListContextItem = new ActionsListContextItem(indexerItem.FullPath);
if (actionsListContextItem.AnyActions())

View File

@@ -19,7 +19,8 @@ public partial class IndexerCommandsProvider : CommandProvider
Id = "Files";
DisplayName = Resources.IndexerCommandsProvider_DisplayName;
Icon = Icons.FileExplorer;
if (ApiInformation.IsApiContractPresent("Windows.AI.Actions.ActionsContract", 4))
if (IndexerListItem.IsActionsFeatureEnabled && ApiInformation.IsApiContractPresent("Windows.AI.Actions.ActionsContract", 4))
{
_ = ActionRuntimeManager.InstanceAsync;
}