chore(common): remove unused shared UI dependencies (#49895)

## Summary of the Pull Request

Removes unused dependencies, stale API surface, and unreachable managed
settings deep-link aliases from the shared UI libraries.

## PR Checklist

- [x] **Communication:** Cleanup scope was reviewed before
implementation
- [x] **Tests:** No automated tests were needed for unused
dependency/API removal; affected projects build successfully
- [x] **Localization:** No end-user-facing strings are changed
- [x] **New binaries:** No new binaries are introduced

## Detailed Description of the Pull Request / Additional comments

- Removes unused `CommunityToolkit.WinUI.Controls.Primitives` and
`CommunityToolkit.WinUI.Converters` package references from
`src/common/Common.UI.Controls/Common.UI.Controls.csproj`.
- Removes the unused `FlyoutWindowHelper.GetDpiScale(WindowEx)` overload
from `src/common/Common.UI.Controls/Window/FlyoutWindowHelper.cs`.
- Removes the unused `SettingsDeepLink.SettingsWindow.PowerDisplay`
value; PowerDisplay uses its module-local settings deep-link helper.
- Removes unreachable `Run` and `PowerPreview` managed aliases,
superseded by `PowerLauncher` and `FileExplorer`, plus their dead CmdPal
lookup cases.
- Preserves the runner's raw `--open-settings=Run` and
`--open-settings=PowerPreview` routes for backward compatibility.
- Intentionally leaves the existing WinForms configuration and
compatibility project references unchanged.

## Validation Steps Performed

- Built `src/common/Common.UI/Common.UI.csproj` for x64 Debug.
- Built `src/common/Common.UI.Controls/Common.UI.Controls.csproj` for
x64 Debug.
- Built
`src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.PowerToys/Microsoft.CmdPal.Ext.PowerToys.csproj`
for x64 Debug.
- Ran `git diff --check`.

---------

Copilot-Session: f4b96463-079f-47c2-ae9b-7f4c59baf591
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
This commit is contained in:
Niels Laute
2026-08-17 10:56:54 +02:00
committed by Boliang Zhang (from Dev Box)
parent 38983f945c
commit a9db875e21
5 changed files with 0 additions and 25 deletions

View File

@@ -19,9 +19,7 @@
<PackageReference Include="Microsoft.WindowsAppSDK" />
<PackageReference Include="WinUIEx" />
<PackageReference Include="CommunityToolkit.WinUI.Animations" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" />
<PackageReference Include="CommunityToolkit.WinUI.Extensions" />
<PackageReference Include="CommunityToolkit.WinUI.Converters" />
<PackageReference Include="CommunityToolkit.Labs.WinUI.Controls.MarkdownTextBlock" />
</ItemGroup>

View File

@@ -40,15 +40,6 @@ public static partial class FlyoutWindowHelper
[LibraryImport("shcore.dll")]
private static partial int GetDpiForMonitor(nint hMonitor, uint dpiType, out uint dpiX, out uint dpiY);
/// <summary>
/// Get the DPI scale factor (1.0 = 100%, 1.25 = 125%, 1.5 = 150%, 2.0 = 200%) for a window.
/// </summary>
public static double GetDpiScale(WindowEx window)
{
ArgumentNullException.ThrowIfNull(window);
return (double)window.GetDpiForWindow() / DefaultDpi;
}
/// <summary>
/// Get the DPI scale factor for a given <see cref="DisplayArea"/>.
/// Resolves DPI from the underlying monitor handle so the value reflects the

View File

@@ -22,7 +22,6 @@ namespace Common.UI
LightSwitch,
FancyZones,
FileLocksmith,
Run,
ImageResizer,
KBM,
MouseUtils,
@@ -30,7 +29,6 @@ namespace Common.UI
Peek,
PowerAccent,
PowerLauncher,
PowerPreview,
PowerRename,
FileExplorer,
ShortcutGuide,
@@ -45,7 +43,6 @@ namespace Common.UI
NewPlus,
CmdPal,
ZoomIt,
PowerDisplay,
}
private static string SettingsWindowNameToString(SettingsWindow value)
@@ -70,8 +67,6 @@ namespace Common.UI
return "FancyZones";
case SettingsWindow.FileLocksmith:
return "FileLocksmith";
case SettingsWindow.Run:
return "Run";
case SettingsWindow.ImageResizer:
return "ImageResizer";
case SettingsWindow.KBM:
@@ -86,8 +81,6 @@ namespace Common.UI
return "PowerAccent";
case SettingsWindow.PowerLauncher:
return "PowerLauncher";
case SettingsWindow.PowerPreview:
return "PowerPreview";
case SettingsWindow.PowerRename:
return "PowerRename";
case SettingsWindow.FileExplorer:
@@ -116,8 +109,6 @@ namespace Common.UI
return "CmdPal";
case SettingsWindow.ZoomIt:
return "ZoomIt";
case SettingsWindow.PowerDisplay:
return "PowerDisplay";
default:
{
return string.Empty;

View File

@@ -112,7 +112,6 @@ internal static class ModuleEnablementService
SettingsWindow.Peek => "Peek",
SettingsWindow.PowerAccent => "QuickAccent",
SettingsWindow.PowerLauncher => "PowerToys Run",
SettingsWindow.Run => "PowerToys Run",
SettingsWindow.PowerRename => "PowerRename",
SettingsWindow.PowerOCR => "TextExtractor",
SettingsWindow.RegistryPreview => "RegistryPreview",

View File

@@ -35,7 +35,6 @@ internal static class PowerToysResourcesHelper
SettingsWindow.EnvironmentVariables => "EnvironmentVariables.png",
SettingsWindow.Awake => "Awake.png",
SettingsWindow.PowerRename => "PowerRename.png",
SettingsWindow.Run => "PowerToysRun.png",
SettingsWindow.ImageResizer => "ImageResizer.png",
SettingsWindow.KBM => "KeyboardManager.png",
SettingsWindow.MouseUtils => "MouseUtils.png",
@@ -53,7 +52,6 @@ internal static class PowerToysResourcesHelper
SettingsWindow.MouseWithoutBorders => "MouseWithoutBorders.png",
SettingsWindow.PowerAccent => "QuickAccent.png",
SettingsWindow.PowerLauncher => "PowerToysRun.png",
SettingsWindow.PowerPreview => "FileExplorerPreview.png",
SettingsWindow.Overview => "PowerToys.png",
SettingsWindow.Dashboard => "PowerToys.png",
_ => "PowerToys.png",
@@ -77,7 +75,6 @@ internal static class PowerToysResourcesHelper
SettingsWindow.EnvironmentVariables => "Environment Variables",
SettingsWindow.Awake => "Awake",
SettingsWindow.PowerRename => "PowerRename",
SettingsWindow.Run => "PowerToys Run",
SettingsWindow.ImageResizer => "Image Resizer",
SettingsWindow.KBM => "Keyboard Manager",
SettingsWindow.MouseUtils => "Mouse Utilities",
@@ -97,7 +94,6 @@ internal static class PowerToysResourcesHelper
SettingsWindow.Overview => "General",
SettingsWindow.Dashboard => "Dashboard",
SettingsWindow.PowerLauncher => "PowerToys Run",
SettingsWindow.PowerPreview => "File Explorer Add-ons",
_ => module.ToString(),
};
}