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
This commit is contained in:
Niels Laute
2026-08-17 10:56:54 +02:00
committed by GitHub
parent 75df8d022a
commit 4494a96be6
5 changed files with 0 additions and 25 deletions

View File

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

View File

@@ -40,15 +40,6 @@ public static partial class FlyoutWindowHelper
[LibraryImport("shcore.dll")] [LibraryImport("shcore.dll")]
private static partial int GetDpiForMonitor(nint hMonitor, uint dpiType, out uint dpiX, out uint dpiY); 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> /// <summary>
/// Get the DPI scale factor for a given <see cref="DisplayArea"/>. /// Get the DPI scale factor for a given <see cref="DisplayArea"/>.
/// Resolves DPI from the underlying monitor handle so the value reflects the /// Resolves DPI from the underlying monitor handle so the value reflects the

View File

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

View File

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

View File

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