Remove all explicit dependencies from the toolkit and extensions api on WinAppSDK (#41261)

<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
This pull request removes the dependencies from the toolkit and the SDK
on WinAppSDK and WebView2. This allows clients of these APIs to have
their own version dependencies.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [ X] Closes: #41235 
- [ X] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ X] **Tests:** Added/updated and all pass
- [ X] **Localization:** All end-user-facing strings can be localized
- [ X] **Dev docs:** Added/updated
- [ X] **New binaries:** Added on the required places
- [ X] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ X] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ X] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ X] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ X] **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

Co-authored-by: Ross Luengen <rossl@microsoft.com>
This commit is contained in:
rluengen
2025-08-19 13:53:41 -07:00
committed by GitHub
parent ea6115f892
commit 917da2e07e
5 changed files with 1 additions and 48 deletions

View File

@@ -8,7 +8,6 @@ using Microsoft.CmdPal.Ext.WindowsTerminal.Helpers;
using Microsoft.CmdPal.Ext.WindowsTerminal.Properties;
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
using Microsoft.UI.Xaml.Media.Imaging;
namespace Microsoft.CmdPal.Ext.WindowsTerminal.Pages;
@@ -16,7 +15,6 @@ internal sealed partial class ProfilesListPage : ListPage
{
private readonly TerminalQuery _terminalQuery = new();
private readonly SettingsManager _terminalSettings;
private readonly Dictionary<string, BitmapImage> _logoCache = [];
private bool showHiddenProfiles;
private bool openNewTab;
@@ -54,14 +52,6 @@ internal sealed partial class ProfilesListPage : ListPage
MoreCommands = [
new CommandContextItem(new LaunchProfileAsAdminCommand(profile.Terminal.AppUserModelId, profile.Name, openNewTab, openQuake)),
],
// Icon = () => GetLogo(profile.Terminal),
// Action = _ =>
// {
// Launch(profile.Terminal.AppUserModelId, profile.Name);
// return true;
// },
// ContextData = profile,
#pragma warning restore SA1108
});
}
@@ -70,17 +60,4 @@ internal sealed partial class ProfilesListPage : ListPage
}
public override IListItem[] GetItems() => Query().ToArray();
private BitmapImage GetLogo(TerminalPackage terminal)
{
var aumid = terminal.AppUserModelId;
if (!_logoCache.TryGetValue(aumid, out var value))
{
value = terminal.GetLogo();
_logoCache.Add(aumid, value);
}
return value;
}
}

View File

@@ -5,7 +5,6 @@
using System;
using System.IO;
using ManagedCommon;
using Microsoft.UI.Xaml.Media.Imaging;
// using Wox.Infrastructure.Image;
namespace Microsoft.CmdPal.Ext.WindowsTerminal;
@@ -30,23 +29,4 @@ public class TerminalPackage
SettingsPath = settingsPath;
LogoPath = logoPath;
}
public BitmapImage GetLogo()
{
var image = new BitmapImage();
if (File.Exists(LogoPath))
{
using var fileStream = File.OpenRead(LogoPath);
image.SetSource(fileStream.AsRandomAccessStream());
}
else
{
// Not using wox anymore, TODO: find the right new way to handle this
// image.UriSource = new Uri(ImageLoader.ErrorIconPath);
Logger.LogError($"Logo file not found: {LogoPath}");
}
return image;
}
}

View File

@@ -41,8 +41,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.WindowsAppSDK" />
<PackageReference Include="Microsoft.Web.WebView2" />
<PackageReference Include="System.Drawing.Common" />
<!-- This line forces the WebView2 version used by Windows App SDK to be the one we expect from Directory.Packages.props . -->
</ItemGroup>

View File

@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Web.WebView2" version="1.0.2903.40" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.240111.5" targetFramework="native" />
<package id="Microsoft.Windows.SDK.BuildTools" version="10.0.26100.4188" targetFramework="native" />
<package id="Microsoft.WindowsAppSDK" version="1.7.250513003" targetFramework="native" />
</packages>