Clint Rutkas
90d · built 2026-11-22
Performance
What Clint Rutkas shipped in the selected window, measured in ETV, and how it compares with the 90 days before it.
Effective capacity
+47.0engineers
delivers like 48.0 (48.0x pre-AI)
Output (ETV)
26.9ETV
+134.3% vs 11.5 prior
Features share
33.9%
−3.0 pp vs prior window
Fixes share
11.4%
−28.3 pp vs prior window
Work mix
33.9% Features20.6% Maintenance30.4% Tests3.7% Docs11.4% Fixes
104 commits over 90 days, ending 2026-11-22.
Daily performance
Daily ETV, stacked by Features, Maintenance, Tests, Docs and Fixes.
Repository spread
Where this developer's commits land. Concentrated work (top1 > 80%) vs polymath spread (top1 < 30%).
Most impactful commits
Top 10 by ETV in the last 90 days.
- 3.3ETVCmdPal: Add an AC polyfills library with native Chart.Line (#51208) <!-- 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 **Layer 2 of 13 in a stack that splits #51125** (native Adaptive Cards charts and redesigned Performance Monitor cards) into reviewable PRs. See #51125 for the full picture. This PR targets layer 1's branch (#51204), so its diff shows only this layer. It adds `Microsoft.CmdPal.AdaptiveCards.Polyfills`, a library that renders Adaptive Cards schema elements the WinUI 3 renderer doesn't support yet, with its first element, `Chart.Line`: - Smooth, filled lines with gridlines, axis titles, a legend, and a marker on the latest point. - New data updates the chart in place, through layer 1's patchable elements. When live data gains one sample, the lines scroll left instead of the card being rebuilt. - Narrower than 400 px, the chart draws as a sparkline, as in a dashboard tile. - Colors come from the schema's color names, in light and dark variants. In a contrast theme, series take the theme's colors and also differ by dash pattern. Screen readers get the chart's name and a summary of each series. Any extension can send `Chart.Line` as standard Adaptive Cards JSON. Today the renderer drops it. Nothing in Command Palette uses it yet; the Performance Monitor cards start in layer 5. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [ ] Closes: N/A. There's no issue; this is layer 2 of 13 splitting #51125 <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) --> - [ ] **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 (7 new strings in Command Palette's `Resources.resw`; the library gets them from the host) - [x] **Dev docs:** Added/updated (the library's `README.md`) - [x] **New binaries:** Added on the required places. `Microsoft.CmdPal.AdaptiveCards.Polyfills.dll` ships inside Command Palette's MSIX, which is signed as a whole, like `Microsoft.CmdPal.AdaptiveCards.IncrementalRendering.dll`, so it only needs the solution entries. - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries (not needed: the MSIX is signed) - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder (not needed: it's in the MSIX) - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects (not needed: CI runs every `**\*UnitTest*.dll`) - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) (not needed) - [ ] **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 ### The library - **It fills gaps in the WinUI 3 renderer without a fork.** Elements are registered through the renderer's public custom element APIs: a parser in the element parser registration and a renderer in `ElementRenderers`. - **Nothing in it is specific to Command Palette.** Each element can move to the renderer in [microsoft/AdaptiveCards](https://github.com/microsoft/AdaptiveCards) and be deleted here. The README's "Upstream" section covers what moving one takes. - **It has no XAML or resources.** Controls are built in code, and the host passes its strings in: `RegisterRenderers(renderer, getString)` takes a lookup for the `AdaptiveChart_*` strings in Command Palette's `Resources.resw`. - **Each element is a model and a control.** Models parse the element JSON leniently (invalid values read as missing, with a warning) and don't use WinUI, so the unit tests cover them without a window. Models read only the properties on the element's page in the [Adaptive Cards element reference](https://adaptivecards.microsoft.com/). ### Wiring it in - `ContentFormControl` calls `AdaptiveCardPolyfills.RegisterParsers` and `RegisterRenderers`, and passes `AdaptiveCardPolyfills.PatchableElements` to the incremental updater. - `AdaptiveCustomElementJson` moves from `Microsoft.CmdPal.UI` into the library and becomes public, so the settings inputs and the new elements read the properties every element has (`id`, `isVisible`, `spacing`, `fallback`, `requires`, and so on) the same way. Its new optional `requireId` parameter defaults to `true`; charts don't need an `id`. The settings inputs don't change. ### The fallback workaround When a custom element renderer asks the WinUI 3 renderer to draw the element's `fallback`, `XamlBuilder::RenderAsUIElement` renders the fallback but returns an empty result, so nothing shows. `AdaptiveFallbackRenderer` works around that bug: the element renderer draws the fallback itself and returns it. `Chart.Line` always draws itself, so nothing uses this yet; `Icon` does in layer 3, for icon names without a glyph. ### Shared code for the next layers The theme, palette, scale, curve, shape, and number formatting code lands here whole, with its tests, so the later layers only add elements. Some of it isn't used by `Chart.Line`: - `ChartArc` and the arc, wedge, and ring helpers in `ChartShapes`: gauge and donut charts (layer 10). - `ChartDataPoint` and `ChartJson.GetDataPoints`: bar charts (layer 4) and gauge and donut charts. - The track, semantic, and contrasting text colors in `ChartTheme`, and high contrast outlines in `ChartPalette`: progress bars, badges, and icons (layer 3), bar charts, and gauge and donut charts. - The `AdaptiveVisualControl` base class and `AdaptiveFallbackRenderer`: layer 3 on. `LineChartControl` implements its own updates, so that it can animate a one-sample shift as a scroll. ### Screenshots Live line charts, captured with a local card harness (not in the repo): an unpackaged WinUI app that renders inline `Chart.Line` cards through the real renderer, this library, and `IncrementalAdaptiveCardUpdater`, at the dock window's content width (776 px), with `main`'s host config and data that gains one sample a second. | | Dark | Light | |---|---|---| | One series |  |  | | Two series |  |  | | Narrow columns, drawn as sparklines |  |  | The two-series chart in a simulated Aquatic contrast theme (the harness applies the theme's colors to the charts only). The series take the theme's colors and differ by dash pattern, which the legend shows:  <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Every library and test file is identical to its version at #51125's head (`8858a9e0a7`), except `AdaptiveCardPolyfills.cs` and `README.md`, which are cut down to `Chart.Line`. In `Microsoft.CmdPal.UI`, `ContentFormControl.xaml.cs` takes only the polyfills lines; the host config lines are in #51205. ARM64 Debug builds, run from a `subst` drive (common build options: `-nologo -m -restore -t:Build -v:minimal -p:Configuration=Debug -p:Platform=ARM64 -p:RuntimeIdentifier=win-arm64 -p:CIBuild=false -p:GeneratePackageLocally=false -p:GenerateAppxPackageOnBuild=false -p:PublishAppxPackage=false -p:SkipLongPathsCheck=true`): - `MSBuild.exe src\modules\cmdpal\Tests\Microsoft.CmdPal.AdaptiveCards.Polyfills.UnitTests\Microsoft.CmdPal.AdaptiveCards.Polyfills.UnitTests.csproj <options>`: exit code 0, no warnings. It builds the library, which is `IsAotCompatible`, so the trim and AOT analyzers run. - `vstest.console.arm64.exe ARM64\Debug\WinUI3Apps\CmdPal\tests\Microsoft.CmdPal.AdaptiveCards.Polyfills.UnitTests.dll /Platform:ARM64`: 81 passed, 0 failed. - `MSBuild.exe src\modules\cmdpal\Microsoft.CmdPal.UI\Microsoft.CmdPal.UI.csproj <options>`: exit code 0. No warnings from C# projects; the only warnings are this machine's missing `NETFXSDK` LIB path (CS1668) and LNK4075 in the C++ projects, which this PR doesn't touch. - `MSBuild.exe src\modules\cmdpal\Tests\Microsoft.CmdPal.UI.UnitTests\Microsoft.CmdPal.UI.UnitTests.csproj <options>`: exit code 0, no warnings. - `vstest.console.arm64.exe ARM64\Debug\WinUI3Apps\CmdPal\tests\Microsoft.CmdPal.UI.UnitTests.dll /Platform:ARM64`: 715 passed, 0 failed. - `.pipelines\verifyCommonProps.ps1 -sourceDir <worktree>\src`: exit code 0. - Spelling: the repo's check-spelling workflow is disabled, so I ran a local approximation of it (its dictionaries plus `expect.txt`) over this PR's diff: no unknown words and no forbidden patterns. `sparkline` is added to `expect.txt`. The unit tests run under JIT, and release builds compile Command Palette with native AOT, so I also ran the card harness both ways. Each run renders the three cards in dark and light, updates them once a second, and counts the updates that replaced the whole card instead of patching the chart: | Harness build | Updates per card | Updates that replaced the whole card | |---|---|---| | JIT, library sources compiled in | 8 | 0 | | Native AOT (`PublishAot`, optimized), referencing the library assembly | 10 | 0 | The native AOT publish had no trim or AOT warnings, and its screenshots match the JIT ones.github.com-microsoft-PowerToys · 43c7f8cf · 2026-11-03
- 1.8ETV[Deps] Upgrade System.CommandLine to 2.0 GA (#50884) ## Summary of the Pull Request Upgrades System.CommandLine from `2.0.0-beta4.22272.1` to `2.0.1` and migrates PowerToys.DSC, Awake, FancyZonesCLI, Image Resizer, and PowerDisplay.Cli (and their tests) to the 2.0 API. Option names, aliases, defaults, and exit codes are unchanged. ## PR Checklist - [ ] Closes: N/A - [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 - [ ] **Localization:** All end-user-facing strings can be localized (no new strings) - [x] **Dev docs:** Added/updated (`doc/devdocs/cli-conventions.md`) - [ ] **New binaries:** Added on the required places (none) - [ ] **Documentation updated:** N/A ## Detailed Description of the Pull Request / Additional comments - `2.0.1` is pinned because it's the newest 2.0.x available in the PowerToys NuGet feed. - The Image Resizer and PowerDisplay CLIs remove the `--help`/`--version` options that 2.0 adds to every `RootCommand`, so `-h` keeps its existing meaning. - `CA1010` is suppressed where public types derive from `Command`, which implements only non-generic `IEnumerable`. - User-visible changes: - Help lists `-?, -h, --help` before `--version`, and Awake no longer prints `[default: False]`. - The Image Resizer CLI rejects invalid `--unit`/`--fit` values with exit code 1 instead of ignoring them. - FancyZonesCLI reports one error instead of two for `set-layout <layout> --monitor 0 --all`. ## Validation Steps Performed - CI: [PowerToys CI build 390259](https://dev.azure.com/shine-oss/PowerToys/_build/results?buildId=390259): x64/arm64 builds, unit tests, and UI tests. - Anonymous restore on a clean NuGet cache downloads `System.CommandLine 2.0.1` from the feed. - Built all seven System.CommandLine consumers locally; DSC, Awake, Image Resizer, PowerDisplay.Cli, and CmdPal Shell unit tests pass (2 new Image Resizer tests). - Compared `--help` and representative invocations of each CLI against main. The DSC `manifest` output and the Settings search index are byte-identical. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Yu Leng <42196638+moooyo@users.noreply.github.com>github.com-microsoft-PowerToys · d162b92e · 2026-10-13
- 1.6ETV[Preview Pane] Enable nullable reference types (#51099) <!-- 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 Turns on `<Nullable>enable</Nullable>` in all 26 Preview Pane (File Explorer add-ons) product and unit-test projects. It also fixes every CS86xx warning those projects then produce: **176 in total**, which would otherwise be errors because of `TreatWarningsAsErrors`. This is the first slice of QA-4, which turns on nullable one project at a time. Preview handlers go first because they parse untrusted files. The goal is to keep behavior the same. Fixes are mainly accurate annotations (`?`, `[MemberNotNull]`, initializers) and pattern-matched event senders. There is no `#pragma`, no `NoWarn`, and no `#nullable disable` added. This PR also **removes** an existing `#nullable enable/disable` pair in Monaco. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [ ] Closes: #xxx <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) --> - [ ] **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 - [ ] **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 **Scope.** All projects are under `src\modules\previewpane\`. There is one commit per handler family so it's easier to review: Bgcode/Gcode, Pdf, Qoi, Stl, Markdown, Monaco, Svg, PreviewHandlerCommon tests. - **Product (13):** Bgcode PH/TP, Gcode PH/TP, Markdown PH, Monaco PH, Pdf PH/TP, Qoi PH/TP, Stl TP, Svg PH/TP. - **Unit tests (13):** `UnitTests-{Bgcode,Gcode,Pdf,Qoi}{PreviewHandler,ThumbnailProvider}`, `UnitTests-MarkdownPreviewHandler`, `UnitTests-PreviewHandlerCommon`, `UnitTests-StlThumbnailProvider`, `UnitTests-Svg{PreviewHandler,ThumbnailProvider}`. **Not changed:** - `PreviewHandlerCommon.csproj` and `src\common\FilePreviewCommon` already had Nullable enabled, so no shared code or public API outside the preview pane changed. Peek and other consumers are unaffected. Nothing outside `src\modules\previewpane` references the handler namespaces. - `*UITests*` projects were left out on purpose because #51088 touches them. **Warnings fixed.** These counts come from a collection build with `-p:TreatWarningsAsErrors=false`, unique by file and line. | Project | # | Project | # | |---|---|---|---| | BgcodePreviewHandler | 11 | UnitTests-BgcodePreviewHandler | 1 | | BgcodeThumbnailProvider | 9 | UnitTests-BgcodeThumbnailProvider | 1 | | GcodePreviewHandler | 11 | UnitTests-GcodePreviewHandler | 1 | | GcodeThumbnailProvider | 9 | UnitTests-GcodeThumbnailProvider | 1 | | MarkdownPreviewHandler | 19 | UnitTests-MarkdownPreviewHandler | 13 | | MonacoPreviewHandler | 2* | UnitTests-PdfPreviewHandler | 1 | | PdfPreviewHandler | 11 | UnitTests-PdfThumbnailProvider | 1 | | PdfThumbnailProvider | 5 | UnitTests-PreviewHandlerCommon | 7 | | QoiPreviewHandler | 10 | UnitTests-QoiPreviewHandler | 1 | | QoiThumbnailProvider | 8 | UnitTests-QoiThumbnailProvider | 1 | | StlThumbnailProvider | 8 | UnitTests-StlThumbnailProvider | 1 | | SvgPreviewHandler | 14 | UnitTests-SvgPreviewHandler | 3 | | SvgThumbnailProvider | 17 | UnitTests-SvgThumbnailProvider | 11 | \* Monaco's count was low because most of its control was still under the old `#nullable disable`. Removing that pair surfaced about 15 more warnings, which are also fixed here. By code: CS8600 34, CS8602 12, CS8603 38, CS8604 10, CS8618 42, CS8622 25, CS8625 15. **Common patterns:** - **WinForms/WebView2 fields that are created lazily** (`_browser`, `_textBox`, `_infoBar`, `_webView2Environment`, `_localFileURI`, and so on) are now marked `?`. - Resize handlers that use them check for null first. Before, those handlers only ran after the field was assigned. - **Event handler senders** are now `object?`, matching the WinForms/WebView2 delegate signatures. - `RTBContentsResized` uses `sender is RichTextBox richTextBox` instead of a hard cast. - **Thumbnail `GetThumbnail`/`ResizeImage` methods** already returned `null` (for out-of-range `cx`, GPO disabled, or bad data). They now return `Bitmap?`. - The static `GetThumbnail(reader/stream)` parameters are now nullable because the code and tests already pass and handle `null`. - **Telemetry `*FilePreviewError.Message`** now defaults to `string.Empty`, matching Peek. - **Monaco:** - `InitializeLoadingScreen` has `[MemberNotNull(_loading, _loadingBar, _loadingBackground)]`. - `WebView2Init` pattern-matches the sender instead of using `(sender as WebView2).CoreWebView2`. - **Svg TP:** the constructor uses the null-checked `FilePath` property instead of the raw parameter. Both hold the same value. **Null-forgiving `!` uses (10 total).** - **Product (7):** - `Environment.GetEnvironmentVariable("USERPROFILE")!` inside `Path.Combine` in 6 `Program.cs` files (Bgcode, Gcode, Markdown, Pdf, Qoi, Svg PH). This keeps the existing behavior: if the variable were somehow unset, `Path.Combine` throws `ArgumentNullException`, the same as before. - `SvgPreviewControl.CoreWebView2_BlockExternalResources`: `_browser!`. The handler is only subscribed on `_browser.CoreWebView2`, so `_browser` is always set when it runs. - **Tests (3):** - `Path.GetDirectoryName(<temp path>)!` ×2 in `HTMLParsingExtensionTest`. - `new ReadonlyStream(stream!)` in the test that deliberately passes `null` to assert `ArgumentNullException`. **`#nullable disable`:** none added. The existing `#nullable enable` / `#nullable disable` pair around `_html` in `MonacoPreviewHandlerControl.cs` was **removed**. **Real latent bugs found:** none that can be reached at runtime. Every null guard added protects a field that is set by construction on the current code paths. Exceptions, early returns, and error UI are unchanged. **Tests:** assertions were not weakened. - Locals that receive a nullable result are now `Bitmap?`, `Uri?`, or `string?`. - Exception holders are now `XException?`. - `Assert.IsNotNull(textBox)` was added before RichTextBox members are dereferenced. That only makes stricter something the tests already relied on. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Environment: ARM64 dev box, VS 18 Enterprise MSBuild (`...\MSBuild\Current\Bin\arm64\MSBuild.exe`). `preview.slnf` is a solution filter over `PowerToys.slnx` containing the 26 in-scope projects and their dependencies. 1. **Restore:** `MSBuild.exe preview.slnf -t:Restore -p:Platform=x64 -p:Configuration=Release -p:RestorePackagesConfig=true` exited with code **0**. 2. **x64 Release full rebuild, warnings as errors** (repo default): - Command: `MSBuild.exe preview.slnf -t:Rebuild -p:Platform=x64 -p:Configuration=Release -m` - Result: exit code **0**, **0 errors, 0 CS86xx warnings**. - The 49 warnings left are pre-existing and unrelated: MSB3026/MSB3061 copy retries on Monaco assets during the parallel build, and 1 CsWinRT1028 in ManagedCommon. 3. **ARM64 Release:** - Restore: `MSBuild.exe preview.slnf -t:Restore -p:Platform=ARM64 -p:Configuration=Release -p:RestorePackagesConfig=true` exited with code **0**. - Rebuild: `MSBuild.exe preview.slnf -t:Rebuild -p:Platform=ARM64 -p:Configuration=Release -m` exited with code **0**, with 0 errors and 0 CS86xx warnings. The 23 warnings left are pre-existing MSB3026 and CsWinRT1028. 4. **Unit tests:** ran `vstest.console.exe <dll> /Platform:x64` for each x64 Release test DLL. **162/162 passed, 0 failed.** - Bgcode PH 2/2, Bgcode TP 5/5 - Gcode PH 4/4, Gcode TP 7/7 - Markdown (`PreviewPaneUnitTests.dll`) 64/64 - Pdf PH 2/2, Pdf TP 3/3 - PreviewHandlerCommon 35/35 - Qoi PH 2/2, Qoi TP 4/4 - Stl TP 5/5 - Svg PH 14/14, Svg TP 15/15 **Not validated:** - Manual previews and thumbnails in File Explorer and Outlook for each file type. - UI tests (`*UITests*` projects, out of scope). - Running the ARM64 test binaries (only the x64 tests were run). - I used the slnf with MSBuild directly instead of `tools\build\build.ps1` per project folder. It builds the same projects and configuration. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>github.com-microsoft-PowerToys · 32b0b54a · 2026-10-09
- 1.6ETVfix(common): handle packaged context menu servicing shutdown (#50218) ## Summary of the Pull Request Fixes packaged context-menu `HANG_QUIESCE` failures during PowerToys update/uninstall for File Locksmith, PowerRename, Image Resizer, and New+. These commands run in package-dedicated `dllhost.exe` COM surrogates. The surrogates have no top-level window, so packaged Win32 servicing has no `WM_CLOSE` target and waits for its timeout before force-terminating them. The Watson stack consequently shows the normal surrogate wait: `dllhost!wWinMain -> combase!CoRegisterSurrogateEx -> CSurrogateProcessActivator::WaitForSurrogateTimeout` This adds a shared lifecycle monitor in `src/common/utils/context_menu_lifecycle.h` and wires it into all four packaged context-menu DLLs. ## PR Checklist - [x] Closes: AB#51280953 - [x] **Communication:** Discussed with a core contributor during investigation - [ ] **Tests:** Automated coverage added and targeted builds pass; signed sparse-MSIX servicing A/B remains for CI/nightly validation - [x] **Localization:** No end-user-facing strings changed ## Detailed Description of the Pull Request / Additional comments The shared helper: - Activates only inside the expected package family, so classic/unpackaged hosts are unchanged. - Holds an ordinary module reference so its window procedure remains valid after COM considers the server unloadable. - Creates one hidden top-level `WS_POPUP` window on a dedicated message-pump thread, outside `DllMain`. - Returns `TRUE` for `WM_QUERYENDSESSION`. - Atomically closes new activity admission on `WM_CLOSE` or confirmed `WM_ENDSESSION`, waits for already-admitted work, then terminates the stateless package-dedicated surrogate before servicing's timeout. - Cleans up and permits retry when monitor initialization fails. - Emits one initialization HRESULT telemetry event per module. Module policy: - File Locksmith, PowerRename, and Image Resizer receive a 5-second grace period. - New+ receives 20 seconds because template copying and Explorer rename positioning happen in-process. Its rename worker transfers an activity token until completion. `DllCanUnloadNow` remains based on the existing COM object/worker counts. No package manifest, registration, IPC contract, or user-facing command behavior changes. A focused test in `src/modules/FileLocksmith/Tests/FileLocksmith.UITests/FileLocksmithContextMenuTests.cs` activates the real tier-1 command, locates the package-specific `dllhost` and lifecycle window, posts `WM_CLOSE`, requires process exit within five seconds, and verifies Explorer can reactivate the command. This PR is intentionally separate from #49502. That PR concerns `PowerToys.FileLocksmithUI.exe` native handle enumeration and `0xc0000005`; this PR concerns package servicing of context-menu COM surrogates. ## Validation Steps Performed - Release x64 builds passed for all four context-menu projects plus File Locksmith, PowerRename, and Image Resizer UITest projects. - `FileLocksmith.ContextMenu.ServicingShutdown` is discovered by the MSTest executable. - Local native builds used `/p:SpectreMitigation=false` because this host lacks the optional Spectre-mitigated MSVC libraries, and `/m:1` after a parallel PCH memory-pressure failure. - Package-generation events were disabled only for local compilation because project-local build logs are held while MakeAppx packs the same directory. No package-generation code changed. Nightly validation after merge: 1. Activate each modern command and confirm its package-specific `dllhost` owns the expected servicing window. 2. Upgrade from 0.101.x to the nightly and verify the surrogates exit before the timeout with no new `MOAPPLICATION_HANG_*ContextMenu!HANG_QUIESCE` reports. 3. Verify each command reactivates after its previous surrogate exits. 4. Exercise File Locksmith launch, PowerRename multi-file launch, Image Resizer multi-file launch, and New+ template copy/rename before and after update. 5. Compare initialization HRESULT telemetry and Watson buckets by version and integrity level. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Yu Leng (from Dev Box) <yuleng@microsoft.com> Copilot-Session: b5be3824-61fb-4110-b87e-7c8f73cdcfe2github.com-microsoft-PowerToys · e31b0196 · 2026-09-23
- 1.4ETVCmdPal: Redesign the Performance Monitor CPU card (#51211) <!-- 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 **Layer 5 of 13 in a stack that splits #51125** (native Adaptive Cards charts and redesigned Performance Monitor cards) into reviewable PRs. See #51125 for the full picture. This layer is based on layer 4 (#51210, `crutkas-stack-4-bar-charts`), so the diff shows only this layer. It's the first Performance Monitor card in the stack; the Memory, GPU, Disk, Network, and Battery cards follow in layers 6 to 11. This layer redesigns the Performance Monitor CPU card along the lines of Task Manager's CPU page, with the native elements from the layers below: - A 60-second utilization history (`Chart.Line`), instead of an SVG image of the last 34 samples. - The processor's name, and tiles for processes, threads, handles, up time, base speed, and logical processors. - Base speed now matches Task Manager on chips with more than one core cluster. - The five busiest processes, each with a `ProgressBar`. - Utilization by logical processor (`Chart.VerticalBar`). It also changes how the cards are sampled: - **One sample per second for each metric.** A metric shown in two places, such as a dock band and its card, had two 1-second timers that both sampled it, so its history ran at double speed. Now each metric is sampled at most once per 750 ms. - **The first sample shows right away**, instead of after the timer's first tick, so a card doesn't flash its placeholder. - **Top processes are averaged over 3 seconds and read only while the card is open**, like per-processor utilization, so the dock band doesn't pay for them. | | Dark | Light | |---|---|---| | `main` |  |  | | This PR |  |  | <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [ ] Closes: N/A. There's no issue; this is layer 5 of 13 splitting #51125 <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) --> - [ ] **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 (10 new `CPUUsage_Widget_Template/*` strings in the extension's `Resources.resw`, each with a comment) - [ ] **Dev docs:** Added/updated (N/A) - [ ] **New binaries:** Added on the required places (N/A, no new binaries) - [ ] [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 ### The card `SystemCPUUsageTemplate.json` is rewritten with `Chart.Line` (layer 2), `ProgressBar` and rounded, bordered tiles (layer 3), and `Chart.VerticalBar` (layer 4). Each new element has `"fallback": "drop"`. `SystemCPUUsageWidgetPage` fills it: - `cpuSeries`: the history, from `PerformanceChartData.Create`. - `cpuTopProcesses`: each busy process's name, percent, and percent as text (`CreateTopProcesses`). - `cpuCores`: one bar per logical processor (`CreateCoreBars`). - `cpuName`, `cpuBaseSpeed`, `cpuProcesses`, `cpuThreads`, `cpuHandles`, `cpuUptime` (days:hours:minutes:seconds, as in Task Manager), and `cpuLogicalProcessors`. The top processes and the per-processor chart appear once they have data (`$when` with `count(...) > 0`), because both need two samples. ### Structured template data `WidgetPage` gets `ContentJson`: `JsonNode` values, such as chart series and rows, that can't be expressed as strings. They're merged into the card data with the strings in `ContentData`, under the same lock, and deep-cloned so the timer thread can keep updating them. `WidgetPage` also gets `FormatUsedOfTotal` (such as `1.2 / 8.0 GB`) and `GetPercent`, which the Memory and GPU cards use in layers 6 and 7. They're tested here. ### CPU stats - `CPUStats` reads: - The base speed, once, from `CallNtPowerInformation(ProcessorInformation)` with room for every active processor: the highest rated speed (`MaxMhz`) of any logical processor, which is what Task Manager shows. Chips with more than one core cluster rate each cluster differently (2808 and 4004 MHz on the machine in the screenshots), and there the `Processor Frequency` counter changes between samples. If the call fails, the base speed comes from that counter, which matches the rated speed on chips with one core cluster. - Process, thread, and handle counts, from one `GetPerformanceInfo` call. - The processor's name, once, from the registry's `ProcessorNameString`. - Per-processor utilization, from one `ReadCategory` of `Processor Information` per sample, compared with the previous sample and ordered by group and index (`ComputeCoreUsage`). - The busiest processes, from `ProcessCpuSampler`. - Per-processor utilization and the busiest processes are read only while a CPU card is open: `SystemCPUUsageWidgetPage` calls `CPUStats.RequestDetails` when it loads and unloads, and the stats drop that state when no card needs it. - `ProcessCpuSampler` (new) works like Task Manager: one `NtQuerySystemInformation(SystemProcessInformation)` snapshot of every process's CPU time per sample, compared with the newest snapshot that's at least 3 seconds old (at first, the oldest one). Windows charges CPU time in clock ticks, so over one second most processes have none, and the list would change every sample. Processes with the same name are combined, and each share is of all processors' time. - On `main`, `CPUStats` could find top processes with one `Process` performance counter per process with a window, but nothing asked for them (`DataType.CpuWithTopProcesses`), and the card's lines for them were commented out. That code, `DataType.CpuWithTopProcesses`, and the unused `CreateCPUImageUrl`, `GetCpuProcessText`, and `KillTopProcess` are removed. ### Sampling - `DataManager.ShouldSample` samples a stats object at most once per 750 ms, which leaves room for timer jitter. Pages and dock bands that show the same metric share its stats, so each metric gets one sample per second, however many places show it. This covers CPU, memory, network, disk, GPU, and battery. - `DataManager.Start` takes the first sample right away, on the thread pool, instead of waiting for the timer's first tick. - #51206 (independent, based on `main`) has the same `ShouldSample` fix, including CPU, but keeps `main`'s `GetCPUData(bool includeTopProcesses)` and doesn't take the immediate first sample. `DataManager.cs` here is #51125's version, and `DataManagerTests.cs` is the same in both. If #51206 merges first, the rebase keeps this version. ### Charts on the other cards `PerformanceChartData` (new) builds `Chart.Line` data from up to 60 one-second samples, rounded to 0.1, with one color per metric. It also has the rate scale and sparkline helpers that the Disk, Network, GPU, and overview cards use in later layers, with their tests. The CPU history now keeps 60 samples, through a new three-argument `ChartHelper.AddNextChartValue`. The Memory, GPU, Disk, and Network cards keep `main`'s templates, SVG chart images, and 34-sample histories, through the two-argument overload, which now calls the new one. The SVG code goes away with the Network card (layer 9). Those cards, and the Battery card, still render (see the validation steps). ### Strings, native methods, and spelling - 10 new `CPUUsage_Widget_Template/*` strings in the extension's `Resources.resw`, each with a comment for translators. - `NativeMethods.txt`: `GetPerformanceInfo`, `CallNtPowerInformation`, `PROCESSOR_POWER_INFORMATION`, `GetActiveProcessorCount`, `ALL_PROCESSOR_GROUPS`, `NtQuerySystemInformation`, and `SYSTEM_PROCESS_INFORMATION`. - `expect.txt`: `wdk`, from `Windows.Wdk` in `ProcessCpuSampler.cs`. ### Screenshots From a local card harness (not in the repo) that renders the real templates with live data through `IncrementalAdaptiveCardUpdater`, with the polyfills registered, `main`'s host config, and the real `CardOverrideStyles` from `ContentFormControl.xaml`, 776 px wide. #51205's host config isn't part of this stack, so padding and spacing are `main`'s. `main`'s card is from layer 4's head (`18b155752f`), which has `main`'s Performance Monitor. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed This layer has two commits. In the first (`638be0f132`), the 8 files this layer takes whole are identical to their versions at #51125's head (`8858a9e0a7`): `CPUStats.cs`, `ProcessCpuSampler.cs`, `DataType.cs`, `DataManager.cs`, `PerformanceChartData.cs`, `SystemCPUUsageTemplate.json`, `DataManagerTests.cs`, and `ProcessCpuSamplerTests.cs`. The second (`b04d5272bd`) reads the base speed the way Task Manager does, which #51125 doesn't: it changes `CPUStats.cs`, adds four `NativeMethods.txt` entries, and adds `CPUStatsTests.cs`. Otherwise, the files differ from #51125's head only where later layers change them: - `PerformanceWidgetsPage.cs`: the other cards, the overview, and `WidgetPage.GetDataSnapshot`. - `ChartHelper.cs`: the two-argument `AddNextChartValue` and the SVG chart code, until layer 9. - `Resources.resw` and `NativeMethods.txt`: the other cards' strings and native methods. - `CardFormattingTests.cs` and `PerformanceChartDataTests.cs`: the other cards' tests. - `expect.txt`: the other cards' words, and words that `main` added after #51125 branched. ARM64 Debug builds, run from a `subst` drive (common build options: `-nologo -m -restore -t:Build -v:minimal -p:Configuration=Debug -p:Platform=ARM64 -p:RuntimeIdentifier=win-arm64 -p:CIBuild=false -p:GeneratePackageLocally=false -p:GenerateAppxPackageOnBuild=false -p:PublishAppxPackage=false -p:SkipLongPathsCheck=true`): - `MSBuild.exe src\modules\cmdpal\Tests\Microsoft.CmdPal.Ext.PerformanceMonitor.UnitTests\Microsoft.CmdPal.Ext.PerformanceMonitor.UnitTests.csproj <options>`: exit code 0, no warnings from the extension or its tests. It builds the extension, which runs the trim and AOT analyzers. - `vstest.console.arm64.exe ARM64\Debug\WinUI3Apps\CmdPal\tests\Microsoft.CmdPal.Ext.PerformanceMonitor.UnitTests.dll /Platform:ARM64`: 131 passed, 0 failed. That's 98 existing tests, and 33 new ones in `CardFormattingTests`, `CPUStatsTests`, `DataManagerTests`, `PerformanceChartDataTests`, and `ProcessCpuSamplerTests`. - `MSBuild.exe src\modules\cmdpal\Microsoft.CmdPal.UI\Microsoft.CmdPal.UI.csproj <options>`, with `-m:4`: exit code 0. - A local approximation of check-spelling over this diff (the repo's workflow is disabled): no unknown words or forbidden patterns. - `CallNtPowerInformation(ProcessorInformation)` on the machine in the screenshots, called directly: 20 logical processors, 10 rated 2808 MHz and 10 rated 4004 MHz. The card now shows 4.00 GHz, as Task Manager does. Card harness under JIT at `b04d5272bd`, dark and light, for 12 seconds; it counts the updates that replaced the whole card: - The CPU card: no parse warnings or missing strings, and it renders as shown. Base speed was 4.00 GHz on all 18 updates in the run, while the current speed, after its first read, ranged from 2.64 to 3.22 GHz. With the first commit alone, base speed moved between 2.72 and 3.25 GHz. The card was captured after 14–15 updates, and 1 replaced it, when the top processes and the per-processor chart first appeared; the rest patched in place. - The Memory, Disk, Network, GPU, and Battery cards, on `main`'s templates: no parse warnings or missing strings, they render, and 0 updates replaced a card. Not run: a native AOT publish of the harness. The extension's trim and AOT analyzers pass.github.com-microsoft-PowerToys · 7448de2e · 2026-11-10
- 1.0ETVCmdPal: Render Adaptive Cards ProgressBar, Badge, Icon, and rounded tiles (#51209) <!-- 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 **Layer 3 of 13 in a stack that splits #51125** (native Adaptive Cards charts and redesigned Performance Monitor cards) into reviewable PRs. See #51125 for the full picture. This layer is based on layer 2 (`crutkas-stack-2-polyfills-chart-line`, the polyfills library with `Chart.Line`), so the diff shows only this layer. The WinUI 3 Adaptive Cards renderer drops elements it doesn't know, even with a `fallback`, and ignores container properties it doesn't know. This layer adds four more schema features to the polyfills library. Every redesigned Performance Monitor card in the later layers uses at least one of them. - **`ProgressBar`**, drawn with the native WinUI progress bar, so value changes animate and screen readers read the value. Without a `value`, it's indeterminate. - **`Badge`**, with the schema's `style`, `appearance`, `shape`, `size`, `icon`, `iconPosition`, and `tooltip`. - **`Icon`**, which maps Fluent System Icons names (the catalog Adaptive Cards uses) to Segoe Fluent Icons glyphs, the font Command Palette already uses. A name without a matching glyph draws the element's `fallback`. - **`roundedCorners` and `showBorder`** on containers, column sets, and columns. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [ ] Closes: N/A. There's no issue; this is layer 3 of 13 splitting #51125 <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) --> - [ ] **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 (no new strings) - [x] **Dev docs:** Added/updated (the library's `README.md`) - [ ] **New binaries:** Added on the required places (N/A, no new binaries) - [ ] [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 ### Elements Each element follows layer 2's pattern: a model that parses the element JSON leniently (invalid values read as missing and add a warning), and an `AdaptiveVisualControl` that draws it. All three are in `AdaptiveCardPolyfills`' element list, so they're registered as parsers, renderers, and `PatchableElements`, and data changes update them in place. - **`ProgressBarModel`, `ProgressBarControl`:** `max` defaults to 100; a `max` of zero or less warns and uses 100. The value is clamped to `0..max`. `color` takes the schema's accent (the default), good, warning, and attention. - **`BadgeModel`, `BadgeControl`:** the schema's defaults are filled, circular, and medium. A badge is neutral unless `style` names a semantic color. Filled badges use the color as the background, with contrasting text; tint badges use a translucent background, a border, and colored text. An icon-only badge is named by its `tooltip` for screen readers. An `icon` without a glyph is left out, with a warning. - **`IconModel`, `IconControl`, `FluentIconGlyphs`:** 130 names, each mapped to the Segoe Fluent Icons glyph that draws the same symbol, with the filled glyph where one exists. Sizes follow the Fluent icon sizes, from 12 to 48 px. Colors resolve like the host config's text colors; in high contrast, they use the contrast theme's colors. The schema gives icons no text alternative, so they're hidden from screen readers. - **Icons without a glyph:** `IconModel.HasGlyph` is the element type's `RendersItself` check, so the incremental updater knows that such an icon draws its fallback (layer 1's `IncrementalPatchableElements.Add(type, rendersItself)`), and layer 2's `AdaptiveFallbackRenderer` draws it. ### Rounded and bordered containers `AdaptiveContainerDecoratorRenderer` wraps the `Container`, `ColumnSet`, and `Column` renderers: whichever is registered, or the built-in one. After the inner renderer draws the element, it reads `roundedCorners` and `showBorder` from the element's additional properties, and applies a style to the element's background `Border`, including when a `selectAction` wraps it in a button. The styles are in `CardOverrideStyles` in `ContentFormControl.xaml`, so the host owns the look: - `CmdPal.Adaptive.Container.Rounded`: `OverlayCornerRadius`. - `CmdPal.Adaptive.Container.Bordered`: a 1 px `CardStrokeColorDefaultBrush` border, with 8 px padding. - `CmdPal.Adaptive.Container.RoundedBordered`: both. `AdaptiveCardPolyfills.RegisterRenderers` registers the decorator after the elements, so `ContentFormControl.xaml.cs` doesn't change. Elements without either property render as before. Under native AOT, the casts to `Border` and `Style` need their metadata, so `Render` keeps it with `DynamicDependency`, as layer 1 does for element tags. ### Docs The library's `README.md` now lists these elements, the container styles that the host provides, and the decorator. A new Icons section covers how names map to glyphs, the fallback, and how to add a name; it replaces layer 2's paragraph about elements that draw their fallback, since `Icon` is the first one. The upstream table adds both features: the object models for `ProgressBar`, `Badge`, and `Icon`, and the `roundedCorners` and `showBorder` parsing, already exist in the shared C++ model in [microsoft/AdaptiveCards-Mobile](https://github.com/microsoft/AdaptiveCards-Mobile). ### Screenshots From a local card harness (not in the repo) that renders cards through `IncrementalAdaptiveCardUpdater` with the polyfills registered, `main`'s host config, and the real `CardOverrideStyles` from `ContentFormControl.xaml`, 776 px wide. Progress bars, badges, icons, and rounded and bordered containers. `Bot` has no glyph, so that icon draws its `[Bot]` fallback. | Dark | Light | |---|---| |  |  | In light, `main`'s host config makes the emphasis background (`#80F6F6F6`) nearly invisible, so the rounded emphasis container and column are faint. The host config PR, #51205, changes container colors. Icon fallbacks, updated every second: | Dark | Light | |---|---| |  |  | <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed The 10 new files and `ContentFormControl.xaml` are identical to their versions at #51125's head (`8858a9e0a7`). `AdaptiveCardPolyfills.cs` and `README.md` differ from it only by what later layers add: the bar, gauge, donut, and pie charts, the author docs and samples, and the host config. ARM64 Debug builds, run from a `subst` drive (common build options: `-nologo -m -restore -t:Build -v:minimal -p:Configuration=Debug -p:Platform=ARM64 -p:RuntimeIdentifier=win-arm64 -p:CIBuild=false -p:GeneratePackageLocally=false -p:GenerateAppxPackageOnBuild=false -p:PublishAppxPackage=false -p:SkipLongPathsCheck=true`): - `MSBuild.exe src\modules\cmdpal\Tests\Microsoft.CmdPal.AdaptiveCards.Polyfills.UnitTests\Microsoft.CmdPal.AdaptiveCards.Polyfills.UnitTests.csproj <options>`: exit code 0, no warnings. It builds the library, which runs the trim and AOT analyzers. - `vstest.console.arm64.exe ARM64\Debug\WinUI3Apps\CmdPal\tests\Microsoft.CmdPal.AdaptiveCards.Polyfills.UnitTests.dll /Platform:ARM64`: 102 passed, 0 failed. That's 81 from layer 2 and 21 new ones in `IconModelTests` and `ProgressAndBadgeModelTests`. - `MSBuild.exe src\modules\cmdpal\Microsoft.CmdPal.UI\Microsoft.CmdPal.UI.csproj <options>`: exit code 0. The only warnings come from this machine's environment in native dependencies (CS1668 for a missing NETFXSDK ARM64 `LIB` path, and LNK4075). - `MSBuild.exe src\modules\cmdpal\Tests\Microsoft.CmdPal.UI.UnitTests\Microsoft.CmdPal.UI.UnitTests.csproj <options>`: exit code 0. - `vstest.console.arm64.exe ARM64\Debug\WinUI3Apps\CmdPal\tests\Microsoft.CmdPal.UI.UnitTests.dll /Platform:ARM64`: 715 passed, 0 failed. Card harness under JIT, dark and light, with live data for 8 seconds; it counts the updates that replaced the whole card: - A live card whose progress bar value, badge text, and text inside a rounded, bordered container change every second: 10–11 updates, 0 replaced the card. They patch in place, and the container keeps its style. - The icon fallback card above: 11 updates, 0 replaced the card. Text inside a `Container` fallback updates in place. - `main`'s Performance Monitor CPU card, which uses containers, column sets, and columns without the new properties: renders as before, with 13–14 updates and 0 replacing the card.github.com-microsoft-PowerToys · ccd0473a · 2026-11-09
- 1.0ETVfix(FileLocksmith): stop abandoned handle-scan workers from using freed memory (#51507) File lock smith crashes. https://github.com/microsoft/PowerToys/issues/45158 We fixed one aspect of it in an earlier PR as we had the dmp from that but could never repro it internally. Xeno provided an updated dmp and validated this fix solves the issue. <!-- 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 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: #45158 <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) --> - [ ] **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 - [ ] **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 <details> <summary>AI-generated summary</summary> **Root cause (confirmed from XenoPanther's 0.102.2933 dump):** `NtdllExtensions::handles()` ran its loop on a detached `std::thread` lambda capturing locals by reference. The stall watchdog called `TerminateThread(offload_function.native_handle())` *after* `detach()`, which leaves the handle null, so "hung" workers were never terminated. They kept running after `handles()` returned and used its destroyed stack (`object_info_buffer`, `result`, `pid_to_handle`, `info_ptr`, `this`). In the dump, the crashing thread is a `thread_start` worker right after `NtQueryObject`, reading `object_info_buffer` from the caller thread's stack, while the caller has already moved on to `processes()` → `process_modules`. This matches every reported fault offset (memcpy from a freed source, indexed load from freed handle info) and the CLI crashing after it has printed its results. **Fix:** The scan runs on the calling thread again. Only the calls that can block (`GetFileType`, `NtQueryObject(ObjectNameInformation)`) go to a helper thread created with `CreateThread`. That helper uses no CRT and touches only a ref-counted `HeapAlloc` block. When a query stalls, an interlocked Busy/Done/Abandoned handshake hands handle ownership to the helper. The helper then closes the handle, frees the block, and exits by itself, so it stays safe even if it wakes during process shutdown. An earlier `shared_ptr` version fixed the AV but deadlocked at `exit()` when a stale worker ran STL destructors during CRT teardown. **Validation** - New `NtdllExtensionsTests` in `FileLocksmithCLIUnitTests`: finds a file held by the test process, and survives repeated 1 ms stall timeouts that force abandonment. All 8 tests pass (`vstest.console.exe FileLocksmithCLI.UnitTests.dll /Platform:x64`). - Interleaved A/B, 25 runs each, `FileLocksmithCLI.exe <empty dir>` on an ARM64 machine: installed 0.102.2933 gave 4 AVs (0xC0000005) and 1 hang; this branch gave 0 AVs and 0 hangs. - Built `FileLocksmithLibInterop` x64 Release (exit 0) and sideloaded it into the installed UI; no AVs. </details>github.com-microsoft-PowerToys · cfdb1d7a · 2026-10-26
- 1.0ETVCmdPal: Update custom card elements in place, including in release builds (#51204) <!-- 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 PR is layer 1 of 13 in a stack.** The stack divides #51125 (native Adaptive Cards charts and new Performance Monitor cards) into smaller PRs. Refer to #51125 for the full design. This layer starts from `main`. It changes only `Microsoft.CmdPal.AdaptiveCards.IncrementalRendering` and its tests. This PR corrects two faults in the incremental updater for Adaptive Cards: - **Release builds do not update cards in place.** Under native AOT, the updater cannot read the element tags of the renderer. As a result, each update replaces the full card. - **Custom elements cannot update in place.** With this PR, a host can register custom element types. The controls of these types accept new data directly. Layer 2 (the chart polyfills library) uses this feature. Thus, live charts scroll, and the updater does not replace the card each second. ## Detailed Description of the Pull Request / Additional comments ### The fault in release builds Release builds compile Command Palette with native AOT. `.pipelines/v2/release.yml` sets `/p:EnableCmdPalAOT=true`. This property turns on `PublishAot` for `Microsoft.CmdPal.UI`. CI builds do not use native AOT. Thus, PR validation does not test this path. The updater uses element tags to find the controls that it can patch. A patchable control is a `TextBlock` or `Image` whose `Tag` is an `ElementTagContent` for an `AdaptiveTextBlock` or `AdaptiveImage`. Under native AOT, CsWinRT needs type metadata to identify an object that it receives as `object` or as a base type. No code kept this metadata. As a result, element tags came back as bare `IInspectable` objects. Text runs came back as `Inline`, not as `Run`. The fingerprint then treated all text and images as structure, and each update replaced the full card. The fix adds `[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(...))]` to the methods that read tags and runs. The attribute keeps the metadata for `ElementTagContent`, `AdaptiveTextBlock`, `AdaptiveImage`, and `Run`. I found this fault in #51125 with a native AOT build of a local card harness. The Performance Monitor cards in `main` show the same fault (refer to Validation). ### Patches for custom elements - `IncrementalPatchableElements` (new) is the list of custom element types that the updater can patch. `Add(type, rendersItself)` is for a type whose renderer sometimes shows the `fallback`. - `IIncrementalAdaptiveElementControl` (new) is the interface for the control of the element. The control gives a deterministic `IncrementalState`. First, the updater calls `CanApplyIncrementalState` on all changed controls. Then it calls `ApplyIncrementalState`. - `IncrementalAdaptiveCardUpdater` gets the registration through a new optional constructor parameter. Existing callers, for example `ContentFormControl`, do not change. Without a registration, the behavior does not change, except for the AOT fix. - `AdaptiveCardSemanticFingerprint` does not include the data of a registered element. Thus, a data change patches the control and does not replace the card. A change to a host-owned property (`id`, `isVisible`, `spacing`, `height`, or the actions) still replaces the card. - Fallbacks: A registered element that renders itself never shows its `fallback`. Thus, the updater ignores changes in that fallback, unless the element has `requires`. If an element shows its fallback, the updater cannot patch a fallback root that is a `TextBlock` or `Image`. The updater can patch text in a fallback container. - `README.md` tells how to register and implement a patchable element. The examples use `Chart.Line` and `Icon`, which layers 2 and 3 add. No code in Command Palette registers a patchable element yet. Layer 2 does this. The UI does not change, so this PR has no screenshots.github.com-microsoft-PowerToys · 28acb1b2 · 2026-10-15
- 0.9ETVCmdPal: Render Adaptive Cards bar charts natively (#51210) <!-- 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 **Layer 4 of 13 in a stack that splits #51125** (native Adaptive Cards charts and redesigned Performance Monitor cards) into reviewable PRs. See #51125 for the full picture. This layer is based on layer 3 (#51209, `crutkas-stack-3-progressbar-badge-icon`), so the diff shows only this layer. The WinUI 3 Adaptive Cards renderer drops elements it doesn't know, even with a `fallback`. This layer adds the schema's three bar chart elements to the polyfills library: - **`Chart.VerticalBar`**: one bar per category, on a value axis. The redesigned CPU card (layer 5) uses it for per-core usage. - **`Chart.HorizontalBar`**: one bar per category, in the schema's three display modes. - **`Chart.HorizontalBar.Stacked`**: several parts per bar. The redesigned Memory card (layer 6) uses it for memory composition. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [ ] Closes: N/A. There's no issue; this is layer 4 of 13 splitting #51125 <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) --> - [ ] **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 (one new string, `AdaptiveChart_BarChart`, in Command Palette's `Resources.resw`) - [x] **Dev docs:** Added/updated (the library's `README.md`) - [ ] **New binaries:** Added on the required places (N/A, no new binaries) - [ ] [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 ### Elements Each element follows layer 2's pattern: a model that parses the element JSON leniently (invalid values read as missing and add a warning), and an `AdaptiveVisualControl` that draws it with shapes and text. All three are in `AdaptiveCardPolyfills`' element list, so they're registered as parsers, renderers, and `PatchableElements`, and data changes update them in place. - **`BarChartModel`, `BarChartControl`** (`Chart.VerticalBar` and `Chart.HorizontalBar`): read `title`, `showTitle` (off by default), `xAxisTitle`, `yAxisTitle`, `color`, `colorSet`, and `data` items with `x`, `y`, and `color`. Each orientation reads only its own properties: `showBarValues`, `yMin`, and `yMax` for vertical bars, and `displayMode` for horizontal bars. An unknown `displayMode` warns and uses the default, and missing `data` warns. - **Vertical bars** start at zero, on a value axis with grid lines. The plot is 24% as tall as it is wide, from 88 to 180 px. Bars are at most 40 px wide, and category labels are thinned so they stay at least 56 px apart. `showBarValues` draws each value above its bar. The axis shows its minimum only when it isn't zero, as with negative values. - **Horizontal bars** start at zero and draw negative values as zero. `AbsoluteWithAxis`, the default, draws the value axis under the bars. `AbsoluteNoAxis` shows each value at the end of its bar, and `PartToWhole` shows each bar's share of the total. Labels take at most 40% of the width; a trimmed label shows its full text in a tooltip. - **Colors:** a bar uses its item's `color`, then the chart's `color`. Without either, every bar has the first categorical color, or with a `colorSet`, bars take the set's colors in turn. - **`StackedBarChartModel`, `StackedBarChartControl`, `StackedBarGroup`** (`Chart.HorizontalBar.Stacked`): `data` is a list of bars, each with a `title` and `data` items with `legend`, `value`, and `color`. Each legend keeps its color in every bar. Shorter bars are filled with a track up to the longest bar's total, so bars with different totals stay comparable. The legend is on by default (`showLegend`). In high contrast, every third and fourth part draws as an outline, because two of the four contrast colors can be alike (layer 2's `ChartPalette.IsHighContrastOutline`). The parts are star-sized grid columns, so a width change doesn't rebuild the chart. - **Accessibility:** each chart is named by its title, or "Bar chart" (`AdaptiveChart_BarChart`) when it has none. Its help text lists every bar's label and value, and each bar or part has a tooltip with its label and value. ### Docs The library's `README.md` lists the three elements. The theming section now says that in high contrast, every third and fourth part is an outline; stacked bars are the first element that does. The upstream table's chart row now covers all of the chart elements. `AdaptiveCardPolyfills`' doc comment says "the chart" elements instead of `Chart.Line`, as in #51125. ### Screenshots From a local card harness (not in the repo) that renders cards through `IncrementalAdaptiveCardUpdater` with the polyfills registered, `main`'s host config, and the real `CardOverrideStyles` from `ContentFormControl.xaml`, 776 px wide. The card shows vertical bars with bar values and one per-bar color, with a color set, and with a negative value; horizontal bars in each display mode, including a trimmed label; and stacked bars with different totals. | Dark | Light | |---|---| |  |  | The same card with the Aquatic contrast theme simulated. Bars take the contrast theme's colors instead of the palette's, and the stacked bars' third and fourth parts (Documents and Other) are outlines, in the bars and in the legend:  <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed The 7 new files are identical to their versions at #51125's head (`8858a9e0a7`). The other files differ from it only where later layers or `main` change them: - `AdaptiveCardPolyfills.cs`: the gauge, donut, and pie charts. - `README.md`: those charts, the author docs and samples, the host config, and #51125's wording of the control paragraph. - `Resources.resw`: the gauge, donut, and pie chart names, and a string that `main` added after #51125 branched. ARM64 Debug builds, run from a `subst` drive (common build options: `-nologo -m -restore -t:Build -v:minimal -p:Configuration=Debug -p:Platform=ARM64 -p:RuntimeIdentifier=win-arm64 -p:CIBuild=false -p:GeneratePackageLocally=false -p:GenerateAppxPackageOnBuild=false -p:PublishAppxPackage=false -p:SkipLongPathsCheck=true`): - `MSBuild.exe src\modules\cmdpal\Tests\Microsoft.CmdPal.AdaptiveCards.Polyfills.UnitTests\Microsoft.CmdPal.AdaptiveCards.Polyfills.UnitTests.csproj <options>`: exit code 0, no warnings. It builds the library, which runs the trim and AOT analyzers. - `vstest.console.arm64.exe ARM64\Debug\WinUI3Apps\CmdPal\tests\Microsoft.CmdPal.AdaptiveCards.Polyfills.UnitTests.dll /Platform:ARM64`: 113 passed, 0 failed. That's 102 from layers 2 and 3, and 11 new ones in `BarChartModelTests` and `StackedBarChartModelTests`. - `MSBuild.exe src\modules\cmdpal\Microsoft.CmdPal.UI\Microsoft.CmdPal.UI.csproj <options>`, with `-m:4`: exit code 0. - `MSBuild.exe src\modules\cmdpal\Tests\Microsoft.CmdPal.UI.UnitTests\Microsoft.CmdPal.UI.UnitTests.csproj <options>`, with `-m:4`: exit code 0. - `vstest.console.arm64.exe ARM64\Debug\WinUI3Apps\CmdPal\tests\Microsoft.CmdPal.UI.UnitTests.dll /Platform:ARM64`: 715 passed, 0 failed. - A local approximation of check-spelling over this diff (the repo's workflow is disabled): no unknown words or forbidden patterns. Card harness under JIT, dark and light, for 8 seconds; it counts the updates that replaced the whole card: - The card above: no parse warnings, and it renders as shown. - A live card with a vertical, a horizontal, and a stacked bar chart whose values change every second: 10–11 updates, and 0 replaced the card. All three charts patch in place. - The Aquatic contrast theme, simulated: the screenshot above. Not run: a native AOT publish of the harness. The library's trim and AOT analyzers pass.github.com-microsoft-PowerToys · 8505dec5 · 2026-11-10
- 0.9ETVCmdPal: Render Adaptive Cards gauge, donut, and pie charts natively (#51219) <!-- 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 **Layer 10 of 13 in a stack that splits #51125** (native Adaptive Cards charts and redesigned Performance Monitor cards) into reviewable PRs. See #51125 for the full picture. This layer is based on layer 9 (#51218, `crutkas-stack-9-network-card`), so the diff shows only this layer. The WinUI 3 Adaptive Cards renderer drops elements it doesn't know, even with a `fallback`. This layer adds the schema's last three chart elements to the polyfills library: - **`Chart.Gauge`**: a value on a half circle, optionally split into colored segments. The redesigned Battery card (layer 11) uses it for the charge level. - **`Chart.Donut`** and **`Chart.Pie`**: parts of a whole, with a legend that gives each part's share. The Charts and visuals sample page (layer 13) shows both. With this layer, the polyfills library and its tests match #51125, except for three README changes described below. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [ ] Closes: N/A. There's no issue; this is layer 10 of 13 splitting #51125 <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) --> - [ ] **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 (three new strings, `AdaptiveChart_Gauge`, `AdaptiveChart_DonutChart`, and `AdaptiveChart_PieChart`, in Command Palette's `Resources.resw`) - [x] **Dev docs:** Added/updated (the library's `README.md`) - [ ] **New binaries:** Added on the required places (N/A, no new binaries) - [ ] [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 ### Elements Each element follows layer 2's pattern: a model that parses the element JSON leniently (invalid values read as missing and add a warning), and an `AdaptiveVisualControl` that draws it with shapes and text. All three are in `AdaptiveCardPolyfills`' element list, so they're registered as parsers, renderers, and `PatchableElements`, and data changes update them in place. - **`GaugeChartModel`, `GaugeChartControl`** (`Chart.Gauge`): read `title`, `showTitle` (off by default), `subLabel`, `value`, `min`, `max`, `valueFormat`, `colorSet`, `showLegend`, `showMinMax`, and `showNeedle` (these three are on by default), and `segments` items with `legend`, `size`, and `color`. - **Range:** `min` defaults to 0. `max` defaults to `min` plus the segments' total size, or to 100 without segments. A `max` that isn't greater than `min` warns and uses `min` + 100. Values outside the range draw at its ends. - **Drawing:** the value fills the track in the color of the segment it falls in, and the segments form a thin scale inside the track. Without segments, the fill is the accent color, or the color set's first color. The needle marks the value. Inside the arc are the sub label and the value, either as a percentage of the range (`percentage`, the default) or as `value/max` (`fraction`). `showMinMax` labels the ends of the arc, and the legend lists the segments. The arc follows the element's width, from 96 to 220 px. - **Colors:** a segment uses its `color`, or the color set's colors in turn. - **High contrast:** the segments fill the track at full width, solid or (every third and fourth) outlined, and the needle marks the value. The needle has a halo in the window color, because a segment can be the same color as the needle. - **`DonutChartModel`, `DonutChartControl`** (`Chart.Donut` and `Chart.Pie`): read `title`, `showTitle` (off by default), `colorSet`, `showLegend` (on by default), and `data` items with `legend`, `value`, and `color`. Missing `data` warns. A donut's `value` is a label in its center, such as `"512 GB"`; a pie has no center label. - **Drawing:** each slice is its share of the total, and negative values count as zero. The chart is 88 to 160 px across. The legend lists each slice's label and share. It sits beside the chart when the element is at least 300 px wide, and below it otherwise. - **Colors:** a slice uses its item's `color`, or the color set's colors in turn (categorical by default). - **High contrast:** slices take the contrast theme's colors in turn, and every third and fourth slice is an outline. Filled pie wedges get window-colored edges to keep them apart. - **Accessibility:** each chart is named by its title, or for a gauge without one, by its sub label. Charts with neither get "Gauge", "Donut chart", or "Pie chart". A gauge's help text is its value; a donut's or pie's lists each slice's label and share. ### Docs The library's `README.md` lists the three elements, and its example of rendering choices made in the control now includes the gauge. Three README changes from #51125 are left out on purpose: - The pointer to the extension author docs and the Samples page, and step 5 of "Add an element" ("Document the element for extension authors"). Layer 13 adds those docs, so it adds these lines. - "Command Palette builds it to match Fluent". That describes the host config PR (#51205), which isn't in this stack; this branch still has `main`'s `AdaptiveCardsConfig`. - #51125's wording of the control paragraph, which calls every control an `AdaptiveVisualControl`. `LineChartControl` derives from `UserControl`, so layer 2's wording stays. ### Screenshots From a local card harness (not in the repo) that renders cards through `IncrementalAdaptiveCardUpdater` with the polyfills registered, `main`'s host config, and the real `CardOverrideStyles` from `ContentFormControl.xaml`, 776 px wide. **Gauges:** battery-style gauges at 12%, 35%, and 100%, with segments and no legend or min and max labels; a gauge without segments or a needle; a titled gauge with the schema's defaults (a legend and min and max labels); and an untitled `fraction` gauge with the diverging color set. | Dark | Light | |---|---| |  |  | **Donut and pie charts:** a donut with a center label and a `neutral` slice; a pie with the categorical color set; an untitled donut with a color for each slice; and an untitled pie with the sequential color set and no legend. | Dark | Light | |---|---| |  |  | The same cards with the Aquatic contrast theme simulated. Charts take the contrast theme's colors, every third and fourth segment or slice is an outline, and gauges with segments draw them at full width while the needle marks the value: | Gauges | Donut and pie charts | |---|---| |  |  | <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed The 6 new files and `AdaptiveCardPolyfills.cs` are identical to their versions at #51125's head (`8858a9e0a7`). The polyfills library and its tests now match #51125, except for `README.md` (the three changes above). `Resources.resw` differs from #51125 only by a string that `main` added after #51125 branched. ARM64 Debug builds, run from a `subst` drive, at this PR's head (common build options: `-nologo -m -restore -t:Build -v:minimal -p:Configuration=Debug -p:Platform=ARM64 -p:RuntimeIdentifier=win-arm64 -p:CIBuild=false -p:GeneratePackageLocally=false -p:GenerateAppxPackageOnBuild=false -p:PublishAppxPackage=false -p:SkipLongPathsCheck=true`): - `MSBuild.exe src\modules\cmdpal\Tests\Microsoft.CmdPal.AdaptiveCards.Polyfills.UnitTests\Microsoft.CmdPal.AdaptiveCards.Polyfills.UnitTests.csproj <options>`, with `-t:Rebuild`: exit code 0, no warnings. It builds the library, which runs the trim and AOT analyzers. - `vstest.console.arm64.exe ARM64\Debug\WinUI3Apps\CmdPal\tests\Microsoft.CmdPal.AdaptiveCards.Polyfills.UnitTests.dll /Platform:ARM64`: 128 passed, 0 failed. That's 113 from layers 2 to 4, plus 15 new ones in `DonutChartModelTests` and `GaugeChartModelTests`. - `MSBuild.exe src\modules\cmdpal\Microsoft.CmdPal.UI\Microsoft.CmdPal.UI.csproj <options>`, with `-m:4`: exit code 0. - `MSBuild.exe src\modules\cmdpal\Tests\Microsoft.CmdPal.UI.UnitTests\Microsoft.CmdPal.UI.UnitTests.csproj <options>`, with `-m:4`: exit code 0. - `vstest.console.arm64.exe ARM64\Debug\WinUI3Apps\CmdPal\tests\Microsoft.CmdPal.UI.UnitTests.dll /Platform:ARM64`: 715 passed, 0 failed. - A local approximation of check-spelling over this diff (the repo's workflow is disabled): no unknown words or forbidden patterns. Card harness under JIT, dark and light, for 8 seconds; it counts the updates that replaced the whole card: - The two cards above: no parse warnings, and they render as shown. The untitled charts' accessible names are "Gauge", "Donut chart", and "Pie chart", read from `Resources.resw`. - A live card with a gauge, a donut, and a pie whose values change every second: 11 updates, and none replaced the card. Each chart kept the same control instance, so all three patch in place. - The Aquatic contrast theme, simulated: the screenshots above. Not run: a native AOT publish of the harness. The library's trim and AOT analyzers pass, and this branch has the same type-preservation attributes as #51125.github.com-microsoft-PowerToys · 0c29f995 · 2026-11-19