Compare commits

...

11 Commits

Author SHA1 Message Date
Jeremy Sinclair
808066f272 Update NOTICE.md 2025-07-08 12:42:21 -07:00
Jeremy Sinclair
6e571d44a3 [Cmdpal][Deps] Update System.Text.Json package in extension template to 9.0.7 2025-07-08 12:39:05 -07:00
Jeremy Sinclair
69aa98fabc [Deps] Update .NET packages from 9.0.6 to 9.0.7 2025-07-08 12:31:28 -07:00
Michael Jolley
f34735edeb Adding fallback command for Windows Settings extension (#40331)
Two changes:

- Added a new fallback command for Windows Settings extension. If only
one setting or one exact match for the query was found, display that
setting in the list and open that setting on <Enter>. If more than one
setting was found, display a message to open Windows Settings to see the
search results for your query.


![image](https://github.com/user-attachments/assets/bd5708a5-b1d5-466e-9c62-cd1cd7bb1f74)


![image](https://github.com/user-attachments/assets/98f4ac20-efe1-4782-8133-30afa17e3b7d)


![image](https://github.com/user-attachments/assets/e5da90e1-f89b-480c-bd26-214c68ac013a)

- Modified the titles/subtitles of the extension to pull from Resources
to aid in internationalization.

Closes: #38548 and possibly #40308
2025-07-08 10:05:02 -05:00
Niels Laute
c6cee94456 [CmdPal] UX tweaks (#40381)
Based on guidance from the design team, this PR introduces a bunch of
small UX tweaks:

- Standardizing body text on 14px (e.g. for the Adaptive Cards related
code).
- Left align all content in the details pane
- Brush tweaks to the hotkey / tags for better visibility


![image](https://github.com/user-attachments/assets/4d9bf699-29bb-42e0-af96-b9b72c34f259)


![image](https://github.com/user-attachments/assets/905a268b-2e29-408c-a301-10a98b5885f1)


![image](https://github.com/user-attachments/assets/b9050693-f4bb-4d74-8701-fb30b46698e0)


![image](https://github.com/user-attachments/assets/5f6f93a0-1d6e-4476-bad5-dc7a9e179e92)

Closes #38858
2025-07-07 10:31:56 -05:00
Gordon Lam
0323ebea58 Fix Random unitttest failure (#40390)
The test
`Win32ProgramRepositoryMustCallOnAppRenamedForLnkAppsWhenRenamedEventIsRaised`
was experiencing random failures due to object identity mismatches in
the repository's hash-based storage system.

## Root Cause

The test was manually creating `Win32Program` objects:

```csharp
Win32Program olditem = new Win32Program
{
    Name = "oldpath",
    ExecutableName = oldpath,
    FullPath = linkingTo,
};
```

However, the `DoOnAppRenamedAsync` method creates the `oldApp` object
for removal using a different approach for .lnk files:

```csharp
oldApp = new Win32Program() { 
    Name = Path.GetFileNameWithoutExtension(e.OldName), 
    ExecutableName = Path.GetFileName(e.OldName), 
    FullPath = newApp?.FullPath ?? oldPath 
};
```

Since the repository uses `GetHashCode()` (based on `Name`,
`ExecutableName`, and `FullPath`) to identify objects for removal, any
subtle differences in these properties would cause the `Remove()`
operation to fail, leading to test assertion failures.

## Fix

Changed the test to use `Win32Program.GetAppFromPath()` instead of
manual object creation:

```csharp
Win32Program olditem = Win32Program.GetAppFromPath(oldFullPath);
Win32Program newitem = Win32Program.GetAppFromPath(newFullPath);
```

This mirrors the approach used in the working
`Win32ProgramRepositoryMustCallOnAppRenamedForUrlAppsWhenRenamedEventIsRaised`
test and ensures that test objects are created using the same code path
as the production code, eliminating hash code mismatches.

## Why This Was Random

The test failure appeared random because it depended on subtle
differences in object creation that could vary based on timing, mock
setup, or other environmental factors. By using the same object creation
method as the production code, the test becomes deterministic.
2025-07-07 17:35:09 +08:00
Gordon Lam
bd132d9b40 Fix 6 UI Automation on FanzyZone given there is renamed in Setting UI. (#40434)
<!-- 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)?
-->
## Summary of the Pull Request
It has renamed on the "Make dragged window transparent" => "Make the
dragged window transparent"

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
Kicked off UI automation pipeline

https://microsoft.visualstudio.com/Dart/_build/results?buildId=125833108&view=ms.vss-test-web.build-test-results-tab&runId=924788779&resultId=100072&paneView=debug
No more failure on FancyZone
2025-07-07 17:34:57 +08:00
leileizhang
69064fab99 Resolve spelling check noise (#40433)
<!-- 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)?
-->
## Summary of the Pull Request
These appear in every PR

![image](https://github.com/user-attachments/assets/06bb02f1-d828-44c7-8c18-624d3e10def3)
Resolve all spelling issues that were generating excessive noise in PRs.

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

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
2025-07-07 13:08:48 +08:00
leileizhang
a64de74f3b [UI Tests] Fix incorrect Settings Page launch method in UI test framework (#40367)
<!-- 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)?
-->
## Summary of the Pull Request
### Root Cause
The UI test framework previously attempted to launch
PowerToys.Settings.exe directly.
However, this bypasses the PowerToys Runner, which is required for
proper interaction
and communication between runner.

### Fix
1. This change updates the launch mechanism to start PowerToys through
the Runner
with the appropriate argument ("--open-settings").
2. Prevents the Debug dialog from appearing in test runs

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

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

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
2025-07-07 12:58:49 +08:00
leileizhang
7772bfb777 Fix: File explorer preview didn't work with per-user installation (#40314)
<!-- 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)?
-->
## Summary of the Pull Request
This Bug started when the Win11 context menu integration was first
introduced by Image Resizer in version v0.60.0.

Move Image Resizer to the WinUI3Apps folder to fix file preview issue
when PowerToys is installed on a non-C:\Program Files.
This aligns with the current structure used by File Locksmith and
PowerRename, which are not WinUI 3 apps either, but are already located
there.

### Root Cause:
When registering an MSIX package, the Windows API adds certain user
permissions to the installation folders. Since Image Resizer was
previously placed under the main PowerToys directory, these permission
changes could prevent Explorer from loading its preview handler properly
in per-user scenarios.


![image](https://github.com/user-attachments/assets/a8626314-19ce-4e25-87d6-d5e74a015e68)

Interestingly, this issue only affects per-user installs, not
machine-wide installs (e.g., to Program Files), even though both
locations receive additional permissions. The exact reason is still
unclear and requires further investigation.

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

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

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
2025-07-07 09:41:19 +08:00
Mike Griese
0f279002f8 Fix loading our app state (#40401)
Yea this is dumb. Cant have private setters when json deserializing.
closes #40399
2025-07-06 16:10:15 -05:00
37 changed files with 478 additions and 329 deletions

View File

@@ -127,3 +127,4 @@
^tools/Verification scripts/Check preview handler registration\.ps1$
ignore$
^src/modules/registrypreview/RegistryPreviewUILib/Controls/HexBox/.*$
^src/common/CalculatorEngineCommon/exprtk\.hpp$

View File

@@ -142,7 +142,6 @@ BPBF
bpmf
bpp
breadcrumb
Breadcrumb
Browsable
BROWSEINFO
bsd
@@ -193,7 +192,6 @@ CImage
cla
CLASSDC
CLASSNOTAVAILABLE
cleanmgr
clickable
clickonce
CLIENTEDGE
@@ -205,7 +203,6 @@ CLIPSIBLINGS
closesocket
clp
CLSCTX
CLSCTXLOCALSERVER
clsids
Clusion
cmder
@@ -497,7 +494,6 @@ FFFF
FILEEXPLORER
FILEFLAGS
FILEFLAGSMASK
FILELOCKSMITH
FILELOCKSMITHCONTEXTMENU
FILELOCKSMITHEXT
FILELOCKSMITHLIBINTEROP
@@ -763,7 +759,6 @@ IUI
IUnknown
IUse
IWIC
iwr
jfif
jgeosdfsdsgmkedfgdfgdfgbkmhcgcflmi
jjw
@@ -1288,7 +1283,6 @@ prvpane
psapi
pscid
PSECURITY
psexec
psfgao
psfi
PSMODULEPATH
@@ -1546,7 +1540,6 @@ SLGP
sln
SMALLICON
smartphone
smileys
SMTO
SNAPPROCESS
snk
@@ -1683,7 +1676,6 @@ TESTONLY
testprocess
TEXCOORD
TEXTBOXNEWLINE
TEXTEXTRACTOR
TEXTINCLUDE
tfopen
tgz
@@ -1891,7 +1883,6 @@ WINDOWPOSCHANGING
WINDOWSBUILDNUMBER
windowssearch
windowssettings
windowsterminal
WINDOWSTYLES
WINDOWSTYLESICON
winerror
@@ -1995,7 +1986,6 @@ YStr
YTM
YVIRTUALSCREEN
ZEROINIT
Zhiwei
zonable
zoneset
Zoneszonabletester
@@ -2014,10 +2004,47 @@ culori
Evercoder
LCh
CIELCh
CLSCTXINPROCALL
IIDI
irow
lcid
ppwsz
rguid
VARTYPE
advancedpaste
appxpackage
Ashcraft
CDPX
commandnotfound
copyable
Corpor
cropandlock
environmentvariables
fileexploreraddons
filelocksmith
findmymouse
fucntion
fuzzingtesting
hostsfileeditor
hotfixes
IDOn
lcl
LIBFUZZER
makepri
mikeclayton
mousehighlighter
mousejump
mousepointer
mouseutils
MVPs
onebranch
PMs
Psr
quickaccent
regsvr
screenruler
sharpfuzz
sourced
stuttery
textextractor
Windowss
XLoc
zonability

View File

@@ -32,22 +32,22 @@
<!-- Including MessagePack to force version, since it's used by StreamJsonRpc but contains vulnerabilities. After StreamJsonRpc updates the version of MessagePack, we can upgrade StreamJsonRpc instead. -->
<PackageVersion Include="MessagePack" Version="3.1.3" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.6" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.7" />
<!-- Including Microsoft.Bcl.AsyncInterfaces to force version, since it's used by Microsoft.SemanticKernel. -->
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.6" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.7" />
<PackageVersion Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.1.16" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.6" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.6" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.6" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.6" />
<PackageVersion Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.6" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.7" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.7" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.7" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.7" />
<PackageVersion Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.7" />
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.15.0" />
<PackageVersion Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.2903.40" />
<!-- Package Microsoft.Win32.SystemEvents added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.1. This is a dependency of System.Drawing.Common but the 8.0.1 version wasn't published to nuget. -->
<PackageVersion Include="Microsoft.Win32.SystemEvents" Version="9.0.6" />
<PackageVersion Include="Microsoft.Win32.SystemEvents" Version="9.0.7" />
<PackageVersion Include="Microsoft.WindowsPackageManager.ComInterop" Version="1.10.340" />
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="9.0.6" />
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="9.0.7" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.183" />
<!-- CsWinRT version needs to be set to have a WinRT.Runtime.dll at the same version contained inside the NET SDK we're currently building on CI. -->
<!--
@@ -75,28 +75,28 @@
<PackageVersion Include="StreamJsonRpc" Version="2.21.69" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<!-- Package System.CodeDom added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.1. This is a dependency of System.Management but the 8.0.1 version wasn't published to nuget. -->
<PackageVersion Include="System.CodeDom" Version="9.0.6" />
<PackageVersion Include="System.CodeDom" Version="9.0.7" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="System.ComponentModel.Composition" Version="9.0.6" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.6" />
<PackageVersion Include="System.Data.OleDb" Version="9.0.6" />
<PackageVersion Include="System.ComponentModel.Composition" Version="9.0.7" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.7" />
<PackageVersion Include="System.Data.OleDb" Version="9.0.7" />
<!-- Package System.Data.SqlClient added to force it as a dependency of Microsoft.Windows.Compatibility to the latest version available at this time. -->
<PackageVersion Include="System.Data.SqlClient" Version="4.9.0" />
<!-- Package System.Diagnostics.EventLog added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.1. This is a dependency of System.Data.OleDb but the 8.0.1 version wasn't published to nuget. -->
<PackageVersion Include="System.Diagnostics.EventLog" Version="9.0.6" />
<PackageVersion Include="System.Diagnostics.EventLog" Version="9.0.7" />
<!-- Package System.Diagnostics.PerformanceCounter added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.11. -->
<PackageVersion Include="System.Diagnostics.PerformanceCounter" Version="9.0.6" />
<PackageVersion Include="System.Drawing.Common" Version="9.0.6" />
<PackageVersion Include="System.Diagnostics.PerformanceCounter" Version="9.0.7" />
<PackageVersion Include="System.Drawing.Common" Version="9.0.7" />
<PackageVersion Include="System.IO.Abstractions" Version="22.0.13" />
<PackageVersion Include="System.IO.Abstractions.TestingHelpers" Version="22.0.13" />
<PackageVersion Include="System.Management" Version="9.0.6" />
<PackageVersion Include="System.Management" Version="9.0.7" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="System.Reactive" Version="6.0.1" />
<PackageVersion Include="System.Runtime.Caching" Version="9.0.6" />
<PackageVersion Include="System.ServiceProcess.ServiceController" Version="9.0.6" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="9.0.6" />
<PackageVersion Include="System.Text.Json" Version="9.0.6" />
<PackageVersion Include="System.Runtime.Caching" Version="9.0.7" />
<PackageVersion Include="System.ServiceProcess.ServiceController" Version="9.0.7" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="9.0.7" />
<PackageVersion Include="System.Text.Json" Version="9.0.7" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageVersion Include="UnicodeInformation" Version="2.6.0" />
<PackageVersion Include="UnitsNet" Version="5.56.0" />

View File

@@ -1517,23 +1517,23 @@ SOFTWARE.
- Mages 3.0.0
- Markdig.Signed 0.34.0
- MessagePack 3.1.3
- Microsoft.Bcl.AsyncInterfaces 9.0.6
- Microsoft.Bcl.AsyncInterfaces 9.0.7
- Microsoft.Bot.AdaptiveExpressions.Core 4.23.0
- Microsoft.CodeAnalysis.NetAnalyzers 9.0.0
- Microsoft.Data.Sqlite 9.0.6
- Microsoft.Data.Sqlite 9.0.7
- Microsoft.Diagnostics.Tracing.TraceEvent 3.1.16
- Microsoft.DotNet.ILCompiler (A)
- Microsoft.Extensions.DependencyInjection 9.0.6
- Microsoft.Extensions.Hosting 9.0.6
- Microsoft.Extensions.Hosting.WindowsServices 9.0.6
- Microsoft.Extensions.Logging 9.0.6
- Microsoft.Extensions.Logging.Abstractions 9.0.6
- Microsoft.Extensions.DependencyInjection 9.0.7
- Microsoft.Extensions.Hosting 9.0.7
- Microsoft.Extensions.Hosting.WindowsServices 9.0.7
- Microsoft.Extensions.Logging 9.0.7
- Microsoft.Extensions.Logging.Abstractions 9.0.7
- Microsoft.NET.ILLink.Tasks (A)
- Microsoft.SemanticKernel 1.15.0
- Microsoft.Toolkit.Uwp.Notifications 7.1.2
- Microsoft.Web.WebView2 1.0.2903.40
- Microsoft.Win32.SystemEvents 9.0.6
- Microsoft.Windows.Compatibility 9.0.6
- Microsoft.Win32.SystemEvents 9.0.7
- Microsoft.Windows.Compatibility 9.0.7
- Microsoft.Windows.CsWin32 0.3.183
- Microsoft.Windows.CsWinRT 2.2.0
- Microsoft.Windows.SDK.BuildTools 10.0.26100.4188
@@ -1553,25 +1553,25 @@ SOFTWARE.
- SkiaSharp.Views.WinUI 2.88.9
- StreamJsonRpc 2.21.69
- StyleCop.Analyzers 1.2.0-beta.556
- System.CodeDom 9.0.6
- System.CodeDom 9.0.7
- System.CommandLine 2.0.0-beta4.22272.1
- System.ComponentModel.Composition 9.0.6
- System.Configuration.ConfigurationManager 9.0.6
- System.Data.OleDb 9.0.6
- System.ComponentModel.Composition 9.0.7
- System.Configuration.ConfigurationManager 9.0.7
- System.Data.OleDb 9.0.7
- System.Data.SqlClient 4.9.0
- System.Diagnostics.EventLog 9.0.6
- System.Diagnostics.PerformanceCounter 9.0.6
- System.Drawing.Common 9.0.6
- System.Diagnostics.EventLog 9.0.7
- System.Diagnostics.PerformanceCounter 9.0.7
- System.Drawing.Common 9.0.7
- System.IO.Abstractions 22.0.13
- System.IO.Abstractions.TestingHelpers 22.0.13
- System.Management 9.0.6
- System.Management 9.0.7
- System.Net.Http 4.3.4
- System.Private.Uri 4.3.2
- System.Reactive 6.0.1
- System.Runtime.Caching 9.0.6
- System.ServiceProcess.ServiceController 9.0.6
- System.Text.Encoding.CodePages 9.0.6
- System.Text.Json 9.0.6
- System.Runtime.Caching 9.0.7
- System.ServiceProcess.ServiceController 9.0.7
- System.Text.Encoding.CodePages 9.0.7
- System.Text.Json 9.0.7
- System.Text.RegularExpressions 4.3.1
- UnicodeInformation 2.6.0
- UnitsNet 5.56.0

View File

@@ -14,7 +14,7 @@
## Localization on the pipeline (CDPX)
[The localization step](https://github.com/microsoft/PowerToys/blob/86d77103e9c69686c297490acb04775d43ef8b76/.pipelines/pipeline.user.windows.yml#L45-L52) is run on the pipeline before the solution is built. This step runs the [build-localization](https://github.com/microsoft/PowerToys/blob/main/.pipelines/build-localization.cmd) script, which generates resx files for all the projects with localization enabled using the `Localization.XLoc` package.
The [`Localization.XLoc`](https://github.com/microsoft/PowerToys/blob/86d77103e9c69686c297490acb04775d43ef8b76/.pipelines/build-localization.cmd#L24-L25) tool is run on the repo root, and it checks for all occurrences of `LocProject.json`. Each localized project has a `LocProject.json` file in the project root, which contains the location of the English resx file, list of languages for localization, and the output path where the localized resx files are to be copied to. In addition to this, some other parameters can be set, such as whether the language ID should be added as a folder in the file path or in the file name. When the CDPX pipeline is run, the localization team is notified of changes in the English resx files. For each project with localization enabled, a `loc` folder (see [this](https://github.com/microsoft/PowerToys/tree/main/src/modules/launcher/Microsoft.Launcher/loc) for example) is created in the same directory as the `LocProject.json` file. The folder contains language specific folders which in turn have a nested folder path equivalent to `OutputPath` in the `LocProject.json`. Each of these folders contain one `lcl` file. The `lcl` files contain the English resources along with their translation for that language. These are described in more detail in the [Lcl files section](#lcl-files). Once the `.resx` files are generated, they will be used during the `Build PowerToys` step for localized versions of the modules.
The [`Localization.XLoc`](https://github.com/microsoft/PowerToys/blob/86d77103e9c69686c297490acb04775d43ef8b76/.pipelines/build-localization.cmd#L24-L25) tool is run on the repo root, and it checks for all occurrences of `LocProject.json`. Each localized project has a `LocProject.json` file in the project root, which contains the location of the English resx file, list of languages for localization, and the output path where the localized resx files are to be copied to. In addition to this, some other parameters can be set, such as whether the language ID should be added as a folder in the file path or in the file name. When the CDPX pipeline is run, the localization team is notified of changes in the English resx files. For each project with localization enabled, a `loc` folder (see [the loc folder in the Microsoft.Launcher module](https://github.com/microsoft/PowerToys/tree/main/src/modules/launcher/Microsoft.Launcher/loc) for example) is created in the same directory as the `LocProject.json` file. The folder contains language specific folders which in turn have a nested folder path equivalent to `OutputPath` in the `LocProject.json`. Each of these folders contain one `lcl` file. The `lcl` files contain the English resources along with their translation for that language. These are described in more detail in the [Lcl files section](#lcl-files). Once the `.resx` files are generated, they will be used during the `Build PowerToys` step for localized versions of the modules.
Since the localization script requires certain nuget packages, the [`restore-localization`](https://github.com/microsoft/PowerToys/blob/main/.pipelines/restore-localization.cmd) script is run before running `build-localization` to install all the required packages. This script must [run in the `restore` step](https://github.com/microsoft/PowerToys/blob/86d77103e9c69686c297490acb04775d43ef8b76/.pipelines/pipeline.user.windows.yml#L37-L39) of pipeline because [the host is network isolated](https://onebranch.visualstudio.com/Pipeline/_wiki/wikis/Pipeline.wiki/2066/Consuming-Packages-in-a-CDPx-Pipeline?anchor=overview) at the `build` step. The [Toolset package source](https://github.com/microsoft/PowerToys/blob/86d77103e9c69686c297490acb04775d43ef8b76/.pipelines/pipeline.user.windows.yml#L23) is used for this.

View File

@@ -31,7 +31,7 @@ This document outlines the process for preparing and publishing PowerToys releas
- Uses semantic versioning: `MAJOR.MINOR.PATCH`
- MINOR version increases with regular releases (e.g., 0.89.0)
- PATCH version increases for hotfixes (e.g., 0.87.0 → 0.87.1)
- Each release version must be higher than the previous one for proper updating
- Each release version must be greater than the previous one for proper updating
## Testing Process

View File

@@ -5,10 +5,10 @@
<?include $(sys.CURRENTDIR)\Common.wxi?>
<?define ImageResizerAssetsFiles=?>
<?define ImageResizerAssetsFilesPath=$(var.BinDir)Assets\ImageResizer\?>
<?define ImageResizerAssetsFilesPath=$(var.BinDir)WinUI3Apps\Assets\ImageResizer\?>
<Fragment>
<DirectoryRef Id="BaseApplicationsAssetsFolder">
<DirectoryRef Id="WinUI3AppsAssetsFolder">
<Directory Id="ImageResizerAssetsFolder" Name="ImageResizer" />
</DirectoryRef>
@@ -18,7 +18,7 @@
<Component Id="Module_ImageResizer_Registry" Win64="yes">
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\CLSID\{51B4D7E5-7568-4234-B4BB-47FB3C016A69}\InprocServer32">
<RegistryValue Value="[INSTALLFOLDER]PowerToys.ImageResizerExt.dll" Type="string" />
<RegistryValue Value="[WinUI3AppsInstallFolder]PowerToys.ImageResizerExt.dll" Type="string" />
<RegistryValue Name="ThreadingModel" Value="Apartment" Type="string" />
</RegistryKey>

View File

@@ -186,7 +186,7 @@
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="ImageResizer_$(var.IdSafeLanguage)_Component" Value="" KeyPath="yes"/>
</RegistryKey>
<File Id="ImageResizer_$(var.IdSafeLanguage)_File" Source="$(var.BinDir)\$(var.Language)\PowerToys.ImageResizer.resources.dll" />
<File Id="ImageResizer_$(var.IdSafeLanguage)_File" Source="$(var.BinDir)\WinUI3Apps\$(var.Language)\PowerToys.ImageResizer.resources.dll" />
</Component>
<Component
Id="ColorPicker_$(var.IdSafeLanguage)_Component"

View File

@@ -179,7 +179,7 @@ Generate-FileList -fileDepsJson "" -fileListName HostsAssetsFiles -wxsFilePath $
Generate-FileComponents -fileListName "HostsAssetsFiles" -wxsFilePath $PSScriptRoot\Hosts.wxs -regroot $registryroot
#ImageResizer
Generate-FileList -fileDepsJson "" -fileListName ImageResizerAssetsFiles -wxsFilePath $PSScriptRoot\ImageResizer.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\ImageResizer"
Generate-FileList -fileDepsJson "" -fileListName ImageResizerAssetsFiles -wxsFilePath $PSScriptRoot\ImageResizer.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\ImageResizer"
Generate-FileComponents -fileListName "ImageResizerAssetsFiles" -wxsFilePath $PSScriptRoot\ImageResizer.wxs -regroot $registryroot
#New+

View File

@@ -9,6 +9,7 @@ using System.Reflection;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Windows;
using static Microsoft.PowerToys.UITest.WindowHelper;
namespace Microsoft.PowerToys.UITest
{
@@ -41,18 +42,6 @@ namespace Microsoft.PowerToys.UITest
this.locationPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
CheckWinAppDriverAndRoot();
var runnerProcessInfo = new ProcessStartInfo
{
FileName = locationPath + this.runnerPath,
Verb = "runas",
};
if (scope == PowerToysModule.PowerToysSettings)
{
this.ExitExe(runnerProcessInfo.FileName);
this.runner = Process.Start(runnerProcessInfo);
}
}
/// <summary>
@@ -76,6 +65,7 @@ namespace Microsoft.PowerToys.UITest
public SessionHelper Init()
{
this.ExitExe(this.locationPath + this.sessionPath);
this.StartExe(this.locationPath + this.sessionPath);
Assert.IsNotNull(this.Driver, $"Failed to initialize the test environment. Driver is null.");
@@ -89,19 +79,6 @@ namespace Microsoft.PowerToys.UITest
public void Cleanup()
{
ExitScopeExe();
try
{
if (this.scope == PowerToysModule.PowerToysSettings)
{
runner?.Kill();
runner?.WaitForExit(); // Optional: Wait for the process to exit
}
}
catch (Exception ex)
{
// Handle exceptions if needed
Debug.WriteLine($"Exception during Cleanup: {ex.Message}");
}
}
/// <summary>
@@ -135,10 +112,65 @@ namespace Microsoft.PowerToys.UITest
public void StartExe(string appPath)
{
var opts = new AppiumOptions();
opts.AddAdditionalCapability("app", appPath);
// if we want to start settings, we need to use the runner exe to open settings
if (scope == PowerToysModule.PowerToysSettings)
{
TryLaunchPowerToysSettings(opts);
}
else
{
opts.AddAdditionalCapability("app", appPath);
}
this.Driver = NewWindowsDriver(opts);
}
private void TryLaunchPowerToysSettings(AppiumOptions opts)
{
CheckWinAppDriverAndRoot();
var runnerProcessInfo = new ProcessStartInfo
{
FileName = locationPath + this.runnerPath,
Verb = "runas",
Arguments = "--open-settings",
};
this.ExitExe(runnerProcessInfo.FileName);
this.runner = Process.Start(runnerProcessInfo);
Thread.Sleep(5000);
if (root != null)
{
const int maxRetries = 3;
const int delayMs = 5000;
var windowName = "PowerToys Settings";
for (int attempt = 1; attempt <= maxRetries; attempt++)
{
var settingsWindow = ApiHelper.FindDesktopWindowHandler(
new[] { windowName, AdministratorPrefix + windowName });
if (settingsWindow.Count > 0)
{
var hexHwnd = settingsWindow[0].HWnd.ToString("x");
opts.AddAdditionalCapability("appTopLevelWindow", hexHwnd);
return;
}
if (attempt < maxRetries)
{
Thread.Sleep(delayMs);
}
else
{
throw new TimeoutException("Failed to find PowerToys Settings window after multiple attempts.");
}
}
}
}
/// <summary>
/// Starts a new exe and takes control of it.
/// </summary>
@@ -176,6 +208,19 @@ namespace Microsoft.PowerToys.UITest
public void ExitScopeExe()
{
ExitExe(sessionPath);
try
{
if (this.scope == PowerToysModule.PowerToysSettings)
{
runner?.Kill();
runner?.WaitForExit(); // Optional: Wait for the process to exit
}
}
catch (Exception ex)
{
// Handle exceptions if needed
Debug.WriteLine($"Exception during Cleanup: {ex.Message}");
}
}
/// <summary>

View File

@@ -68,16 +68,6 @@ namespace Microsoft.PowerToys.UITest
this.sessionHelper = new SessionHelper(scope).Init();
this.Session = new Session(this.sessionHelper.GetRoot(), this.sessionHelper.GetDriver(), scope, size);
if (this.scope == PowerToysModule.PowerToysSettings)
{
// close Debug warning dialog if any
// Such debug warning dialog seems only appear in PowerToys Settings
if (this.FindAll("DEBUG").Count > 0)
{
this.Find("DEBUG").Find<Button>("Close").Click();
}
}
}
/// <summary>

View File

@@ -12,6 +12,6 @@
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.7.250513003" />
<PackageVersion Include="Shmuelie.WinRTServer" Version="2.1.1" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<PackageVersion Include="System.Text.Json" Version="9.0.6" />
<PackageVersion Include="System.Text.Json" Version="9.0.7" />
</ItemGroup>
</Project>

View File

@@ -21,7 +21,7 @@ public partial class AppStateModel : ObservableObject
///////////////////////////////////////////////////////////////////////////
// STATE HERE
public RecentCommandsManager RecentCommands { get; private set; } = new();
public RecentCommandsManager RecentCommands { get; set; } = new();
// END SETTINGS
///////////////////////////////////////////////////////////////////////////

View File

@@ -32,22 +32,6 @@ internal sealed partial class NewExtensionForm : NewExtensionFormBase
"text": {{FormatJsonString(Properties.Resources.builtin_create_extension_page_title)}},
"size": "large"
},
{
"type": "TextBlock",
"text": {{FormatJsonString(Properties.Resources.builtin_create_extension_page_text)}},
"wrap": true
},
{
"type": "TextBlock",
"text": {{FormatJsonString(Properties.Resources.builtin_create_extension_name_header)}},
"weight": "bolder",
"size": "default"
},
{
"type": "TextBlock",
"text": {{FormatJsonString(Properties.Resources.builtin_create_extension_name_description)}},
"wrap": true
},
{
"type": "Input.Text",
"label": {{FormatJsonString(Properties.Resources.builtin_create_extension_name_label)}},
@@ -59,14 +43,11 @@ internal sealed partial class NewExtensionForm : NewExtensionFormBase
},
{
"type": "TextBlock",
"text": {{FormatJsonString(Properties.Resources.builtin_create_extension_display_name_header)}},
"weight": "bolder",
"size": "default"
},
{
"type": "TextBlock",
"text": {{FormatJsonString(Properties.Resources.builtin_create_extension_display_name_description)}},
"wrap": true
"text": {{FormatJsonString(Properties.Resources.builtin_create_extension_name_description)}},
"wrap": true,
"size": "small",
"isSubtle": true,
"spacing": "none"
},
{
"type": "Input.Text",
@@ -74,18 +55,16 @@ internal sealed partial class NewExtensionForm : NewExtensionFormBase
"isRequired": true,
"errorMessage": {{FormatJsonString(Properties.Resources.builtin_create_extension_display_name_required)}},
"id": "DisplayName",
"placeholder": "My new extension"
"placeholder": "My new extension",
"spacing": "medium"
},
{
"type": "TextBlock",
"text": {{FormatJsonString(Properties.Resources.builtin_create_extension_directory_header)}},
"weight": "bolder",
"size": "default"
},
{
"type": "TextBlock",
"text": {{FormatJsonString(Properties.Resources.builtin_create_extension_directory_description)}},
"wrap": true
"text": {{FormatJsonString(Properties.Resources.builtin_create_extension_display_name_description)}},
"wrap": true,
"size": "small",
"isSubtle": true,
"spacing": "none"
},
{
"type": "Input.Text",
@@ -93,7 +72,16 @@ internal sealed partial class NewExtensionForm : NewExtensionFormBase
"isRequired": true,
"errorMessage": {{FormatJsonString(Properties.Resources.builtin_create_extension_directory_required)}},
"id": "OutputPath",
"placeholder": "C:\\users\\me\\dev"
"placeholder": "C:\\users\\me\\dev",
"spacing": "medium"
},
{
"type": "TextBlock",
"text": {{FormatJsonString(Properties.Resources.builtin_create_extension_directory_description)}},
"wrap": true,
"size": "small",
"isSubtle": true,
"spacing": "none"
}
],
"actions": [

View File

@@ -70,7 +70,7 @@ namespace Microsoft.CmdPal.UI.ViewModels.Properties {
}
/// <summary>
/// Looks up a localized string similar to Where should the new extension be created? This path will be created if it doesn&apos;t exist.
/// Looks up a localized string similar to Select the folder where the new extension will be created. The path will be created if it doesn&apos;t exist..
/// </summary>
public static string builtin_create_extension_directory_description {
get {
@@ -78,15 +78,6 @@ namespace Microsoft.CmdPal.UI.ViewModels.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Output path.
/// </summary>
public static string builtin_create_extension_directory_header {
get {
return ResourceManager.GetString("builtin_create_extension_directory_header", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Output path.
/// </summary>
@@ -106,7 +97,7 @@ namespace Microsoft.CmdPal.UI.ViewModels.Properties {
}
/// <summary>
/// Looks up a localized string similar to The name of your extension as users will see it..
/// Looks up a localized string similar to The name of the extension as it will appear to users..
/// </summary>
public static string builtin_create_extension_display_name_description {
get {
@@ -114,15 +105,6 @@ namespace Microsoft.CmdPal.UI.ViewModels.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Display name.
/// </summary>
public static string builtin_create_extension_display_name_header {
get {
return ResourceManager.GetString("builtin_create_extension_display_name_header", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Display name.
/// </summary>
@@ -151,7 +133,7 @@ namespace Microsoft.CmdPal.UI.ViewModels.Properties {
}
/// <summary>
/// Looks up a localized string similar to This is the name of your new extension project. It should be a valid C# class name. Best practice is to also include the word &apos;Extension&apos; in the name..
/// Looks up a localized string similar to Enter a valid C# class name for the new extension project. It&apos;s recommended to include the word &quot;Extension&quot; in the name..
/// </summary>
public static string builtin_create_extension_name_description {
get {
@@ -159,15 +141,6 @@ namespace Microsoft.CmdPal.UI.ViewModels.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Extension name.
/// </summary>
public static string builtin_create_extension_name_header {
get {
return ResourceManager.GetString("builtin_create_extension_name_header", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Extension name.
/// </summary>
@@ -205,16 +178,7 @@ namespace Microsoft.CmdPal.UI.ViewModels.Properties {
}
/// <summary>
/// Looks up a localized string similar to Use this page to create a new extension project..
/// </summary>
public static string builtin_create_extension_page_text {
get {
return ResourceManager.GetString("builtin_create_extension_page_text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Create your new extension.
/// Looks up a localized string similar to Create a new extension.
/// </summary>
public static string builtin_create_extension_page_title {
get {

View File

@@ -180,16 +180,10 @@
<value>Once you're ready to test deploy the package locally with Visual Studio, then run the \"Reload\" command in the Command Palette to load your new extension.</value>
</data>
<data name="builtin_create_extension_page_title" xml:space="preserve">
<value>Create your new extension</value>
</data>
<data name="builtin_create_extension_page_text" xml:space="preserve">
<value>Use this page to create a new extension project.</value>
</data>
<data name="builtin_create_extension_name_header" xml:space="preserve">
<value>Extension name</value>
<value>Create a new extension</value>
</data>
<data name="builtin_create_extension_name_description" xml:space="preserve">
<value>This is the name of your new extension project. It should be a valid C# class name. Best practice is to also include the word 'Extension' in the name.</value>
<value>Enter a valid C# class name for the new extension project. It's recommended to include the word "Extension" in the name.</value>
</data>
<data name="builtin_create_extension_name_label" xml:space="preserve">
<value>Extension name</value>
@@ -197,11 +191,8 @@
<data name="builtin_create_extension_name_required" xml:space="preserve">
<value>Extension name is required and must be a valid C# identifier (start with a letter or underscore, followed by letters, numbers, or underscores)</value>
</data>
<data name="builtin_create_extension_display_name_header" xml:space="preserve">
<value>Display name</value>
</data>
<data name="builtin_create_extension_display_name_description" xml:space="preserve">
<value>The name of your extension as users will see it.</value>
<value>The name of the extension as it will appear to users.</value>
</data>
<data name="builtin_create_extension_display_name_label" xml:space="preserve">
<value>Display name</value>
@@ -209,11 +200,8 @@
<data name="builtin_create_extension_display_name_required" xml:space="preserve">
<value>Display name is required</value>
</data>
<data name="builtin_create_extension_directory_header" xml:space="preserve">
<value>Output path</value>
</data>
<data name="builtin_create_extension_directory_description" xml:space="preserve">
<value>Where should the new extension be created? This path will be created if it doesn't exist</value>
<value>Select the folder where the new extension will be created. The path will be created if it doesn't exist.</value>
</data>
<data name="builtin_create_extension_directory_label" xml:space="preserve">
<value>Output path</value>

View File

@@ -130,7 +130,7 @@ public partial class SettingsModel : ObservableObject
{
foreach (var item in newSettings)
{
savedSettings[item.Key] = item.Value != null ? item.Value.DeepClone() : null;
savedSettings[item.Key] = item.Value?.DeepClone();
}
var serialized = savedSettings.ToJsonString(JsonSerializationContext.Default.Options);
@@ -188,6 +188,8 @@ public partial class SettingsModel : ObservableObject
[JsonSerializable(typeof(HistoryItem))]
[JsonSerializable(typeof(SettingsModel))]
[JsonSerializable(typeof(AppStateModel))]
[JsonSerializable(typeof(RecentCommandsManager))]
[JsonSerializable(typeof(List<string>), TypeInfoPropertyName = "StringList")]
[JsonSerializable(typeof(List<HistoryItem>), TypeInfoPropertyName = "HistoryList")]
[JsonSerializable(typeof(Dictionary<string, object>), TypeInfoPropertyName = "Dictionary")]
[JsonSourceGenerationOptions(UseStringEnumConverter = true, WriteIndented = true, IncludeFields = true, PropertyNameCaseInsensitive = true, AllowTrailingCommas = true)]

View File

@@ -38,7 +38,7 @@ public sealed class AdaptiveCardsConfig
"fontFamily": "'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
"fontSizes": {
"small": 12,
"default": 12,
"default": 14,
"medium": 14,
"large": 20,
"extraLarge": 26
@@ -199,7 +199,7 @@ public sealed class AdaptiveCardsConfig
"fontFamily": "'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
"fontSizes": {
"small": 12,
"default": 12,
"default": 14,
"medium": 14,
"large": 20,
"extraLarge": 26

View File

@@ -100,6 +100,16 @@
</Grid>
</DataTemplate>
<Style x:Key="HotkeyStyle" TargetType="Border">
<Style.Setters>
<Setter Property="Padding" Value="4" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Background" Value="{ThemeResource ControlFillColorSecondaryBrush}" />
<Setter Property="BorderBrush" Value="{ThemeResource DividerStrokeColorDefaultBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="6" />
</Style.Setters>
</Style>
</ResourceDictionary>
</UserControl.Resources>
@@ -193,17 +203,12 @@
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{x:Bind ViewModel.PrimaryCommand.Name, Mode=OneWay}" />
<Border
Padding="4"
Background="{ThemeResource SubtleFillColorSecondaryBrush}"
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="4">
<Border Style="{StaticResource HotkeyStyle}">
<FontIcon
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="10"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
Glyph="&#xE751;" />
</Border>
</StackPanel>
@@ -221,32 +226,20 @@
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{x:Bind ViewModel.SecondaryCommand.Name, Mode=OneWay}" />
<StackPanel Orientation="Horizontal" Spacing="2">
<Border
Padding="4,2,4,2"
VerticalAlignment="Center"
Background="{ThemeResource SubtleFillColorSecondaryBrush}"
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="4">
<StackPanel Orientation="Horizontal" Spacing="4">
<Border Padding="4,2,4,2" Style="{StaticResource HotkeyStyle}">
<TextBlock
CharacterSpacing="4"
FontSize="10"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
Text="Ctrl" />
</Border>
<Border
Padding="4"
VerticalAlignment="Center"
Background="{ThemeResource SubtleFillColorSecondaryBrush}"
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="4">
<Border Style="{StaticResource HotkeyStyle}">
<FontIcon
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="10"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
Glyph="&#xE751;" />
</Border>
</StackPanel>
@@ -267,7 +260,6 @@
Opened="Flyout_Opened"
Placement="TopEdgeAlignedRight">
<StackPanel>
<ListView
x:Name="CommandsDropdown"
MinWidth="248"
@@ -288,7 +280,6 @@
<TransitionCollection />
</ListView.ItemContainerTransitions>
</ListView>
<TextBox
x:Name="ContextFilterBox"
x:Uid="ContextFilterBox"
@@ -296,7 +287,6 @@
KeyDown="ContextFilterBox_KeyDown"
PreviewKeyDown="ContextFilterBox_PreviewKeyDown"
TextChanged="ContextFilterBox_TextChanged" />
</StackPanel>
</Flyout>
</Button.Flyout>

View File

@@ -19,6 +19,5 @@
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid x:Name="ContentGrid" />
</UserControl>

View File

@@ -6,14 +6,14 @@
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<StaticResource x:Key="TagBackground" ResourceKey="ControlSolidFillColorDefaultBrush" />
<StaticResource x:Key="TagBorderBrush" ResourceKey="ControlStrokeColorSecondaryBrush" />
<StaticResource x:Key="TagBackground" ResourceKey="ControlFillColorSecondaryBrush" />
<StaticResource x:Key="TagBorderBrush" ResourceKey="DividerStrokeColorDefaultBrush" />
<StaticResource x:Key="TagForeground" ResourceKey="TextFillColorTertiaryBrush" />
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<StaticResource x:Key="TagBackground" ResourceKey="ControlSolidFillColorDefaultBrush" />
<StaticResource x:Key="TagBorderBrush" ResourceKey="ControlStrokeColorSecondaryBrush" />
<StaticResource x:Key="TagBackground" ResourceKey="ControlFillColorSecondaryBrush" />
<StaticResource x:Key="TagBorderBrush" ResourceKey="DividerStrokeColorDefaultBrush" />
<StaticResource x:Key="TagForeground" ResourceKey="TextFillColorTertiaryBrush" />
</ResourceDictionary>

View File

@@ -108,7 +108,7 @@
</ResourceDictionary>
</Page.Resources>
<Grid Background="{ThemeResource CardBackgroundFillColorDefaultBrush}">
<Grid>
<ScrollView VerticalAlignment="Top" VerticalScrollMode="Enabled">
<ItemsRepeater
VerticalAlignment="Stretch"

View File

@@ -380,19 +380,19 @@
To="24,0,0"
Duration="0:0:0.187" />
</animations:Implicit.HideAnimations>
<Grid Margin="12">
<Grid Margin="16">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<cpcontrols:IconBox
x:Name="HeroImageBorder"
Width="64"
Margin="16,8,16,16"
HorizontalAlignment="Center"
Margin="0,0,16,16"
HorizontalAlignment="Left"
AutomationProperties.AccessibilityView="Raw"
SourceKey="{x:Bind ViewModel.Details.HeroImage, Mode=OneWay}"
SourceRequested="{x:Bind help:IconCacheProvider.SourceRequested}"
@@ -400,17 +400,15 @@
<TextBlock
Grid.Row="1"
HorizontalAlignment="Center"
FontSize="18"
FontWeight="SemiBold"
Text="{x:Bind ViewModel.Details.Title, Mode=OneWay}"
TextAlignment="Center"
TextWrapping="WrapWholeWords"
Visibility="{x:Bind ViewModel.Details.Title, Converter={StaticResource StringNotEmptyToVisibilityConverter}, Mode=OneWay}" />
<toolkit:MarkdownTextBlock
Grid.Row="2"
Margin="0,12,0,24"
Margin="0,4,0,24"
Background="Transparent"
Header3FontSize="12"
Header3FontWeight="Normal"

View File

@@ -22,8 +22,7 @@ namespace Microsoft.CmdPal.Ext.WindowsSettings;
internal static class ResultHelper
{
internal static List<ListItem> GetResultList(
in IEnumerable<Classes.WindowsSetting> list,
string query)
in IEnumerable<Classes.WindowsSetting> list)
{
var resultList = new List<ListItem>(list.Count());

View File

@@ -0,0 +1,84 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.CmdPal.Ext.WindowsSettings.Classes;
namespace Microsoft.CmdPal.Ext.WindowsSettings.Helpers;
internal static class ScoringHelper
{
// Rank settings by how they matched the search query. Order is:
// 1. Exact Name (10 points)
// 2. Name Starts With (8 points)
// 3. Name (5 points)
// 4. Area (4 points)
// 5. AltName (2 points)
// 6. Settings path (1 point)
internal static (WindowsSetting Setting, int Score) SearchScoringPredicate(string query, WindowsSetting setting)
{
if (string.IsNullOrWhiteSpace(query))
{
// If no search string is entered skip query comparison.
return (setting, 0);
}
if (string.Equals(setting.Name, query, StringComparison.OrdinalIgnoreCase))
{
return (setting, 10);
}
if (setting.Name.StartsWith(query, StringComparison.CurrentCultureIgnoreCase))
{
return (setting, 8);
}
if (setting.Name.Contains(query, StringComparison.CurrentCultureIgnoreCase))
{
return (setting, 5);
}
if (!(setting.Areas is null))
{
foreach (var area in setting.Areas)
{
// Search for areas on normal queries.
if (area.Contains(query, StringComparison.CurrentCultureIgnoreCase))
{
return (setting, 4);
}
// Search for Area only on queries with action char.
if (area.Contains(query.Replace(":", string.Empty), StringComparison.CurrentCultureIgnoreCase)
&& query.EndsWith(":", StringComparison.CurrentCultureIgnoreCase))
{
return (setting, 4);
}
}
}
if (!(setting.AltNames is null))
{
foreach (var altName in setting.AltNames)
{
if (altName.Contains(query, StringComparison.CurrentCultureIgnoreCase))
{
return (setting, 2);
}
}
}
// Search by key char '>' for app name and settings path
if (query.Contains('>') && ResultHelper.FilterBySettingsPath(setting, query))
{
return (setting, 1);
}
return (setting, 0);
}
}

View File

@@ -0,0 +1,89 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Xml.Linq;
using Microsoft.CmdPal.Ext.WindowsSettings.Classes;
using Microsoft.CmdPal.Ext.WindowsSettings.Commands;
using Microsoft.CmdPal.Ext.WindowsSettings.Helpers;
using Microsoft.CmdPal.Ext.WindowsSettings.Properties;
using Microsoft.CommandPalette.Extensions.Toolkit;
namespace Microsoft.CmdPal.Ext.WindowsSettings.Pages;
internal sealed partial class FallbackWindowsSettingsItem : FallbackCommandItem
{
private readonly Classes.WindowsSettings _windowsSettings;
private readonly string _title = Resources.settings_fallback_title;
private readonly string _subtitle = Resources.settings_fallback_subtitle;
public FallbackWindowsSettingsItem(Classes.WindowsSettings windowsSettings)
: base(new NoOpCommand(), Resources.settings_title)
{
Icon = IconHelpers.FromRelativePath("Assets\\WindowsSettings.svg");
_windowsSettings = windowsSettings;
}
public override void UpdateQuery(string query)
{
Command = new NoOpCommand();
Title = string.Empty;
Subtitle = string.Empty;
Icon = null;
MoreCommands = null;
if (string.IsNullOrWhiteSpace(query) ||
_windowsSettings?.Settings is null)
{
return;
}
var filteredList = _windowsSettings.Settings
.Select(setting => ScoringHelper.SearchScoringPredicate(query, setting))
.Where(scoredSetting => scoredSetting.Score > 0)
.OrderByDescending(scoredSetting => scoredSetting.Score);
if (!filteredList.Any())
{
return;
}
if (filteredList.Count() == 1 ||
filteredList.Any(a => a.Score == 10))
{
var setting = filteredList.First().Setting;
Title = setting.Name;
Subtitle = setting.JoinedFullSettingsPath;
Icon = IconHelpers.FromRelativePath("Assets\\WindowsSettings.svg");
Command = new OpenSettingsCommand(setting)
{
Icon = IconHelpers.FromRelativePath("Assets\\WindowsSettings.svg"),
Name = setting.Name,
};
// There is a case with MMC snap-ins where we don't have .msc files fort them. Then we need to show the note for this results in subtitle too.
// These results have mmc.exe as command and their note property is filled.
if (setting.Command == "mmc.exe" && !string.IsNullOrEmpty(setting.Note))
{
Subtitle += $"\u0020\u0020\u002D\u0020\u0020{Resources.Note}: {setting.Note}"; // "\u0020\u0020\u002D\u0020\u0020" = "<space><space><minus><space><space>"
}
return;
}
// We found more than one result. Make our command take
// us to the Windows Settings search page, prepopulated with this search.
var settingsPage = new WindowsSettingsListPage(_windowsSettings, query);
Title = string.Format(CultureInfo.CurrentCulture, _title, query);
Icon = IconHelpers.FromRelativePath("Assets\\WindowsSettings.svg");
Subtitle = _subtitle;
Command = settingsPage;
return;
}
}

View File

@@ -6,6 +6,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.CmdPal.Ext.WindowsSettings.Classes;
using Microsoft.CmdPal.Ext.WindowsSettings.Helpers;
using Microsoft.CmdPal.Ext.WindowsSettings.Properties;
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
@@ -18,11 +20,17 @@ internal sealed partial class WindowsSettingsListPage : DynamicListPage
public WindowsSettingsListPage(Classes.WindowsSettings windowsSettings)
{
Icon = IconHelpers.FromRelativePath("Assets\\WindowsSettings.svg");
Name = "Windows Settings";
Name = Resources.settings_title;
Id = "com.microsoft.cmdpal.windowsSettings";
_windowsSettings = windowsSettings;
}
public WindowsSettingsListPage(Classes.WindowsSettings windowsSettings, string query)
: this(windowsSettings)
{
SearchText = query;
}
public List<ListItem> Query(string query)
{
if (_windowsSettings?.Settings is null)
@@ -31,87 +39,21 @@ internal sealed partial class WindowsSettingsListPage : DynamicListPage
}
var filteredList = _windowsSettings.Settings
.Select(SearchScoringPredicate)
.Select(setting => ScoringHelper.SearchScoringPredicate(query, setting))
.Where(scoredSetting => scoredSetting.Score > 0)
.OrderByDescending(scoredSetting => scoredSetting.Score)
.Select(scoredSetting => scoredSetting.Setting);
var newList = ResultHelper.GetResultList(filteredList, query);
var newList = ResultHelper.GetResultList(filteredList);
return newList;
// Rank settings by how they matched the search query. Order is:
// 1. Exact Name (10 points)
// 2. Name Starts With (8 points)
// 3. Name (5 points)
// 4. Area (4 points)
// 5. AltName (2 points)
// 6. Settings path (1 point)
(WindowsSetting Setting, int Score) SearchScoringPredicate(WindowsSetting setting)
{
if (string.IsNullOrWhiteSpace(query))
{
// If no search string is entered skip query comparison.
return (setting, 0);
}
if (string.Equals(setting.Name, query, StringComparison.OrdinalIgnoreCase))
{
return (setting, 10);
}
if (setting.Name.StartsWith(query, StringComparison.CurrentCultureIgnoreCase))
{
return (setting, 8);
}
if (setting.Name.Contains(query, StringComparison.CurrentCultureIgnoreCase))
{
return (setting, 5);
}
if (!(setting.Areas is null))
{
foreach (var area in setting.Areas)
{
// Search for areas on normal queries.
if (area.Contains(query, StringComparison.CurrentCultureIgnoreCase))
{
return (setting, 4);
}
// Search for Area only on queries with action char.
if (area.Contains(query.Replace(":", string.Empty), StringComparison.CurrentCultureIgnoreCase)
&& query.EndsWith(":", StringComparison.CurrentCultureIgnoreCase))
{
return (setting, 4);
}
}
}
if (!(setting.AltNames is null))
{
foreach (var altName in setting.AltNames)
{
if (altName.Contains(query, StringComparison.CurrentCultureIgnoreCase))
{
return (setting, 2);
}
}
}
// Search by key char '>' for app name and settings path
if (query.Contains('>') && ResultHelper.FilterBySettingsPath(setting, query))
{
return (setting, 1);
}
return (setting, 0);
}
}
public override void UpdateSearchText(string oldSearch, string newSearch)
{
RaiseItemsChanged(0);
if (oldSearch != newSearch)
{
RaiseItemsChanged(0);
}
}
public override IListItem[] GetItems()

View File

@@ -3840,6 +3840,42 @@ namespace Microsoft.CmdPal.Ext.WindowsSettings.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Search Windows settings for this device.
/// </summary>
internal static string settings_fallback_subtitle {
get {
return ResourceManager.GetString("settings_fallback_subtitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Search for &quot;{0}&quot; in Windows settings.
/// </summary>
internal static string settings_fallback_title {
get {
return ResourceManager.GetString("settings_fallback_title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Navigate to specific Windows settings.
/// </summary>
internal static string settings_subtitle {
get {
return ResourceManager.GetString("settings_subtitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Windows Settings.
/// </summary>
internal static string settings_title {
get {
return ResourceManager.GetString("settings_title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Settings app.
/// </summary>

View File

@@ -2085,4 +2085,16 @@
<data name="WindowsSettingsProvider_DisplayName" xml:space="preserve">
<value>Windows Settings</value>
</data>
<data name="settings_title" xml:space="preserve">
<value>Windows Settings</value>
</data>
<data name="settings_subtitle" xml:space="preserve">
<value>Navigate to specific Windows settings</value>
</data>
<data name="settings_fallback_title" xml:space="preserve">
<value>Search for "{0}" in Windows settings</value>
</data>
<data name="settings_fallback_subtitle" xml:space="preserve">
<value>Search Windows settings for this device</value>
</data>
</root>

View File

@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using Microsoft.CmdPal.Ext.WindowsSettings.Helpers;
using Microsoft.CmdPal.Ext.WindowsSettings.Pages;
using Microsoft.CmdPal.Ext.WindowsSettings.Properties;
using Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
@@ -17,6 +18,8 @@ public partial class WindowsSettingsCommandsProvider : CommandProvider
private readonly WindowsSettings.Classes.WindowsSettings? _windowsSettings;
#pragma warning restore CS8632 // The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
private readonly FallbackWindowsSettingsItem _fallback;
public WindowsSettingsCommandsProvider()
{
Id = "Windows.Settings";
@@ -26,9 +29,10 @@ public partial class WindowsSettingsCommandsProvider : CommandProvider
_windowsSettings = JsonSettingsListHelper.ReadAllPossibleSettings();
_searchSettingsListItem = new CommandItem(new WindowsSettingsListPage(_windowsSettings))
{
Title = "Windows Settings",
Subtitle = "Navigate to specific Windows settings",
Title = Resources.settings_title,
Subtitle = Resources.settings_subtitle,
};
_fallback = new(_windowsSettings);
UnsupportedSettingsHelper.FilterByBuild(_windowsSettings);
@@ -42,4 +46,6 @@ public partial class WindowsSettingsCommandsProvider : CommandProvider
_searchSettingsListItem
];
}
public override IFallbackCommandItem[] FallbackCommands() => [_fallback];
}

View File

@@ -615,7 +615,7 @@ namespace UITests_FancyZones
// test settings
Microsoft.PowerToys.UITest.CheckBox useShiftCheckBox = this.Find<Microsoft.PowerToys.UITest.CheckBox>("Hold Shift key to activate zones while dragging a window");
Microsoft.PowerToys.UITest.CheckBox useNonPrimaryMouseCheckBox = this.Find<Microsoft.PowerToys.UITest.CheckBox>("Use a non-primary mouse button to toggle zone activation");
Microsoft.PowerToys.UITest.CheckBox makeDraggedWindowTransparent = this.Find<Microsoft.PowerToys.UITest.CheckBox>("Make dragged window transparent");
Microsoft.PowerToys.UITest.CheckBox makeDraggedWindowTransparent = this.Find<Microsoft.PowerToys.UITest.CheckBox>("Make the dragged window transparent");
Find<Microsoft.PowerToys.UITest.CheckBox>("Show zone number").SetCheck(false, 100);
Find<Slider>("Opacity (%)").QuickSetValue(100); // make highlight color visible with opacity 100

View File

@@ -34,7 +34,7 @@
<TargetName>PowerToys.ImageResizerContextMenu</TargetName>
<!-- Needs a different int dir to avoid conflicts in msix creation. -->
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)\TemporaryBuild\obj\$(ProjectName)\</IntDir>
<OutDir>..\..\..\..\$(Platform)\$(Configuration)\</OutDir>
<OutDir>..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>

View File

@@ -29,7 +29,7 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir>..\..\..\..\$(Platform)\$(Configuration)\</OutDir>
<OutDir>..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\</OutDir>
</PropertyGroup>
<PropertyGroup>
<TargetName>PowerToys.$(ProjectName)</TargetName>

View File

@@ -26,7 +26,7 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
<OutDir>..\..\..\..\$(Platform)\$(Configuration)\</OutDir>
<OutDir>..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\</OutDir>
<TargetName>PowerToys.ImageResizerExt</TargetName>
</PropertyGroup>
<ItemDefinitionGroup>

View File

@@ -5,7 +5,7 @@
<PropertyGroup>
<AssemblyTitle>PowerToys.ImageResizer</AssemblyTitle>
<OutputPath>..\..\..\..\$(Platform)\$(Configuration)</OutputPath>
<OutputPath>..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>

View File

@@ -363,7 +363,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
RenamedEventArgs e = new RenamedEventArgs(WatcherChangeTypes.Renamed, directory, path, oldpath);
string oldFullPath = directory + "\\" + oldpath;
string fullPath = directory + "\\" + path;
string newFullPath = directory + "\\" + path;
string linkingTo = Directory.GetCurrentDirectory();
// ShellLinkHelper must be mocked for lnk applications
@@ -372,19 +372,8 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
Win32Program.ShellLinkHelper = mockShellLink.Object;
// old item and new item are the actual items when they are in existence
Win32Program olditem = new Win32Program
{
Name = "oldpath",
ExecutableName = oldpath,
FullPath = linkingTo,
};
Win32Program newitem = new Win32Program
{
Name = "path",
ExecutableName = path,
FullPath = linkingTo,
};
Win32Program olditem = Win32Program.GetAppFromPath(oldFullPath);
Win32Program newitem = Win32Program.GetAppFromPath(newFullPath);
win32ProgramRepository.Add(olditem);

View File

@@ -149,7 +149,7 @@ int runner(bool isProcessElevated, bool openSettings, std::string settingsWindow
std::vector<std::wstring_view> knownModules = {
L"PowerToys.FancyZonesModuleInterface.dll",
L"PowerToys.powerpreview.dll",
L"PowerToys.ImageResizerExt.dll",
L"WinUI3Apps/PowerToys.ImageResizerExt.dll",
L"PowerToys.KeyboardManager.dll",
L"PowerToys.Launcher.dll",
L"WinUI3Apps/PowerToys.PowerRenameExt.dll",