Yu Leng
90d · built 2026-11-06
Performance
What Yu Leng shipped in the selected window, measured in ETV, and how it compares with the 90 days before it.
Effective capacity
+5.5engineers
delivers like 6.5 (6.5x pre-AI)
Output (ETV)
33.6ETV
+35.2% vs 24.9 prior
Features share
26.6%
−11.5 pp vs prior window
Fixes share
12.3%
+7.2 pp vs prior window
Work mix
26.6% Features12.7% Maintenance46.3% Tests2.1% Docs12.3% Fixes
24 commits over 90 days, ending 2026-11-06.
Where this dev ranks
Percentile against the global top-100 leaderboard (all-time totals).
- By commits
- Top 98 %
- By Features share
- Top 61 %
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.
- 9.9ETV[Light Switch] Add CLI for status and theme control (#50459) ## Summary of the Pull Request Adds `PowerToys.LightSwitch.CLI.exe` for querying and controlling the running Light Switch service. Scripts can read status, set or toggle the configured theme targets, and enable or disable the existing schedule, with JSON output and documented exit codes. Closes #49904. ## PR Checklist - [x] Closes: #49904 - [x] **Communication:** Discussed with core contributors. - [x] **Tests:** Added/updated; 140 native, 221 managed CLI, and 49 Light Switch settings tests pass locally. - [x] **Localization:** User-facing text uses localized resources with English fallback. JSON fields, protocol values, and exit codes remain invariant. - [x] **Dev docs:** Added/updated. - [x] **New binaries:** Added to the solution, signing list, CLI shim manifest, and installer shim components. - [ ] **Documentation updated:** External PowerToys documentation PR. ## Detailed Description of the Pull Request / Additional comments - `src/modules/LightSwitch/LightSwitch.Cli/` adds `status`, `light`, `dark`, `toggle`, `schedule enable [--mode]`, and `schedule disable`. All commands support `--json`; help and version work without the service. Enabling a schedule from `Off` requires an explicit existing mode: `fixed-hours`, `sunset-to-sunrise`, or `follow-night-light`. - `src/modules/LightSwitch/LightSwitchService/CliPipeServer.cpp` and `CliProtocol.cpp` implement bounded, versioned request/response IPC with user/session/logon isolation, server identity checks in the client, timeouts, and shutdown handling. The CLI requires a running service and does not automatically retry mutations after an uncertain result. - `src/modules/LightSwitch/LightSwitchService/LightSwitchStateManager.cpp` exposes serialized theme operations and status snapshots using the existing scheduling rules. `src/modules/LightSwitch/LightSwitchModuleInterface/dllmain.cpp` submits counted toggle requests to the service so theme writes and manual-override updates occur together. Theme access failures and partial changes are reported to callers; verified recovery preserves downstream theme notifications. - Schedule commands update the existing `scheduleMode` setting and complete the worker's settings handling before replying. Duplicate settings notifications preserve manual overrides, and settings loaded before a delayed notification are not mistaken for an external theme change. Overrides account for sleep, clock changes, and unavailable Night Light data. `src/settings-ui/Settings.UI/SettingsXAML/Views/LightSwitchPage.xaml.cs` refreshes after settings-file replacement. Concurrent editors retain the existing whole-file save behavior. - CLI help, text labels, and service diagnostics use localized resources. Available CLI and parser satellite resources are packaged without requiring missing translations. Machine-readable protocol and JSON values remain stable. - `tools/CliShim/CliShimManifest.props`, `installer/PowerToysSetupVNext/CliShims.wxs`, and `.pipelines/ESRPSigning_core.json` register deployment and signing. The CLI and service are included in BugReport diagnostics. Usage, protocol behavior, and exit codes are documented in `doc/devdocs/modules/lightswitch-cli.md`. ## Validation Steps Performed - Latest x64 Debug builds passed for `LightSwitchService.UnitTests`, `LightSwitch.Cli.UnitTests`, and `Settings.UI.UnitTests`, including their Light Switch service, CLI, and Settings UI dependencies. Each build returned exit code 0 with 0 warnings and 0 errors. - 140 native service tests passed via `vstest.console.exe`, covering protocol/identity/framing, shutdown and queue handling, settings persistence, manual overrides, recovery, and schedule boundaries. - 221 managed CLI tests passed via `vstest.console.exe`, covering parsing, output/exit codes, bounded IPC, response validation, and resource-based output. - 49 Light Switch settings tests passed via `vstest.console.exe` with `FullyQualifiedName~LightSwitch`, covering the ViewModel and settings watcher. This was a filtered run, not the complete Settings test suite. - `git diff --check` passed. The cleanup preserves behavior, removes redundant theme-observation and observer-stop calls, and removes unused imports; existing regression tests cover the affected paths. Desktop theme/hotkey acceptance, real translated-satellite acceptance, ARM64/Release verification, and full installer acceptance are not covered by these latest checks. --------- Co-authored-by: Yu Leng (from Dev Box) <yuleng@microsoft.com>github.com-microsoft-PowerToys · 2742ac20 · 2026-10-09
- 6.0ETV[PowerOCR] migrate PowerOCR to WinUI 3 (#49431) ## Summary of the Pull Request Migrates Text Extractor (`PowerOCR`) from WPF to WinUI 3 while preserving its Runner integration, settings contract, activation behavior, telemetry, and UI Automation identifiers. - Replaces the WPF overlay with native WinUI 3 `WindowEx` overlays, one per display, with mixed-DPI and negative-origin coordinate handling. - Extracts OCR, bitmap preparation, text formatting, table analysis, and selection geometry into the UI-independent `PowerOCR.Core` library. - Migrates localization from `.resx` to `.resw`/`x:Uid`, and updates process lifetime, Named Event dispatch, clipboard handling, and deterministic resource cleanup. - Moves managed Text Extractor outputs into `WinUI3Apps` and updates the native launcher, signing manifest, installer resources, and installation verification list. - Adds Core unit tests and updates the existing PowerOCR UI automation/checklist for the WinUI controls. https://github.com/user-attachments/assets/16bbef72-fa5e-4c2b-8bd2-b1871a3e0e4c ## PR Checklist - [x] Closes: #49656 - [x] **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 — Core tests pass, but interactive UI tests and several visual/multi-monitor checks remain environment-blocked as detailed below - [x] **Localization:** All end-user-facing strings can be localized - [x] **Dev docs:** Added/updated - [x] **New binaries:** Added on the required places - [x] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for `PowerToys.PowerOCR.Core.dll` and the WinUI3Apps paths - [x] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) — handled by the existing WinUI3Apps component generator; removed the obsolete PowerOCR satellite-resource component from `installer/PowerToysSetupVNext/Resources.wxs` - [x] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) — N/A; the new test project is included in `PowerToys.slnx` and uses existing test discovery - [x] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) — N/A; no per-module pipeline entry is required - [ ] **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 — N/A; no end-user behavior change ## Detailed Description of the Pull Request / Additional comments ### Core and project structure - Adds `src/modules/PowerOCR/PowerOCR.Core/` and `PowerOCR.Core.UnitTests/`. - Removes production `UseWPF`, `System.Windows`, WPF imaging types, MEF construction, and the WPF-only `Common.UI` dependency. - Converts `src/modules/PowerOCR/PowerOCR/PowerOCR.csproj` to an unpackaged, self-contained WinUI 3 application with XAML under `PowerOCRXAML/`. ### Overlay and OCR flow - Captures every display before showing overlays, then creates one borderless topmost overlay per `DisplayArea`. - Uses cached physical-pixel screenshots for clicked-word, region, single-line, and table OCR modes. - Converts WinUI DIP pointer coordinates through each window's rasterization scale and supports displays with negative virtual-desktop origins. - Replaces the WPF `CombinedGeometry` selection clip with four mask rectangles plus a selection `Border`. - Synchronizes language and formatting state across all overlay windows and preserves Escape, S, T, and D1-D9 keyboard behavior. ### Lifetime and compatibility - Preserves the existing process name, mutex, Runner PID argument, GPO behavior, Named Events, standalone keyboard hook, settings JSON, telemetry events, and existing AutomationIds. - Adds cancellation-aware Named Event handling and deterministic disposal for windows, screenshots, WinRT image sources, OCR crops, pointer capture, and cursor clipping. - Keeps `PowerOCRModuleInterface.dll` in the install root and launches `WinUI3Apps\PowerToys.PowerOCR.exe`. ## Validation Steps Performed - Built `PowerOCR.Core.UnitTests` for x64 Debug and ran all tests with `vstest.console.exe`: **23/23 passed**. - Built `PowerOCR-UITests` for x64 Debug successfully. - Built `PowerOCR` for x64 Release and ARM64 Release successfully. - Built `PowerOCRModuleInterface` for x64 Release and ARM64 Release successfully. - Ran XAML Styler against the branch: 3 PowerOCR XAML files processed with no changes. - Confirmed the required x64/ARM64 outputs, including `PowerToys.PowerOCR.Core.dll` and `PowerToys.PowerOCR.pri`, are generated in the expected locations. - Ran build+sideload checklist validation against the local WinUI 3 bits: **15 PASS, 0 FAIL, 16 BLOCKED**. - Blocked items require an attached interactive desktop, WinAppDriver v1.2.1, multiple displays/mixed DPI, real pointer drag/input, or visual theme inspection. - No product defects were observed in the checks that could be executed. - The legacy UI test runtime remains blocked because WinAppDriver is unavailable and the current RDP input desktop is detached; the tests compile successfully. --------- Co-authored-by: Yu Leng (from Dev Box) <yuleng@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Niels Laute <nielslaute@microsoft.com> Copilot-Session: 64307790-5118-4071-9308-5e9ee9836310 Copilot-Session: e5ba1f54-e354-456c-bd2a-c716a143eb97github.com-microsoft-PowerToys · ca6e72c9 · 2026-09-10
- 5.1ETV[ColorPicker] Migrate from WPF to WinUI 3 (#49174) ## Summary of the Pull Request Migrates the **ColorPicker** module from WPF to WinUI 3 (Windows App SDK). The whole module — the picking overlay, the color editor, settings, the zoom magnifier, telemetry, and the Win32 input hooks — is ported off `System.Windows` onto `Microsoft.UI.Xaml`, MEF is replaced by `Microsoft.Extensions.DependencyInjection`, and the legacy WPF sources are removed once each piece is ported. > **Draft / WIP:** opened early for visibility and incremental review. The checklist below is intentionally left unchecked until the migration is finalized and fully validated on real hardware/DPI configurations. demo: https://github.com/user-attachments/assets/465f2a21-1760-4bcf-9d33-253fd6b06f64 ## PR Checklist - [x] Closes: #49000 - [ ] **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 ## Detailed Description of the Pull Request / Additional comments High-level areas ported (see the commit history for the step-by-step breakdown): - **App shell & DI** — WinUI 3 entry point / `App` / `MainWindow`, a `Microsoft.Extensions.DependencyInjection` container replacing MEF, with direct WinUI view composition replacing the implicit WPF `DataTemplate` mapping. - **Picking overlay & editor** — a `TransparentWindow`-based overlay (cursor-following tooltip) plus `ColorEditorView` / `ColorPickerControl` / `ColorFormatControl` ported off WPF (`ContextMenu` → `MenuFlyout`, Visual State Manager, native WinUI styles merged into `App.xaml`). - **Zoom magnifier** — a Win2D `CanvasControl` that redraws the captured region with a brightness-adaptive pixel grid + center highlight (replacing the WPF `ShaderEffect`), plus a WinUI Storyboard resize that matches the WPF zoom-step timing and easing. - **Core & helpers** — color math + value converters on `Windows.UI.Color`, `MonitorResolutionHelper` on `Windows.Foundation.Rect`, `ThrottledActionInvoker` on `DispatcherQueueTimer`, the shared `ManagedCommon.ClipboardHelper`, and the Win32 mouse/keyboard hooks off WPF input types. - **Resources** — a `.resw` scaffold + `ResourceLoaderInstance` replacing the old `.resx` designer. - **Build & installer** — `ColorPickerUI` flipped to WinUI 3, launched from `WinUI3Apps\`; installer satellite + signing paths updated; leftover WPF sources removed. **Zoom parity fixes in this branch:** the magnifier is centered on the cursor once when the zoom session starts and stays anchored while the wheel changes levels. The resize now also matches the WPF behavior: 200 ms `SineEase/EaseOut` growth and `QuadraticEase/EaseIn` shrink, animation of the image only (fixed border chrome), and rapid/reversing wheel input handed off from the current rendered size instead of jumping back to the previous level. The 8x host was corrected from 430 to 432 DIP so its border is not clipped. ## Validation Steps Performed - `ColorPickerUI.UnitTests.csproj` and `ColorPicker.UITests.csproj` build clean (x64 Debug, exit code 0, using the configured host NuGet source). - `ColorPickerUI.UnitTests`: 482/482 passed, including the presentation-value resize plan, exact WPF easing selection, 200 ms duration, animated grid threshold, RGB byte-range validation, and export extension handling. - Real UI E2E: Settings enable/disable, activation hotkey, overlay HEX, 1x/4x/8x zoom, a 50 ms 4x → 8x → 4x → 8x reversal, pointer movement, clipboard capture, and editor display all passed. - Runtime frame trace at 150% DPI confirmed continuous handoff during rapid reversal (`214.0 → 213.33 DIP`, then a second handoff from `211.33 DIP` to 8x) with no jump to a nominal level; final frames landed within the 200 ms animation plus display-refresh quantization. - Manual UI validation at 150% DPI passed both activation modes, shortcut rebinding, mouse/keyboard actions, color-name and clipboard formats, history selection/removal/multiselect, format toggle/reorder/customization, adjust-color flows, screen edges, dark theme, corrupt-history recovery, named events, single-instance behavior, and 100-cycle lifecycle stress. - TXT/JSON export, cancel, single/multi-selection, Unicode paths, overwrite/truncation, and unsupported-extension preservation passed using the real Windows App SDK Save As dialog; no unexpected errors were added to the final-run log. - Supporting suites passed: ManagedCommon clipboard 30/30, Settings ColorPicker/navigation 5/5, DSC ColorPicker 6/6, and ColorPicker E2E 1/1 (524/524 automated tests total). - Environment-dependent validation across an elevated runner, multiple physical/mixed-DPI monitors, native ARM64, and installer upgrade/uninstall remains pending (draft). --------- Co-authored-by: Yu Leng <yuleng@microsoft.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Niels Laute <niels.laute@live.nl> Copilot-Session: ed45e5c8-72b0-4fdf-9de3-ae10be595428 Copilot-Session: 364bf5dd-eac3-42bc-901b-59194c8df71a Copilot-Session: f7c58bff-df3f-41ee-b2e2-8af47508cd19 Copilot-Session: 99a6c348-a4d6-4cd3-9909-b2cb92695e90 Copilot-Session: 90411037-22d3-4fbb-bb74-bff7a69467a9 Copilot-Session: 0dcbe1a4-e4fd-4f19-bbdb-19781d2fb693 Copilot-Session: 17f1d101-a06a-452d-ad18-e1d164791dd5 Copilot-Session: b272ded1-04fe-441d-bf0c-a94979844399 Copilot-Session: d5afc36b-3356-46af-b8cb-071b87a64532github.com-microsoft-PowerToys · cd7f82c2 · 2026-09-04
- 3.0ETV[Image Resizer] Fix CLI input validation and diagnostics (#49854) ## Summary of the Pull Request Closes #49852. Image Resizer CLI previously accepted several invalid inputs as successful work: unknown options could be consumed as file arguments, invalid files were silently dropped, unsafe dimensions could reach the resize engine, and equivalent inputs could process the same source concurrently. This change makes `PowerToys.ImageResizerCLI.exe` strict, deterministic, and diagnosable while preserving the existing lenient command-line behavior used by the GUI and context-menu path. ## PR Checklist - [x] Closes: #49852 - [x] **Communication:** Discussed with core contributors - [x] **Tests:** Added/updated - [x] **Localization:** End-user-facing diagnostics are localizable - [x] **Dev docs:** Built-in CLI help and examples updated; no standalone dev-doc change required - [x] **New binaries:** No new binaries introduced - [x] **Documentation updated:** No external user-documentation change required ## Detailed Description ### Strict CLI parsing without breaking supported syntax - Adds a strict parse path for the public CLI while keeping the GUI/context-menu parser lenient. - Rejects unknown option-like positional tokens before processing. - Preserves `--`, response files, attached values such as `-w100`, legal bundles such as `-rq85`, and explicit attached boolean values such as `-rtrue`. - Preserves valid file, pipe, and destination values for lenient callers when another option fails conversion. ### Deterministic and diagnosable input resolution - Expands wildcards in the final path segment and reports zero-match patterns. - Reports missing, unsupported, invalid, and empty inputs instead of silently filtering them. - Processes valid files in mixed batches, reports every rejected input, and returns a non-zero exit code. - Canonicalizes filesystem paths before deduplication, covering normal, extended (`\\?\`), long, casing, and parent-reparse aliases while preserving distinct hard links, final symbolic links, and files in case-sensitive directories. - Applies the same strict validation and deduplication to public-CLI named-pipe input; the GUI/context-menu pipe remains lenient. - Treats an empty public-CLI pipe as an error. - Reads redirected stdin using the producing shell's output encoding with BOM detection, including non-ASCII paths from default cmd and PowerShell pipelines. ### Validation before file writes - Rejects negative, non-finite, zero/zero, grouped out-of-range, and otherwise unsupported custom dimensions. - Requires a positive effective width for percentage-based Fit and Fill sizes. - Treats an out-of-range preset index as an error instead of continuing with the current preset. - Validates resize-engine dimensions before integer conversion and before destination creation. - Rounds positive fractional Fill targets safely to at least one pixel. - Deduplicates equivalent paths before parallel processing so overlapping explicit/glob/pipe inputs cannot race under `--replace`. ### Diagnostics and compatibility - Includes exception type and HRESULT when a decoder exception has an empty message. - Documents and warns that shrink-only remains ignored for percentage-based sizes, preserving existing behavior. - Preserves the original UTC modified time after `KeepDateModified + Replace` by restoring it on the final replaced file. ## Validation Validation was repeated after merging the latest `main` (`e753ec51fb`) into the PR branch. 1. Restored with the configured host `NuGet.Config` and built `src/modules/imageresizer/ImageResizerCLI/ImageResizerCLI.csproj` in x64 Release using `tools/build/build.ps1`. - Result: exit code 0; errors log empty. 2. Restored and built `src/modules/imageresizer/tests/ImageResizer.UnitTests.csproj` in x64 Release with the same build script and configured package source. - Result: exit code 0; errors log empty. 3. Ran the complete x64 Release Image Resizer unit-test assembly with Visual Studio `vstest.console.exe`. - Result: **205 passed, 0 failed, 0 skipped**. 4. Ran 10 process-level CLI regressions covering: - attached boolean parsing (`-rtrue`); - grouped out-of-range dimensions without source modification; - positive fractional Fill producing a valid `1x100` image; - normal/extended/wildcard path deduplication; - non-ASCII redirected stdin from default PowerShell 7 and cmd pipelines; - empty, invalid, and duplicate named-pipe inputs; - `KeepDateModified + Replace`, including content change and exact UTC timestamp preservation. - Result: **10/10 passed**. 5. Confirmed both build error logs remained empty, all temporary fixtures were removed, and the real Image Resizer settings file retained its original length, timestamp, and SHA-256 hash. The new Image Resizer UI-test project added on `main` was not run locally because it requires the repository's WinAppDriver/local-VM UI-test environment; this PR does not change that UI-test project. --------- Co-authored-by: Yu Leng (from Dev Box) <yuleng@microsoft.com>github.com-microsoft-PowerToys · 75df8d02 · 2026-08-17
- 2.5ETV[PowerDisplay] Add profile reordering (#50453) ## Summary of the Pull Request Allow users to reorder saved Power Display profiles without deleting and recreating them. Add drag-and-drop sorting and Move up/Move down menu actions, and persist the display position in a separate `order` field while retaining stable integer profile IDs. <img width="1599" height="982" alt="image" src="https://github.com/user-attachments/assets/2dc852d4-ef94-49e3-9085-d673cd911da8" /> <img width="1621" height="977" alt="image" src="https://github.com/user-attachments/assets/41f03551-6372-4ba5-aa78-03e32d1f362a" /> ## PR Checklist - [x] Closes: #50425 - [ ] **Communication:** Maintainer review is pending. - [x] **Tests:** Added/updated; 629 relevant tests pass locally. - [x] **Localization:** Added Settings UI strings use resource entries. - [x] **Dev docs:** Updated `doc/devdocs/modules/powerdisplay/design.md`. - [x] **New binaries:** Not applicable; no new projects, binaries, or dependencies. - [ ] **Documentation updated:** Public documentation follow-up is not included. ## Detailed Description of the Pull Request / Additional comments - In `src/settings-ui/Settings.UI/SettingsXAML/Views/PowerDisplayPage.xaml` and `src/settings-ui/Settings.UI/ViewModels/PowerDisplayViewModel.cs`, add a reorderable profile list with drag handles, bounded scrolling, and keyboard-accessible Move up/Move down actions. Elevated Settings retains menu-based sorting with native drag/drop disabled, following Mouse Without Borders. - In `src/modules/powerdisplay/PowerDisplay.Models/`, use a contiguous zero-based `order` field independently of integer `id` and the physical JSON array. Editing preserves the saved position; new profiles use the existing `nextId` counter and append to the display order. - Normalize missing or invalid order values under the existing profile-store mutex. Reordering changes only order values in the latest stored collection, preserves concurrent additions and edits, and refreshes the flyout through the existing settings notification. Failed saves/reloads retain the last known saved order in Settings. - Preserve integer profile IDs, Light Switch references, and CLI/IPC schema version `1.0`. ## Validation Steps Performed - Final Debug x64 builds succeeded for Settings UI and its test project, the Power Display app, and the Power Display Lib, Contracts, IPC, and CLI test projects. - Ran the newly built assemblies through `vstest.console.exe`: Lib **341**, Contracts **15**, IPC **139**, CLI **118**, and relevant Settings ViewModel tests **16**; **629 passed, 0 failed, 0 skipped**. - Coverage includes explicit order independent of array position and integer ID, stable IDs and `nextId`, order initialization, edit/append behavior, failed and concurrent writes, Light Switch references, elevated drag gating, CLI numeric-ID validation, and JSON/IPC round trips. - `git diff --check` and XAML/XML parsing passed. - Interactive UI validation remains pending: normal/elevated drag behavior, long-list scrolling, keyboard focus, and screen-reader behavior. This PR remains a draft. --------- Co-authored-by: Yu Leng (from Dev Box) <yuleng@microsoft.com>github.com-microsoft-PowerToys · 4670e34e · 2026-09-14
- 2.1ETV[Image Resizer] Honor encoding options and preserve metadata (#51359) ## Summary of the Pull Request Image Resizer ignores explicit PNG interlacing and TIFF compression while retaining metadata, resizes only the first TIFF page, and drops JPEG author/title fields. This fixes the shared encoding path used by the UI and CLI, restores the WMPhoto fallback mapping, and rejects undefined numeric CLI unit/fit values before processing files. ## PR Checklist - [ ] **Communication:** Discussed with core contributors. - [x] **Tests:** Added regression coverage for image output and CLI validation. - [x] **Localization:** The new invalid-enum diagnostic uses the Image Resizer resource file. - No new dependencies, binaries, settings schema, or IPC changes. ## Detailed Description of the Pull Request / Additional comments - `src/modules/imageresizer/ui/Models/ResizeOperation.cs` uses a fresh encoder when PNG/TIFF options require it and processes every TIFF page with its own dimensions, metadata, and encoding options. Metadata is written before committing each page. - Copy supported native metadata blocks after pixel data in occurrence order, retain JPEG author/title values and existing EXIF fallbacks, and retain 16-bit sample precision. JPEG quantization tables are excluded so the requested quality still applies. - Preserve PNG color metadata. Convert fresh TIFF pixels to sRGB because the WinRT TIFF encoder discards the source ICC profile even when copying IFD metadata. - `src/modules/imageresizer/ui/Utilities/CodecHelper.cs` maps the existing WMPhoto settings GUID to JPEG XR, rather than silently falling back to PNG. - `src/modules/imageresizer/ui/Cli/Options/UnitOption.cs` and `FitOption.cs` reject undefined enum values such as `99` and `-1`, while preserving valid names, numeric values, and aliases. The GIF animation limitation and the CLI input allowlist for ICO/HEIC are outside this fix. Unknown enum names were already rejected and remain covered as controls. ## Validation Steps Performed - Built the repository prerequisites, `ImageResizer.UnitTests.csproj`, and `ImageResizerCLI.csproj` with the repository build wrappers, x64 Debug: exit 0. Final target builds have no warnings or errors. - Ran `ImageResizer.Test.dll` with Visual Studio VSTest on the matching candidate: **304 passed, 0 failed, 0 skipped**. - Test settings are isolated from the user's running PowerToys configuration. - Native WinRT controls confirmed that repeated PNG metadata chunks must be copied in occurrence order, that PNG ICC data must be copied after pixel data, and that the TIFF encoder discards its ICC profile. Coverage exercises the shared image engine and CLI parser/executor. A new Explorer/Settings UI acceptance run and an installed-package upgrade were not performed. Added runtime-generated fixtures and independent output checks for PNG IHDR/CRC and native text, all six TIFF compression tags and monochrome pixels, distinct multi-page TIFF contents/metadata, 16-bit samples, embedded color profiles, Unicode JPEG metadata and EXIF orientation, JPEG quality, actual JPEG XR output, and CLI rejection without output or source modification. Co-authored-by: Yu Leng (from Dev Box) <yuleng@microsoft.com>github.com-microsoft-PowerToys · 1c11fa09 · 2026-10-16
- 1.0ETVAdd native CLI shims for PowerToys command-line tools (#48631) ## Summary of the Pull Request Adds a native C++ multi-call shim that exposes existing PowerToys CLIs through `PATH`. The shims are installed under the PowerToys `bin` subfolder and follow the `PowerToys.<ModuleName>.CLI.exe` naming convention. The launcher preserves the raw argument tail, shares the caller's console, and returns the target process exit code. | PATH-visible command | Target executable | | --- | --- | | `PowerToys.FancyZones.CLI.exe` | `FancyZonesCLI.exe` | | `PowerToys.ImageResizer.CLI.exe` | `WinUI3Apps/PowerToys.ImageResizerCLI.exe` | | `PowerToys.FileLocksmith.CLI.exe` | `FileLocksmithCLI.exe` | | `PowerToys.PowerDisplay.CLI.exe` | `WinUI3Apps/PowerToys.PowerDisplay.Cli.exe` | proof of this work: <img width="1044" height="294" alt="image" src="https://github.com/user-attachments/assets/b659c552-5c08-4430-85c3-eba48f286eb0" /> <img width="1137" height="244" alt="image" src="https://github.com/user-attachments/assets/5fed493f-dc30-428d-a618-bf612ccf3635" /> <img width="1727" height="868" alt="image" src="https://github.com/user-attachments/assets/5c32fd2e-4a3a-4138-b968-fb5434eebec3" /> ## PR Checklist - [x] Closes: #48634 - [x] **Communication:** Discussed with core contributors in this PR - [x] **Tests:** Added/updated and all pass - [ ] **Localization:** CLI diagnostic messages are not localized - [x] **Dev docs:** Updated CLI naming and installation conventions - [x] **New binaries:** Added on the required places - [x] Signing JSON - [x] WiX installer entries - [x] CI builds through `PowerToys.slnx`; no dedicated YML step is required - [x] The existing release pipeline covers the solution and installer - [x] **Documentation updated:** `doc/devdocs/cli-conventions.md` ## Detailed Description of the Pull Request / Additional comments - Uses one native launcher binary for all commands and resolves the target from the invoked shim filename. - Installs PATH-visible shims under `PowerToys\bin`. - Keeps the existing module CLI binaries and their deployment locations unchanged. - Rejects the previous unsuffixed and `*cli` command aliases. ## Validation Steps Performed - Built `tools/CliShim.UnitTests/CliShim.UnitTests.vcxproj` in `Release|x64`: 0 warnings, 0 errors. - Ran `CliShim.UnitTests.dll` with `vstest.console.exe`: 5/5 tests passed. - Verified the CLI manifest, WiX command names, and `bin` installation directory are synchronized. - Ran `git diff --check`. --------- Co-authored-by: Yu Leng <yuleng@microsoft.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d11c4221-248f-44a9-85fb-7017ed43f4cegithub.com-microsoft-PowerToys · ae416c04 · 2026-08-14
- 1.0ETV[Power Display] Preserve profiles across unavailable monitors and capabilities (#50509) ## Summary of the Pull Request Editing a Power Display profile can drop settings when a saved monitor is missing or a capability is temporarily unavailable. Preserve the original monitor rows, fields, identity, and creation time when renaming, while honoring explicit removals and validating newly selected values. Keep color-preset selection synchronized as capabilities change, including empty selections and restored capabilities. Unavailable included fields remain visible for removal, and the editor releases its monitor subscriptions when closed. Compare capability values and names so same-size updates refresh the editor. This is an independent prerequisite extracted from #50458. It targets `main` and does not introduce VCP restriction settings or depend on the VCP editor. The settings-persistence PR can be reviewed and merged separately. ## PR Checklist - [ ] Closes: no automatic issue closure; related to #50458. - [ ] **Communication:** Draft for maintainer review. - [x] **Tests:** Generic profile regression tests added and validated. - [x] **Localization:** The preservation explanation uses an en-US resource string. - [ ] **Dev docs:** Not added. - [x] **New binaries:** Not applicable; no new binary or test project. - [ ] **Documentation updated:** No separate documentation PR. ## Validation Steps Performed - Checked out commit `5485193016f270f119b0f5df8a4fe9ad7e1f4be8` and built Settings UI and Settings.UI.UnitTests with the repository build script, x64 Debug: exit code 0. - Ran all **33 ProfileEditorViewModelTests** through Visual Studio vstest: 33 passed, none skipped. - Built and ran a native WinUI ComboBox probe using the generated XAML binding: capability-name refresh, empty selection, original-value preservation/restoration, and invalid new selections all passed; process exit code 0. - Verified the compiled assemblies contain the Profile fix but no VCP restriction model or `DisabledVcpValues` property. - `git diff --check` passed. The build retained the existing CsWinRT1028 warning in unchanged `ManagedCommon/HotkeySettingsControlHook.cs`. The tests and control probe use synthetic monitor data; no physical monitor, full dialog layout, or multi-monitor DPI verification is claimed. The persisted JSON shape is unchanged. Co-authored-by: Yu Leng (from Dev Box) <yuleng@microsoft.com>github.com-microsoft-PowerToys · 84b6bf89 · 2026-09-22
- 0.6ETVfix(runner): prevent startup and read-only settings overwrites (#51115) <!-- 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 Fixes #46165 by preventing Settings from capturing partially initialized module states and preventing read-only UI refreshes from submitting cached general settings. This PR is now limited to **startup lifecycle and read-only notifications**. Native atomic persistence and its reader/build/test adaptations were extracted to #51292. Both PRs target main directly and can merge independently, in either order. This branch was validated without the atomic writer or its watcher changes. It retains the checked-read protections and removal of all final exit saves already merged in #50897. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: #46165 <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) --> - [x] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [x] **Tests:** Added/updated and all pass - [x] **Localization:** All end-user-facing strings can be localized - [ ] **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: N/A (no user-documentation changes). No new binaries, dependencies, settings schema, or user-facing strings are introduced. <!-- 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 ### Startup lifecycle - Defer early Settings requests until `start_enabled_powertoys()` completes, so the existing Settings initialization snapshot does not capture modules before they have been enabled. - Prefer the most recent deferred explicit request over the original command-line request, then automatic OOBE/SCOOBE. - Reserve the launch before starting its worker to prevent duplicate Settings processes. - Serialize actual `CreateProcessW` and child-PID publication with cancellation. Shutdown either rejects a reserved launch or observes an in-flight child before the existing close path runs. Configuration preparation and IPC initialization remain outside this critical section. - Acquire the Runner token before spawning Settings, avoiding an untracked child when token acquisition fails. ### Read-only notifications Backup and bug-report status refreshes use `OnPropertyChanged()` instead of submitting the entire cached `GeneralSettingsConfig`. Actual user edits retain their existing save behavior. There is no new readiness IPC protocol, retry timer, or process-exit replay. Navigation while the Settings process itself is starting retains the existing behavior. ### Scope and independence Only 12 files differ from main: six production files in Runner/GeneralViewModel, their tests, and project/IDE registrations. `settings_helpers.cpp`, the native and managed file watchers, shell caches, and the atomic writer are not modified by this PR. It works with main's existing in-place writer; it does not require #51292. The previously discussed atomic compatibility and CommonLib WIL dependency fixes now belong to the extracted persistence PR. Their resolved review history remains here for traceability. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Validation was rerun on x64 Debug after removing the atomic persistence changes from this branch. - Runner test project rebuilt and all **22 Runner tests passed**, including startup/cancellation coverage and main's checked-reader tests. - The actual Runner application built successfully with main's existing non-atomic writer. - Settings app/library/CLI and the test project rebuilt successfully without the replacement-watcher changes. - All **15 General view-model tests passed**, including zero full-general IPC for read-only notifications and normal user-setting updates. - The two PRs have disjoint changed-file sets. Git merge-tree checks in both orders produced the same conflict-free tree, identical to the original combined implementation updated onto main `9501b98a09`. Existing toolchain/package caches were reused. An initial parallel native build encountered a missing spdlog header while vcpkg refreshed that shared package after a toolchain update; the serial rebuild after restoration passed without a product-code workaround. <details> <summary>Exact local validation commands and results</summary> ```powershell # PASS: Runner test project rebuild, exit 0. & 'D:\PowerToys-pr51115\tools\build\build.ps1' -Platform x64 -Configuration Debug -Path 'D:\PowerToys-pr51115\src\runner\UnitTests' -ExtraArgs @('/t:Rebuild','/p:VcpkgInstalledDir=D:\PowerToys\vcpkg_installed\x64\','/p:SolutionDir=D:\PowerToys-pr51115\') # PASS: 22 tests. & 'C:\Program Files\Microsoft Visual Studio\18\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe' 'D:\PowerToys-pr51115\x64\Debug\tests\Runner\Runner.UnitTests.dll' '/Platform:x64' '/Logger:trx;LogFileName=startup-only-runner.trx' '/ResultsDirectory:D:\PowerToys-pr51115\artifacts\TestResults' # PASS: Runner application build, exit 0. & 'D:\PowerToys-pr51115\tools\build\build.ps1' -Platform x64 -Configuration Debug -Path 'D:\PowerToys-pr51115\src\runner' -ExtraArgs @('/restore','/p:VcpkgInstalledDir=D:\PowerToys\vcpkg_installed\x64\','/p:SolutionDir=D:\PowerToys-pr51115\') # PASS: Settings app/library/CLI and test project rebuild, exit 0. & 'D:\PowerToys-pr51115\tools\build\build.ps1' -Platform x64 -Configuration Debug -Path 'D:\PowerToys-pr51115\src\settings-ui\Settings.UI.UnitTests' -ExtraArgs @('/t:Rebuild','/restore','/p:VcpkgInstalledDir=D:\PowerToys\vcpkg_installed\x64\','/p:SolutionDir=D:\PowerToys-pr51115\') # PASS: 15 tests. & 'C:\Program Files\Microsoft Visual Studio\18\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe' 'D:\PowerToys-pr51115\Debug\x64\tests\SettingsTests\net10.0-windows10.0.26100.0\Settings.UI.UnitTests.dll' '/Platform:x64' '/TestCaseFilter:FullyQualifiedName~ViewModelTests.General' '/Logger:trx;LogFileName=startup-only-settings.trx' '/ResultsDirectory:D:\PowerToys-pr51115\artifacts\TestResults' ``` </details> Not claimed: full interactive startup/shutdown validation, actual Windows restart/upgrade, or ARM64 runtime coverage on this narrowed revision. Deterministic lifecycle tests use controlled launch/publication callbacks. Atomic-persistence tests from the former combined PR are not counted as validation of this branch. --------- Co-authored-by: Yu Leng (from Dev Box) <yuleng@microsoft.com> Co-authored-by: Boliang Zhang (from Dev Box) <bozhang@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2440200c-e683-4029-800a-7a05ac55ce2cgithub.com-microsoft-PowerToys · da5def38 · 2026-10-14
- 0.5ETVPowerRename: fix EXIF GPS and XMP creator extraction (#51357) ## Summary of the Pull Request PowerRename replaces valid EXIF GPS coordinates with `0°0.00'N-0°0.00'E`, and leaves XMP `$AUTHOR`/`$CREATOR` tokens unchanged even when the same image's camera and title tokens work. Fix the two metadata reads and add regression coverage using the existing sample image: - WIC returns GPS coordinates as three packed `VT_UI8` rationals. The parser treated every vector as a byte buffer and required 24 **elements**, so the three-element rational vector was rejected and both coordinates became zero. Decode the typed vector and scalar rationals, retaining byte-buffer support and reference directions. - XMP `dc:creator` is an ordered RDF sequence. Reading its container as a scalar string yielded no creator, which prevented both aliases from being populated. Read the indexed string elements, retain their order, and join multiple creators with `; `, following the existing subject-array convention. ## PR Checklist - [ ] **Communication:** Discussed with core contributors. - [x] **Tests:** All 76 native metadata tests pass, including 9 new regression tests. - [x] **Localization:** No new user-facing strings. - [x] **Dev docs:** No documentation change required. - [x] **New binaries:** No new binaries or dependencies. ## Detailed Description of the Pull Request / Additional comments The real-image regression tests cover extraction and filename-token substitution together: | Metadata source and template | Expected result | | --- | --- | | EXIF `$LATITUDE-$LONGITUDE.jpg` | `26°34.95'N-80°12.01'W.jpg` | | EXIF `$CAMERA_MAKE_$CAMERA_MODEL.jpg` | `samsung_SM-G930P.jpg` | | XMP `$AUTHOR-$CREATOR` | `Carl Seibert (XMP)-Carl Seibert (XMP)` | | XMP `$TITLE` | `object name here` | The existing `exif_test.jpg` and `xmp_test.jpg` fixtures match the image used to reproduce both problems. The previous extraction tests asserted camera/title values but omitted GPS coordinates and the XMP creator. Additional tests cover malformed GPS vectors, packed rationals, legacy byte vectors, missing creators, and a generated one-pixel JPEG with ordered Unicode creators and an empty entry. ## Validation Steps Performed - The original UI failures and the camera/title positive controls were reproduced on installed PowerToys 0.102.2814.0. Read-only system WPF/WIC inspection independently confirmed the GPS rational-vector representation and the XMP sequence/indexed-string query results. - Completed the repository essentials build, then built `PowerRenameLib.vcxproj` and `PowerRenameLibUnitTests.vcxproj` in x64 Debug with the repository build wrappers. All final build stages exited 0. - Ran `vstest.console.exe` for `MetadataFormatHelperTests`, `ExtractEXIFMetadataTests`, `ExtractXMPMetadataTests`, and `FactoryLifetimeTests`: **76/76 passed**, including all **9 new regression tests**. This includes actual WIC extraction and the filename-substitution outputs listed above. - The scope excludes unrelated regex/settings tests and HEIF/AVIF tests that require optional codecs. - Interactive preview/Apply validation with the patched PowerRename UI has not been performed. --------- Co-authored-by: Yu Leng (from Dev Box) <yuleng@microsoft.com>github.com-microsoft-PowerToys · 3b8c2a76 · 2026-10-16