Commit Graph

9647 Commits

Author SHA1 Message Date
Niels Laute
34ffe7b35c [Shortcut Guide] Add page-local search (#49639)
## Summary of the Pull Request

Adds an accessible search box to the Shortcut Guide title bar that
filters shortcuts on the currently selected application page.

The query matches shortcut names, descriptions, modifier names, and
displayed key labels while preserving the existing pinned, recommended,
category, and taskbar grouping.

## PR Checklist

- [x] Closes: #48791
- [x] **Communication:** The UX and behavior were discussed before
implementation
- [x] **Tests:** Added/updated and all pass
- [x] **Localization:** All end-user-facing strings can be localized
- [x] **Dev docs:** Added/updated
- [ ] **New binaries:** Not applicable
- [ ] **Documentation updated:** Not applicable

## Detailed Description of the Pull Request / Additional comments

- Adds a localized title-bar `AutoSuggestBox` with a find icon and UI
Automation identity.
- Filters only the selected app page using case-insensitive matching
across names, descriptions, modifiers, virtual-key display names, and
rendered special-key aliases.
- Keeps only sections containing matches and shows a polite live-region
no-results state with correct pane spacing.
- Preserves the query when switching app pages, but clears it when
Shortcut Guide closes.
- Adds `Ctrl+F` to focus search; the first `Escape` clears a query and
the next closes the overlay.
- Keeps query text local to the UI with no logging or telemetry.

Related issues: #48860 requests several broader navigation/readability
changes; #49459 requests direct physical-key interception rather than
text search.

## Screenshots

### Filter Windows shortcuts by displayed key label

<img
src="https://raw.githubusercontent.com/niels9001/PowerToys/pr-assets-shortcut-guide-search/.github/pr-assets/shortcut-guide-search/windows-alt-filter.png"
width="667" alt="Shortcut Guide Windows page filtered by Alt" />

### Keep the query while switching to the PowerToys page

<img
src="https://raw.githubusercontent.com/niels9001/PowerToys/pr-assets-shortcut-guide-search/.github/pr-assets/shortcut-guide-search/powertoys-opa-filter.png"
width="660" alt="Shortcut Guide PowerToys page filtered by opa" />

## Validation Steps Performed

- Built `ShortcutGuide.Ui` for ARM64 Debug with the repository build
scripts.
- Built `ShortcutGuide.UnitTests` for ARM64 Debug and passed all 23
tests (16 search cases plus 7 existing tests) with `vstest.console.exe`.
- Verified via UIA and guarded keyboard input that name/key-label
filtering updates immediately, empty sections disappear, and no matches
show the localized live-region state.
- Verified the query persists when switching Windows to PowerToys,
`Ctrl+F` focuses search, first `Escape` clears, second `Escape` closes,
and reopening starts with an empty query.
- Rebuilt after the final no-results accessibility and 16px top-margin
adjustment.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b8ffa76b-3cf0-4a67-9adb-a13c5dd9f125
Copilot-Session: 4a96c2c2-6954-4784-8257-e0de0fac15a7
Copilot-Session: 1f00def4-e790-4071-96c6-a81c9c2adba5
Copilot-Session: 76e284a6-9a03-4105-bae6-4ed7fc92042d
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
v0.101.2262.0
2026-08-14 15:39:07 +08:00
Niels Laute
633011c58f Add issue triage actions (#49828)
## Summary of the Pull Request

Replaces the retired GitHub Models-based automatic issue triage and
deduplication flows with the GitHub Agentic Workflow proven in the
`niels9001/powertoys-ai-triage-sandbox`.

This PR also:

- aligns `Needs-Author-Feedback` closure to 7 days for issues and PRs;
- removes the automatic GitHub Models issue/PR labeler;
- removes the automatic GitHub Models new-issue deduplicator;
- removes the Azure Pipelines XAML Styler verification step while
retaining the
  local styling script.

This is a draft because production rollout still requires the
appropriate
privacy and Responsible AI reviews.

## Issue triage rules

### Triggers and refresh behavior

- Runs when an issue is opened, edited, or reopened.
- Runs when the issue author attaches a `PowerToysReport_*.zip` in a
comment.
- Maintainers can force regeneration with `/triage refresh`.
- Ignores unrelated comments, unchanged issue edits, PR comments, and
  bot-initiated reopens.
- Uses per-issue concurrency so a newer run supersedes an older run.
- Maintains one canonical triage comment instead of adding repeated bot
  comments.

### Comment format

- Separates **For the issue author** from **For the PowerToys team**.
- Mentions the author once and lists each requested action as a bullet.
- Distinguishes blocking **Needed** actions from non-blocking
**Recommended**
  actions.
- Shows the product, issue kind, reported PowerToys version, concise
summary,
  diagnostic findings, possible duplicates, and collapsed investigation
  checks.
- Ends with a short disclosure that triage is AI-assisted and
maintainers make
  final decisions.

### Classification and labels

- Detects PowerToys bug-template issues deterministically.
- Reads the selected product area and adds a matching primary
`Product-*`
  label.
- Handles production aliases such as FancyZones Editor and File Explorer
  preview/thumbnail areas.
- Product labeling is additive: existing product and maintainer labels
are
  never removed.
- Normalizes the reported PowerToys version and adds a matching version
label
  when one exists.
- Applies `Needs-Author-Feedback` only when blocking information or an
English
  translation is required.
- Removes `Needs-Author-Feedback` when the issue becomes actionable.

### PowerToys version rule

- Compares the reported version with the latest stable PowerToys GitHub
  release.
- Older versions receive a recommended update-and-retest action.
- Current versions, newer preview/dev versions, missing versions, and
release
  lookup failures are not flagged as outdated.
- Updating is advisory and does not block triage by itself.

### Reproduction rule

- Concrete actions plus an observed result are sufficient.
- Concise steps can use the separate Actual Behavior section as the
observed
  result.
- Passive or intermittent failures are sufficient when the
timing/trigger and
  observed failure are clear.
- Vague statements without an actionable scenario remain insufficient.
- Clearly non-English steps are not treated as missing; reproduction is
  reassessed after the author translates the issue.

### Language rule

- Classifies author-written prose as English, non-English, or uncertain.
- Ignores template headings, code, logs, filenames, URLs, hidden
comments, and
  quoted text.
- Clearly non-English issues ask the author to translate the title and
  description to English.
- Short, mixed, code-heavy, or uncertain text is not flagged.

### Diagnostic report rule

- A report is **required** for diagnostic-heavy failures: crashes,
hangs,
startup/load failures, installation/update failures, performance
failures,
  and service/driver/shell-integration failures.
- A report is **optional** for clear reproducible UI/visual defects.
- A report is **recommended**, but not blocking, for other actionable
bugs.
- Missing or rejected reports block only when the deterministic
requirement is
  `REQUIRED`.

### Diagnostic report privacy and safety

- Accepts only PowerToys report attachment URLs matching the expected
pattern.
- Enforces archive size, decompressed size, file-count, per-file, path
  traversal, and encryption limits.
- Selects only bounded relevant metadata and product-log evidence.
- Redacts email addresses, IP addresses, user paths, URLs, GUIDs, SIDs,
  identity fields, tokens, secrets, and passwords.
- Sends only the sanitized evidence to Copilot.
- Never sends the raw ZIP or extracted files to Copilot, logs,
artifacts, or
  repository storage.
- Deletes the temporary archive after processing.

### Duplicate rule

- Searches only older issues using focused product, title/body, and
exact
  technical-signal queries.
- Ranks candidates deterministically before Copilot runs.
- Copilot judges only the supplied candidates and returns at most five
  high-confidence matches.
- Similar product area alone is not enough; the underlying request or
failure
  must match.
- The model never closes an issue directly.
- The workflow submits the strongest match as a native GitHub
duplicate-close
  suggestion.
- **When a maintainer accepts the suggestion, GitHub automatically
closes the
  issue as a duplicate and links it to the selected canonical issue.**
- Declining the suggestion leaves the issue open.
- A defensive safeguard reopens the issue and fails the run if GitHub
applies
  the close without holding it for review.

### AI cost and permission controls

- Uses the `small` model alias.
- Maximum 5 turns and 10 AI credits per run.
- Maximum 300 AI credits per day.
- Maximum 5 runs per user per 60-minute window.
- Content hashing skips unchanged work before inference.
- The agent receives only `contents: read`, `issues: read`, and
  `copilot-requests: write`.
- A separate validated safe-output job receives `issues: write`.

## Seven-day author-feedback lifecycle

The existing Microsoft GitHub Policy Service configuration remains
responsible
for stale closure:

- Open issues with `Needs-Author-Feedback` and no activity for 7 days
are
  closed with an explanatory comment.
- Open PRs with `Needs-Author-Feedback` and no activity for 7 days are
closed
  with an explanatory comment.
- An author comment removes `Needs-Author-Feedback` and returns the
issue/PR to
  team triage.
- An author push removes `Needs-Author-Feedback` from a PR.
- Manually removing the label immediately makes the issue or PR
ineligible for
  scheduled closure.

## Deprecated automation

- Deletes `.github/workflows/automatic-issue-deduplication.yml`.
- Deletes `.github/workflows/auto-labeler.yml`.
- Automatic PR product labeling from the old Models workflow is
intentionally
not replaced in this PR; a production PR ownership/path map should be
agreed
  separately.
- Keeps the manual batch deduplication workflow unchanged.
- Removes the passive XAML Styler verification step from
  `.pipelines/v2/templates/job-build-project.yml`.
- Keeps `.pipelines/applyXamlStyling.ps1` available for local developer
use.

## Validation Steps Performed

- Compiled `.github/workflows/issue-triage.md` with `gh aw compile`.
- Ran 32 focused Python tests for issue parsing, duplicate retrieval,
version
checks, reproduction rules, language signals, archive validation, report
  selection, redaction, and output privacy.
- Parsed the changed workflow and resource-management YAML.
- Verified the required production labels exist.
- Tested the workflow against the latest 20 PowerToys issues in the
sandbox;
  all 20 produced one canonical comment.
- Verified live variants for outdated versions, intermittent/passive
reproduction, non-English issues, rejected and analyzed reports,
optional UI
  reports, and title-only issues.

## PR Checklist

- [ ] **Communication:** Discussed with core contributors.
- [x] **Tests:** Added/updated and all focused tests pass.
- [ ] **Privacy / Responsible AI:** Complete required production reviews
before
  enabling.
- [x] **Localization:** No product UI strings are added.
- [x] **Dev docs:** Updated repository automation documentation.
- [x] **New binaries:** None.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 18a9b8ad-fd7e-4b9d-a06c-5e350bcde9d7
Copilot-Session: fd512b9b-db6f-4004-a65b-aa49404d568d
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-14 15:39:06 +08:00
Niels Laute
8d0fd6c70e [CmdPal] Settings UX tweaks (#49865)
## Summary of the Pull Request

Simplifies the Command Palette settings experience by removing obsolete
extension-discovery UI, introducing clearer semantic sections, and
reducing repetitive setting copy.

- Removes the Store discovery banner from the Installed extensions page
now that Gallery is the primary discovery surface in
`src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/ExtensionsPage.xaml`.
- Uses the existing section-header `TextBlock` pattern to organize
General and Personalization without introducing another settings-group
control.
- Regroups General settings into Activation, App behavior, For
developers, and About sections in
`src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/GeneralPage.xaml`.
- Regroups Personalization settings into Appearance, Layout and
positioning, and Interaction sections in
`src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/AppearancePage.xaml`.
- Moves compact mode, monitor placement, and notification placement to
Personalization, while preserving their existing bindings and automation
IDs.
- Clarifies compact-mode positioning with a horizontal slider and
directional description.

<img width="941" height="449" alt="Screenshot 2026-08-13 135040"
src="https://github.com/user-attachments/assets/01a53ab1-302b-4ce1-8537-0cc96aca459f"
/>

<img width="941" height="754" alt="Screenshot 2026-08-13 135103"
src="https://github.com/user-attachments/assets/2bae516c-75d3-4504-84e7-070e6b654281"
/>

<img width="710" height="719" alt="Screenshot 2026-08-13 135251"
src="https://github.com/user-attachments/assets/9aad14bb-9089-4cf6-9d7f-674171a22e9c"
/>

## PR Checklist

- [x] **Communication:** The settings UX was discussed and iterated with
Command Palette contributors.
- [x] **Tests:** No automated tests were added because these are
settings layout and copy changes; the CmdPal UI project builds
successfully.
- [x] **Localization:** All end-user-facing strings are stored in
`src/modules/cmdpal/Microsoft.CmdPal.UI/Strings/en-us/Resources.resw`.

## Detailed Description of the Pull Request / Additional comments

The Installed extensions page no longer promotes the Microsoft Store
because extension discovery now lives in Gallery. The search field is
promoted to the top of the page and the obsolete Store command and
visual resources are removed.

General and Personalization now use the section-header `TextBlock` style
already established in CmdPal settings. `SettingsExpander` remains
reserved for stronger parent-child relationships, such as activation
shortcut options and compact-mode positioning. The independent **Keep
search text when reopened** and **Select search text when opened**
options remain separate toggle cards.

Compact mode is now labeled **Open with a compact search box**. Its
nested **Vertical search box position** setting uses a horizontal slider
without an icon and explains how left/right maps to lower/higher screen
placement.

## Validation Steps Performed

- Formatted the changed XAML with the repository XamlStyler
configuration.
- Built
`src/modules/cmdpal/Microsoft.CmdPal.UI/Microsoft.CmdPal.UI.csproj` for
x64 Debug with `tools/build/build.ps1`.
- Launched the freshly staged development package and manually inspected
the Extensions, General, and Personalization pages.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e1966eaa-1e92-4e8a-a4fa-ce27539e508f
Copilot-Session: 120899e5-fc77-425e-918b-644929b65739
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-14 15:39:06 +08:00
Niels Laute
3976ee91c7 [Settings] Improve update-notification UX (#49872)
## Summary of the Pull Request

Refreshes the Settings update experience with a shared update
coordinator, consistent state badges, and a compact floating status
surface available across pages. The surface supports checking, update
available, downloading, ready to install, network failure, and download
failure states; it can be dismissed and reopens when users return to
General while attention is still needed.

https://github.com/user-attachments/assets/7b1a7266-efc3-4b6f-9bea-1d25a032ead6

## 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
- [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

## Detailed Description of the Pull Request / Additional comments

- Centralizes persisted and transient update state in a shared
`UpdateViewModel` used by Dashboard, General, navigation, and the
floating surface.
- Adds reusable status, activity, and badge controls with stable layout,
dismissal/reopen behavior, in-app What's New navigation, and retry-safe
single-flight update actions.
- Keeps the existing General update glyph while adding an adjacent state
badge.
- Adds Debug-only controls for previewing every updater state and
running the complete state flow without affecting production
screenshots.
- Adds focused coverage for state mapping, activity visibility,
IPC/launch failures, transient operation recovery, and duplicate
installer-launch prevention.

## Validation Steps Performed

- Built `Settings.UI` for x64 Debug.
- Built `Settings.UI.UnitTests` for x64 Debug.
- Ran focused `ViewModelTests.Update` and `ViewModelTests.General` tests
with `vstest.console.exe`: 39 passed.
- Exercised the Debug updater flow across all states and verified that a
dismissed notification reopens after navigating back to General.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 120899e5-fc77-425e-918b-644929b65739
Copilot-Session: 7da8be2f-1f73-48e9-8ae9-aa2448f2a5e3
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-14 11:07:26 +08:00
Gordon Lam
d851446a01 ci: remove redundant Azure module installation (#49861)
## Summary of the Pull Request

Removes a redundant Azure module-install step from the release
symbol-publishing job.

The following `AzurePowerShell@5` task already provides the only
required command, `Get-AzAccessToken`.

## PR Checklist

- [ ] **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

## Detailed Description of the Pull Request / Additional comments

The removed step bootstrapped a package provider and installed several
Azure modules.

Only `Get-AzAccessToken` is used by the job, inside the retained
`AzurePowerShell@5` task. The other installed modules are unused.

This change does not alter feeds, dependency versions, service
connections, token resources, symbol destinations, or artifacts.

## Validation Steps Performed

- Parsed
`.pipelines/v2/templates/job-publish-symbols-using-symbolrequestprod-api.yml`
successfully with PyYAML.
- Ran `git diff --check`.
- Confirmed the redundant package-provider and module-install commands
are removed.
- Signed x64/ARM64 release pipeline completed successfully.
- Required PR CI checks passed for x64 and ARM64 Release.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-14 11:07:26 +08:00
Noraa Junker
4f1a78342c [Shortcut Guide] Add Windows key hold activation options (#49661)
## Summary of the Pull Request

Adds configurable Windows-key hold activation to Shortcut Guide while
keeping the regular activation shortcut independent.

Users can choose to disable Windows-key activation, show taskbar
indicators, or open the full Shortcut Guide. Full-guide mode also
supports a configurable hold duration and optional close-on-release
behavior.

<img width="1099" height="611" alt="image"
src="https://github.com/user-attachments/assets/e0fe4c0f-3bef-43f8-a526-d22caf9e484e"
/>

## PR Checklist

- [ ] Closes: N/A
- [x] **Communication:** The UX and behavior were discussed before
implementation
- [x] **Tests:** Added/updated and all pass
- [x] **Localization:** All end-user-facing strings can be localized
- [x] **Dev docs:** Added/updated
- [ ] **New binaries:** Not applicable
- [ ] **Documentation updated:** Not applicable

## Detailed Description of the Pull Request / Additional comments

- Adds Off, taskbar-indicator, and full-guide Windows-key actions to
Settings.
- Adds a 100–5,000 ms hold-duration setting and a full-guide
close-on-release option.
- Handles left and right Windows keys and suppresses Start after an
activated hold.
- Routes Windows-key holds through a dedicated event so custom
activation shortcuts remain independent.
- Clears previous pressed-key registrations before refreshing them to
prevent duplicate long-press callbacks.
- Preserves compatibility with the existing `press_time` setting and
documents the new options.

## Validation Steps Performed

- Built the affected ARM64 Debug Settings, Runner, Shortcut Guide
module-interface, and Shortcut Guide UI projects.
- `ShortcutGuide.UnitTests`: 7/7 passed.
- Targeted Settings tests: 12/12 passed.
- Manually verified Off, taskbar-indicator, full-guide close-on-release,
and full-guide persistent modes.
- Verified configured hold thresholds, both Windows keys, Start
suppression, and regular-shortcut independence.
- Validated the final Settings XAML layout in the running Settings app.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Muyuan Li (from Dev Box) <muyuanli@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2b3acca3-e49b-4936-8fb9-6f669bd449db
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-14 11:07:26 +08:00
Niels Laute
b2ecd770e4 [Mouse Highlighter] Update default click colors (#49833)
## Summary of the Pull Request

Updates Mouse Highlighter's default click colors to the recommended
palette colors:

- Left click: green (`#BFFF00`)
- Right click: blue (`#00BFFF`)

Keeps the Settings UI, native module fallback, and DSC reference aligned
while preserving the existing 65% opacity. Existing saved preferences
are unchanged.

## PR Checklist

- [ ] Closes: N/A
- [x] **Communication:** Requested by a core contributor
- [x] **Tests:** Added/updated and all pass
- [x] **Localization:** No end-user-facing strings changed
- [x] **Dev docs:** Updated the Mouse Highlighter DSC reference
- [ ] **New binaries:** No new binaries
   - [ ] JSON for signing
   - [ ] WXS for installer
   - [ ] YML for CI pipeline
   - [ ] YML for signed pipeline
- [ ] **Documentation updated:** No external documentation update
required

## Detailed Description of the Pull Request / Additional comments

Adds shared managed constants for the two click-color defaults so
serialized settings and Settings UI fallback behavior cannot drift. The
native Mouse Highlighter fallback uses the same RGB values, and a
focused unit test locks down the defaults.

## Validation Steps Performed

- Built `MouseHighlighter.vcxproj` for x64 Debug
- Built `Settings.UI.UnitTests.csproj` for x64 Debug
- Passed
`MouseHighlighterSettingsTests.Defaults_ShouldUseRecommendedClickColors`

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-14 11:07:25 +08:00
st-gr
0452638470 feat(File Explorer): Add configurable local image rendering to Markdown previewer (#47857)
## Summary
- Adds a "Show local images" toggle in PowerToys Settings (File Explorer
> Markdown)
- When enabled, renders images referenced via relative paths or local
file paths in the Markdown preview pane
- Serves validated local image files on a WebView2 virtual host
(`https://localmdimages/`) directly from the handler's resource filter
- Supports local paths and UNC/network share paths
- Default: OFF (preserves existing behavior)
- GPO support: Admins can force-enable or force-disable via Group Policy

Fixes #40787
Fixes #3713

## Security model

| Scenario | Behavior |
|----------|----------|
| Setting OFF (default) | All images blocked, info bar shown. Raw HTML
`src` is rewritten to `#` in this state too, so a `data:` image cannot
render (it is resolved internally and never reaches the resource filter)
|
| Setting ON + relative path (`media/img.png`) | Resolved against .md
directory, rendered if under that tree |
| Setting ON + path traversal (`../../secret.png`) | Blocked — resolved
with `Path.GetFullPath` and checked with `Path.GetRelativePath`,
including percent-encoded traversal on the serving side |
| Setting ON + junction/symlink below the allowed path | Blocked — each
component of the resolved path is rejected if it carries
`FileAttributes.ReparsePoint`, since lexical containment alone does not
prevent redirection |
| Setting ON + UNC relative path (`images/pic.png` on `\\server\share`)
| Allowed within share root |
| Setting ON + remote URL (`https://evil.com/track.png`) | Always
blocked |
| data:/javascript: URI | Always blocked, in both setting states |
| `srcset` on a raw HTML `<img>` | Attribute removed, in both setting
states — its candidates are not validated by the `src` sanitizer |
| Script execution | Always disabled (`IsScriptEnabled = false`) |
| Mark-of-the-Web (MotW) | Explorer blocks preview of MotW-tagged files
before our code runs (OS-level protection) |

## GPO Policy

- Policy name: `MarkdownAllowLocalImages`
- Registry: `HKLM\SOFTWARE\Policies\PowerToys\MarkdownAllowLocalImages`
(DWORD: 1=enabled, 0=disabled)
- ADMX category: **PowerToys > File Explorer Preview**
- Uses `getConfiguredValue()` (individual module setting pattern, no
global utility fallback)

## Screenshots

### Settings UI — new toggle
_"Show local images" toggle nested under the Markdown preview section
(File Explorer add-ons). Captured from a Debug build of this branch (the
Settings app only runs standalone in Debug builds):_

<img width="1904" height="1014" alt="07-settings-ui-toggle"
src="https://raw.githubusercontent.com/st-gr/PowerToys/pr-47857-assets/07-settings-ui-toggle.png"
/>

### Settings UI — locked by GPO
_With the `MarkdownAllowLocalImages` policy set to Disabled, the toggle
is forced Off and grayed out, and the "managed by your organization"
info bar appears:_

<img width="1904" height="1014" alt="08-settings-ui-gpo-locked"
src="https://raw.githubusercontent.com/st-gr/PowerToys/pr-47857-assets/08-settings-ui-gpo-locked.png"
/>

### GPO in Group Policy Editor
_New "File Explorer Preview" category under PowerToys, showing the
policy and its description:_

<img width="1472" height="847" alt="01-gpedit-category"
src="https://github.com/user-attachments/assets/54acb539-345b-4512-9685-35930966a142"
/>

### GPO set to Enabled
_Policy enabled state in gpedit.msc:_

<img width="1473" height="848" alt="02-gpedit-policy-enabled"
src="https://github.com/user-attachments/assets/883f6b22-179d-4311-983d-2d835e4d897a"
/>

### Preview with local images rendered
_Markdown preview with local image rendering enabled — relative path
image renders:_

<img width="1430" height="881" alt="03-preview-images-shown"
src="https://github.com/user-attachments/assets/4a7ac7f0-d57d-4feb-bf2f-7e3c9093ab52"
/>

### Info bar for blocked remote images
_When the document contains remote (http/https) image URLs, they are
always blocked and an info bar is shown:_

<img width="1412" height="1035" alt="04-preview-infobar"
src="https://github.com/user-attachments/assets/0f798bbc-ae1b-43bf-b343-394080fff8e3"
/>

### GPO disabled — all images blocked
_With GPO set to disabled, all images (local and remote) are blocked.
Info bar reads "Some pictures have been blocked...":_

<img width="1417" height="704" alt="05-gpo-disabled-blocked"
src="https://github.com/user-attachments/assets/1c7a09a7-f4b9-467c-a0c0-f670680d6a2d"
/>

### Mark-of-the-Web protection
_Files copied from a network source carry a Zone Identifier (MotW).
Explorer blocks the preview entirely before our code runs — an OS-level
security layer:_

<img width="1114" height="591" alt="06-MotW-tagged"
src="https://github.com/user-attachments/assets/09cc2055-1e12-4c11-81fb-abd83ab8249c"
/>

## Implementation

Two layers were blocking images:
1. **Markdig AST layer** (`HTMLParsingExtension.cs`): replaced image
URLs with `#`
2. **WebView2 layer** (`MarkdownPreviewHandlerControl.cs`): returned
HTTP 403 for all non-HTML requests

Changes:
- `HTMLParsingExtension`: conditionally resolves markdown `![](path)`
images to virtual host URLs with path traversal protection
- `MarkdownHelper`: regex-rewrites relative `src=""` in raw HTML `<img>`
tags to virtual host URLs
- `MarkdownPreviewHandlerControl`: serves `https://localmdimages/`
requests in the `WebResourceRequested` handler — the URL is resolved
back to a file path, re-validated for containment against the allowed
base path (document directory, or share root for UNC), and the bytes are
returned via `CreateWebResourceResponse` with the proper content type.
Note: `SetVirtualHostNameToFolderMapping` is deliberately NOT used for
images — WebView2 Runtime 150+ no longer serves files from UNC/network
folder mappings (verified by A/B test on 150.0.4078.48); serving from
the handler works uniformly for local and UNC paths
- Settings UI: new toggle nested under the Markdown preview expander,
with GPO lock support
- Handler `Settings.cs`: reads `EnableMdLocalImages` via
`SettingsUtils`, GPO override via `GPOWrapper`
- GPO: `gpo.h` individual module setting, ADMX/ADML with
`FileExplorerPreview` category

## Known limitation

Peek also renders Markdown through `FilePreviewCommon.MarkdownHelper`,
but calls it without the
local-images arguments, so **Peek does not show local images even when
the setting is enabled** — it
keeps the existing behavior of blocking every image. With the setting
on, the same file therefore
renders differently in the preview pane (images shown) and in Peek
(images blocked).

This is deliberate for now: wiring the setting through Peek means
changing a module that is otherwise
untouched by this PR. Verified that Peek itself is unaffected — it still
renders Markdown correctly
against the shared assembly, with images blocked as before.

## Test plan
- [x] Toggle OFF: images blocked, "pictures blocked" info bar shows
(existing behavior)
- [x] Toggle ON with relative paths: `![](images/test.png)` renders
- [x] Toggle ON with HTML img: `<img src="images/test.png">` renders
- [x] Toggle ON with path traversal: `![](../../secret.png)` — blocked
- [x] Toggle ON with remote URL: `![](https://...)` — blocked, info bar
shown
- [x] UNC path: preview works on `\\server\share\...\file.md` with
relative images
- [x] UNC path with `../` within share: allowed (resolves within share
root)
- [x] Regression tested on WebView2 Runtime 150.0.4078.48: local + UNC
images render, blocked cases (traversal, data:, remote, encoded
traversal) stay blocked
- [x] GPO Enabled: images forced on
- [x] GPO Disabled: images forced off
- [x] GPO Not Configured: user controls toggle
- [x] gpedit.msc: policy appears under PowerToys > File Explorer Preview
- [x] MotW-tagged files: Explorer blocks preview before our code runs
- [x] Settings UI toggle locked when GPO configured (grayed out for both
forced states)
- [x] Other preview handlers (Monaco, SVG, PDF) unaffected

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-14 11:07:25 +08:00
Dan Fiedler
40478de1d9 Pin GitHub Actions to full-length commit SHAs (#49848)
Just like it says on the tin.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-14 11:07:25 +08:00
Gordon Lam
033afff6bc [Advanced Paste] Don't hardcode reasoning_effort=minimal for OpenAI p… (#49840)
…roviders

PR #46727 added `ReasoningEffort = "minimal"` to
OpenAIPromptExecutionSettings in
SemanticKernelPasteProvider.CreateExecutionSettings(). The value is not
user-configurable, so every OpenAI/Azure OpenAI request now fails on
models that don't accept 'minimal':

HTTP 400 (invalid_request_error: unsupported_value) Parameter:
reasoning_effort
Unsupported value: 'reasoning_effort' does not support 'minimal' with
this
  model. Supported values are: 'medium'.

This is the same class of regression PR #43766 previously fixed by
removing hardcoded Temperature/tuning properties. Remove the property so
the service default applies, and add a comment to prevent it being
reintroduced.

<!-- 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

- [ ] 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
- [ ] **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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-14 11:07:24 +08:00
Lucas Martins
d85fc2c7cc Add FancyZones monitor window rotation (#48772)
# Summary

Adds an opt-in FancyZones feature to rotate processable windows across
connected monitors.

The feature lets users hold the configured monitor rotation hotkey,
preview the current monitor content order, and rotate windows left or
right across monitor work areas using the arrow keys. The overlay keeps
content numbers visually consistent while windows move between monitors.

This change was prototyped and implemented with assistance from Codex.

# Demo

![Monitor window rotation
demo](https://raw.githubusercontent.com/APONTES19/PowerToys/feature/monitor-window-rotation/doc/images/fancyzones/monitor-window-rotation.gif)

# Details

- Adds FancyZones settings for monitor rotation and its activation
hotkey.
- Adds Settings UI controls under FancyZones > Windows.
- Extends the FancyZones keyboard hook to forward keyup events.
- Adds window snapshot, monitor mapping, and work-area-relative rotation
logic.
- Adds a dark visual overlay with monitor-content numbering and
directional transition hints.
- Updates FancyZones settings parsing coverage.

# Validation

- Built `FancyZonesLib.vcxproj` successfully.
- Built `FancyZones.vcxproj` successfully.
- Built Settings UI projects successfully.
- Built Runner successfully.
- Ran focused FancyZones settings parse tests successfully.
- Manual validation performed on a multi-monitor setup.

# Notes

The feature is disabled by default and must be enabled from FancyZones
settings.

---------

Co-authored-by: Muyuan Li (from Dev Box) <muyuanli@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2b3acca3-e49b-4936-8fb9-6f669bd449db
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
v0.101.2242.0
2026-08-13 12:36:07 +08:00
Jiří Polášek
454beb9ac9 CmdPal: Fix dock band activation lifecycle (#49739)
## Summary of the Pull Request

This PR improve handling of the dock band life cycle, with PerfMon
benefiting from this - it should reduce risk of bands being stuck.

- Remembers the exact IListPage used for the ItemsChanged subscription,
so we have muching unsubscribe.
- Serializes initialization and cleanup to prevent late subscriptions.
- Derives Performance Monitor load state from active subscribers, so our
decisions now follow the real-world state.
- Prevents widget activation counts from underflowing during Dock
rebuilds.
- Adds regression tests for activation transitions and cleanup races.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-13 12:36:07 +08:00
Clint Rutkas
a007eeebce [Deps] Update .NET runtime packages to 10.0.11 (#49847)
upgrading to 10.0.11

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-13 12:36:07 +08:00
Michael Jolley
8588414b0c [CmdPal] Consolidate search ranking changes (#49832)
## What's going on

The stacked pull requests are blocked by GitHub's stack merge flow. This
gives the full remaining search ranking change set one PR against
`main`.

## The plan

- Consolidates the open work from #49190, #49191, #49194, #49195,
#49197, #49246, #49247, and #49249.
- Keeps the existing stack unchanged while this PR provides an alternate
merge path.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5459b847-afeb-4163-a803-977759dd92df
Copilot-Session: 49185697-186e-406f-b081-8c985c134274
Copilot-Session: 92905c83-2de6-449c-b4a1-a08003fe2576
Copilot-Session: efe987e5-9297-47fc-af99-2f49b057285a
Copilot-Session: f42917e2-d298-4bde-9056-79a9e6e17dfa
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-13 12:36:06 +08:00
moooyo
a534f5e875 ci: pin .NET 10 SDK to runtime package version (#49835)
## Summary of the Pull Request

Pins the .NET 10 SDK used by CI to `10.0.302`, whose `10.0.10` runtime
matches the .NET servicing packages declared in
`Directory.Packages.props`. This prevents dependency-audit failures
caused by the floating `10.0` SDK channel advancing independently of the
repository's package versions.

## PR Checklist

- [x] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [x] **Tests:** N/A for this pipeline-only configuration change;
validation is documented below

## Detailed Description of the Pull Request / Additional comments

The CI template previously passed `10.0` to `dotnet-install.ps1
-Channel`. After .NET 10.0.11 became the latest release, CI combined
SDK-provided 10.0.11 runtime assets with NuGet runtime assets pinned to
10.0.10. `.pipelines/verifyDepsJsonLibraryVersions.ps1` consequently
detected different `System.Private.Windows.GdiPlus.dll` file versions
across generated `.deps.json` files.

This PR:

- Adds the optional `exactVersion` parameter to
`.pipelines/v2/templates/steps-ensure-dotnet-version.yml`. Existing
callers continue using channel-based installation when the parameter is
omitted.
- Sets `exactVersion` to `10.0.302` in
`.pipelines/v2/templates/job-build-project.yml`; that SDK contains the
10.0.10 runtime.
- Defines `DotNetRuntimePackageVersion` once in
`Directory.Packages.props` and references it from all 23 .NET servicing
packages.
- Adds cross-referenced comments so future SDK and runtime package
servicing updates remain aligned.

## Validation Steps Performed

- Confirmed the centralization assertion failed before the change with
23 literal `10.0.10` package versions and passed afterward with 23
`$(DotNetRuntimePackageVersion)` references and no remaining literals.
- Restored `PowerToys.slnx` successfully using `tools/build/build.ps1
-RestoreOnly`.
- Ran `dotnet-install.ps1 -Version 10.0.302 -DryRun` and confirmed that
it resolves the exact `10.0.302` SDK payload.
- Parsed `Directory.Packages.props` successfully as XML.
- Ran `git diff --check` successfully.
- Azure Pipelines validation remains pending while this PR is in Draft.

---------

Co-authored-by: Yu Leng <yuleng@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
v0.101.2241.0
2026-08-12 16:12:25 +08:00
Christian Gaarden Gaardmark
9e391af03d New+ Rename and Desktop icon positioning improvements (#48083)
New+ Rename and Desktop icon positioning improvements. Manually tested
on Windows 11. Windows 10 updates have NOT been tested.

## Summary of the Pull Request
* Obtain cursor position early in the lifecycle of the context menu
* Busy wait until copy is complete and shell is aware of icon
* If context menu is on desktop, reposition the icon using the cursor
position obtained scaled using monitor appropriate DPI
* Slight refactor to help port code from New++ to New+

## PR Checklist
- [x] Closes: #36440
- [ ] **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
- [n/a] **Localization:** All end-user-facing strings can be localized
- [n/a] **Dev docs:** Added/updated
- [n/a] **New binaries:** Added on the required places
- [n/a] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [n/a] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [n/a] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [n/a] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [n/a] **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
* n/a

## Validation Steps Performed

**Windows 11**
* x64: Manually tested
* ARM64: Not tested

**Windows 10**
* Not tested

---------

Co-authored-by: Boliang Zhang (from Dev Box) <bozhang@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 41b6b39b-b620-4e02-b7ca-8ae470a9c1e2
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-12 16:12:25 +08:00
moooyo
cd4721835b [Quick Accent] Fix missing last-item selection highlight (#49820)
## Summary of the Pull Request

Fixes a pre-existing Quick Accent rendering edge case where the last
character is selected and inserted correctly, but its selection
highlight is missing when a long character list is scrolled to the end.

The horizontal items panel now leaves a symmetric 1-DIP margin outside
its edge containers. This keeps `ScrollIntoView` from landing exactly at
the maximum scroll offset, where WinUI can clip the last item's selected
visual. The symmetric margin preserves short-list centering and works in
both flow directions.

The behavior was reproduced on both the #49633 baseline and #49655, so
it was not introduced by #49655.

## PR Checklist

- [ ] Closes: N/A — discovered while validating #49655; no matching
issue is currently filed
- [ ] **Communication:** Draft PR for maintainer discussion
- [x] **Tests:** Existing tests pass; the XAML compositor edge was also
covered by a deterministic GUI regression run
- [x] **Localization:** N/A — no end-user-facing strings changed
- [x] **Dev docs:** N/A — no developer-facing behavior or contract
changed
- [x] **New binaries:** N/A — no binaries or dependencies added
- [x] **Documentation updated:** N/A — no documentation impact

## Detailed Description of the Pull Request / Additional comments

With the overflowing horizontal list at its maximum offset, the last
`ListViewItem` remains realized, selected, and visible, and its
`SelectionIndicator` has opacity 1. However, WinUI does not paint that
selected visual. Adding one DIP of scroll extent after the edge
container avoids that boundary condition without changing selection or
keyboard-navigation logic.

The panel margin is symmetric so non-overflowing lists remain centered
and RTL layouts receive the same protection at either edge.
Infinite-width measurement already includes the margin, so the existing
window sizing path needs no special case.

## Validation Steps Performed

- Built `PowerAccent.UI` with `Debug|x64` using `tools/build/build.ps1`.
- Built `PowerAccent.Common.UnitTests` and `PowerAccent.Core.UnitTests`
with `Debug|x64`.
- Ran both suites with `vstest.console.exe`: **55/55 passed**.
- Reproduced the original failure by holding `A`, pressing `Space`, then
`Shift+Space` before reveal: the selected `ₐ` was inserted but the
baseline showed no selection-highlight pixels.
- Repeated the same first-frame scenario **20 times** after the fix: all
first and stable frames rendered the highlight (4441 detected accent
pixels), with the foreground window preserved.
- Repeated insertion validation in a dedicated text host **5 times**:
all runs inserted `U+2090` (`ₐ`), rendered the highlight, and preserved
foreground focus.
- Ran `git diff --check` successfully.

Co-authored-by: Yu Leng (from Dev Box) <yuleng@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-12 12:28:40 +08:00
Clint Rutkas
b99d4d57f3 [Mouse Highlighter] Keep ripple work off the low-level hook (#49699)
<!-- 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

Mouse Highlighter performed synchronous WinRT Composition work in its
`WH_MOUSE_LL` callback. Slow low-level hook callbacks stall the shared
mouse-hook chain and can be silently removed by Windows, causing a
button-up event to be lost and leaving the ripple or pressed state
stuck. FancyZones was inspected to confirm ownership but is not changed
by this PR.

This moves Mouse Highlighter's visual, animation, timer, and Z-order
work onto its module window thread. The hook now records events in a
bounded, allocation-free FIFO and posts a window message. Adjacent
high-rate mouse moves are coalesced, while button ordering, hook
timestamps, and signed screen coordinates (including negative
multi-monitor coordinates) are preserved. Stop, settings changes, and
teardown clear pending events, pressed state, hold state, and timers.
Settings application is also marshaled to the window thread so WinRT
Composition remains thread-affine.

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

- [ ] Closes: #xxx
<!-- - [ ] 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
- [ ] **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

The low-level hook now does only constant-time event capture and queue
signaling. A fixed-capacity FIFO preserves the sequence of button
transitions and mouse positions without allocating in the hook. Only
adjacent move events are coalesced, avoiding message flooding without
moving a cursor update across a button boundary. Input timestamps keep
quick-click versus hold classification based on the original 180 ms
threshold even if window-thread processing is delayed.

All Composition access runs through the Mouse Highlighter window/message
queue. Lifecycle paths unhook before clearing the queue and reset
button, ripple-hold, spotlight, and timer state. If the bounded queue
ever fills, recovery resets transient visual state before retaining the
triggering button event rather than risking a dropped button-up.

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed

- Built
`src/modules/MouseUtils/MouseHighlighter/MouseHighlighter.vcxproj` in
Debug x64.
- Built `src/modules/FancyZones/FancyZonesLib/FancyZonesLib.vcxproj` in
Debug x64 to verify the unchanged hook-chain neighbor.
- Ran `git diff --check`.
- Performed a focused concurrency and event-ordering code review.

No focused native unit-test seam exists for this hook/Composition path
without disproportionate refactoring, so no automated test was added. No
end-to-end rapid-click/drag stress run across mixed-DPI multi-monitor
layouts was performed.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Muyuan Li <116717757+MuyuanMS@users.noreply.github.com>
Copilot-Session: 6caaf738-168e-4b11-8efb-b155139dac31
Copilot-Session: 259addc8-304d-4595-83c8-bba3d76e0637
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
2026-08-12 12:28:40 +08:00
Makoto Sakaguchi
0407a5b4fe FileLocksmith: Fix context menu items are not localized (#49606)
<!-- 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
Fixing the issue where Windows 11 context menu items are not localized.

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

- [x] Closes: #37271 (Localized part ONLY)
<!-- - [ ] 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
- [x] **Dev docs:** No documentation changes are required for project
configuration fixes
- [x] **New binaries:** No new binaries are added
- [x] **Documentation updated:** No user documentation changes are
required

<!-- 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
Reorganize resource items for the `FileLocksmithContextMenu` project
 - Mark `resource.base.h` as a non-compiled `None`
 - Add `Generated Files/resource.h` as a `ClInclude`
 - Mark `FileLocksmithContextMenu.base.rc`as a non-compiled `None`
- Add `Generated Files/FileLocksmithContextMenu.rc` as a
`ResourceCompile`

Update the `.vcxproj.filters` accordingly to reflect the new locations
and filters for header and resource files.

<img width="1920" height="1020" alt="before"
src="https://github.com/user-attachments/assets/db8732e5-408c-4ab9-8c42-2f4d3d31e00a"
/>
Before

<img width="1920" height="1020" alt="after"
src="https://github.com/user-attachments/assets/87d82eaa-4daf-4339-92c5-40bbe45f7170"
/>
After

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220
## Validation Steps Performed
2026-08-12 12:28:39 +08:00
moooyo
fddb0ed30c [Quick Accent] Cloak the accent bar instead of hiding it (#49655)
## Summary of the Pull Request

Follow-up to #49633: replace the way the accent bar's first frame is
protected. #49633 fixed the blank/stale first frame (#49489) by masking
it — `Selector.Opacity = 0`, unveil after two
`CompositionTarget.Rendering` ticks, backed by a 150 ms watchdog. This
PR removes the cause instead, using the technique the Command Palette
and Quick Access already ship: **DWM-cloak the overlay instead of hiding
it**, so it never stops rendering and there is no stale frame to put
back on screen.

No user-visible behaviour change is intended beyond removing the fixed
two-render-tick reveal delay; this is a mechanism swap plus the cleanup
it enables.

## PR Checklist

- [x] **Closes:** N/A — #49489 was already closed by #49633; this
replaces that fix's mechanism
- [x] **Communication:** follow-up to a merged PR in the same module, no
new feature surface
- [x] **Tests:** `PowerAccent.Core.UnitTests` 32/32 still pass (the pure
width logic from #49633 is untouched). The current-head CI status is
tracked in the PR checks; the compositor-specific manual measurements
below were captured before the final commit-fence follow-up and are
labeled accordingly
- [x] **Localization:** no new end-user-facing strings
- [x] **Dev docs:** N/A
- [x] **New binaries:** none
- [x] **Documentation updated:** N/A

## Detailed Description of the Pull Request / Additional comments

### Why cloaking

A hidden WinUI 3 window renders nothing. Its composition surface
therefore still holds the frame it was showing when it was hidden, and
`ShowWindow` puts that stale frame back on screen before the rebuilt
accent list has been laid out — that is #49489. Everything downstream of
that follows from "the window does not render while hidden":

* the bar cannot be measured before it is shown (a `Collapsed` subtree
is never measured), hence #49633's measure-twice workaround;
* #49633 deferred reveal using rendering ticks because it did not have a
composition-commit fence;
* this PR calls
`Microsoft.UI.Composition.Compositor.RequestCommitAsync()` after the bar
has been laid out, sized, positioned and scrolled, and only reveals
after that commit completes. This replaces the frame counter and
watchdog with an explicit compositor fence.

A cloaked window is equally invisible to the user but stays
`SW_SHOWNA`-shown, so XAML keeps laying it out and painting it. This is
exactly what `Microsoft.CmdPal.UI\MainWindow.xaml.cs` does, and its
comment names the same symptom:

```csharp
// TRICKY: show our HWND again. This will trick XAML into painting our
// HWND again, so that we avoid the "flicker" caused by a WinUI3 app
// window being first shown
```

`QuickAccess.UI\QuickAccessXAML\MainWindow.xaml.cs` uses the same
pattern, including the "warm up the window while cloaked" prewarm that
this PR also picks up — which is what removes the *first summon of the
process* case that #49633's second measurement existed for.

### What the summon looks like now

`Show()` still raises `Showing`, so the surface leaves `Collapsed` and
the bar lays out — but the window is still cloaked, so nothing reaches
the screen. The bar is then measured **once** (on a templated, laid-out,
non-collapsed subtree), sized, positioned and scrolled to the selection.
The compositor commit is then awaited, and only after it completes does
`Reveal()` uncloak the window. The first visible frame is a finished bar
by construction rather than by timing.

Removed as a result: `RevealTimeoutMs`, `FramesBeforeReveal`,
`_revealTimer`, `_revealGeneration`, `_renderedFrames`,
`_measuredContentWidthDip`, `ArmRevealTimeout`, `CancelPendingReveal`,
`WaitForFirstFrameThenReveal`, `OnRenderingBeforeReveal`, the local
`Reveal`, and the `Selector.Opacity` dance — 87 net lines out of
`MainWindow`. `_showGeneration` stays: a layout callback queued by a
dismissed summon still has to be dropped.

### `TransparentWindow`

The cloak lives in the shared window because `Hide()` owns the
`AppWindow.Hide()` that has to be replaced. It is **opt-in**
(`EnableCloakedHide()`), so Shortcut Guide's overlay and CmdPal's toast
keep hiding exactly as they do today; only Quick Accent enables it.
`Reveal()` is a no-op for them.

Two details worth review attention:

* **Hit-testing.** Cloaking takes a window out of composition but *not*
out of hit-testing, and this HWND sits exactly where the user is typing.
While cloaked the window is therefore made click-through
(`WS_EX_TRANSPARENT`), restored on reveal. Without this, an invisible
accent bar would swallow clicks meant for the app underneath.
* **`SW_HIDE` then `SW_SHOWNA`.** Same order as CmdPal: the hide is what
hands the foreground back to whatever window should own it, and the show
that follows leaves the window "shown" — which is what keeps XAML
painting — while the cloak keeps it off screen. If DWM refuses to cloak,
the HWND remains hidden; a later `Show()` retries instead of exposing an
un-laid-out frame.

### Relationship to #34849 / #41044

Always-on-top is still released on hide, so the dormant overlay is
`WS_EX_TOPMOST=False` exactly as before — verified below. Cloaking is
orthogonal to topmost. The one honest trade-off is that the HWND is now
permanently `WS_VISIBLE` (cloaked), so it keeps participating in
composition while dormant, the same as CmdPal and Quick Access already
do; it stays out of Alt-Tab and the taskbar via a hidden owner plus
`WS_EX_TOOLWINDOW`.

## Validation Steps Performed

> The build/test/live-state results below were recorded at `e372cdf`.
Current head `ea658bb` adds the explicit `RequestCommitAsync` fence
after that validation. Current-head CI is tracked by the PR checks, and
the live window-state/frame-capture checks should be repeated before
merge.

* `build-essentials`, `Common.UI.Controls`, `PowerAccent.UI` and
`PowerAccent.Core.UnitTests` all build clean (Debug|x64), 0 warnings.
* `PowerAccent.Core.UnitTests`: 32/32 pass.
* Live window-state measurement against the built
`PowerToys.PowerAccent.exe` (`DwmGetWindowAttribute(DWMWA_CLOAKED)` +
`IsWindowVisible` + ex-styles), driving a real summon of the
<kbd>R</kbd> bar with **All languages** selected:

  | phase | state |
  |---|---|
| dormant (prewarmed, before any summon) | `visible=True cloaked=1
topmost=False clickThrough=True` |
| summoned | `visible=True cloaked=0 topmost=True clickThrough=False` |
| dismissed | `visible=True cloaked=1 topmost=False clickThrough=True` |

i.e. the window is shown-and-painting the whole time, invisible and
click-through while dormant, and topmost/interactive only while
summoned.
* Screen-captured the summoned bar: all 22 characters for <kbd>R</kbd>
render (including the wide `₹ ៛ ﷼`), leading and trailing padding are
symmetric, nothing is clipped and the selection is on the first cell.

---------

Co-authored-by: Yu Leng <yuleng@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
v0.101.2222.0
2026-08-11 13:41:34 +08:00
Gleb Khmyznikov
d0c27dd512 [UITests] Add UITest.Next suites (Image Resizer, Peek, File Explorer add‑ons, File Locksmith) + local‑VM tooling and CI test‑signing (#49671)
## Summary

Adds end‑to‑end UI tests on the `Microsoft.PowerToys.UITest.Next`
(winappcli) framework for three
modules, grows the shared `.Next` test framework with the helpers those
suites needed, and adds the
CI plumbing that lets shell‑extension tests exercise the **real**
Windows 11 modern context menu.
Also ships two agent skills that document how to write and run these
tests.

Product runtime behavior is **unchanged** — the only product edits are
test‑observability hooks in Peek
and a unit‑test project exclude.

Closes: https://github.com/microsoft/PowerToys/issues/40660
https://github.com/microsoft/PowerToys/issues/49424
https://github.com/microsoft/PowerToys/issues/40661

## What's added

### New UI test suites
- **Image Resizer** —
`src/modules/imageresizer/tests/ImageResizer.UITests`: context‑menu
enable/disable
tracking, the resize dialog, custom presets, every fit mode, every unit,
filename format, keep‑date,
  shrink‑only, replace‑in‑place, and orientation.
- **Peek** — `src/modules/peek/Peek.UITests.Next`: file‑preview coverage
across image/text/archive/
  markdown types with per‑arch visual baselines.
- **File Explorer add‑ons** —
`src/modules/previewpane/PreviewPane.UITests`: Preview Pane handlers and
  thumbnail providers.

### `UITestAutomation.Next` framework
- New helpers: `ExplorerShell` (Shell selection/view‑mode interop),
`WaitHelper` (structured stable
waits), `WindowControl` (foreground/context‑menu/process control),
`VisualAssert` (image compare),
  `WindowHelper`.
- Updates to `Session`, `UITestBase`, `SettingsConfigHelper`,
`WinappCli`.
- New `UITestAutomation.Next.UnitTests` project covering the new
wait/settings/CLI helpers.

### CI — sign sparse MSIX so the modern menu registers
- **`.pipelines/signSparsePackages.ps1`** — self‑signs each sparse
context‑menu MSIX with a
publisher‑matching test certificate and force‑trusts it (machine
stores), so
`AddPackageByUriAsync` succeeds on otherwise‑unsigned PR builds. Robust
`signtool` discovery with a
  NuGet fallback; test‑only trust that asserts no security.
- Wired into **`.pipelines/v2/templates/job-test-project.yml`** as a
best‑effort step covering the
run‑in‑place, machine‑install, and per‑user‑install locations. Signs
nothing it can't (skips
  already‑signed packages) and never fails the job.

### Product changes (test observability only)
- **Peek `FilePreview.xaml` / `.xaml.cs`** — a named `LoadingIndicator`
and a hidden automation peer
that exposes the current preview state as text, so tests can read load
state deterministically. No
  runtime behavior change.
- **`ImageResizer.UnitTests.csproj`** — exclude the sibling
`ImageResizer.UITests\**` folder from the
  unit‑test compilation.

### Agent skills & docs
- **New `ui-tests-local-vm` skill** — run `.Next` suites in persistent
dockur/windows VMs: setup,
agentic loop, image customization, troubleshooting, the shell‑extension
**signing** reference, plus
  controller/guest scripts and VM templates.
- **Updated `ui-tests-migration` skill** — WinAppDriver/Selenium →
`.Next` porting guidance
(CI stability, Explorer/shell‑extension test design, patterns &
pitfalls).
- **`doc/devdocs/development/ui-tests.md`** — updated for the `.Next`
workflow.

## Testing
- All three suites pass locally and in CI across **x64 Win10**, **x64
Win11**, and **arm64** (machine
  and per‑user install legs).

## Reviewer notes
- No product runtime behavior changes; product edits are limited to the
Peek test hooks above.
- The CI signing step is a **test‑only** trust anchor (self‑signed,
scoped to the agent) and is
best‑effort, so it can only add modern‑menu coverage and never regress
the job.
2026-08-11 12:07:52 +08:00
Boliang Zhang
b60564c4fe fix(settings-ui): restore General page navigation (#49801)
## Summary of the Pull Request

Fixes Settings navigation to the General page by applying the correctly
typed `SecondaryIsEnabledTextBlockStyle` to
`GeneralPage_UpdateChannelDescription` in
`src/settings-ui/Settings.UI/SettingsXAML/Views/GeneralPage.xaml`.

The previous `SecondaryTextStyle` targets `TextBlock`, so WinUI threw a
`XamlParseException` when applying it to the custom `IsEnabledTextBlock`
control. This prevented `GeneralPage.InitializeComponent()` from
completing.

## PR Checklist

- [x] **Communication:** Regression identified while validating the
v0.101 preview candidate
- [x] **Tests:** Existing Settings tests pass and the runtime regression
was verified
- [x] **Localization:** No end-user-facing strings changed

## Detailed Description of the Pull Request / Additional comments

PR #49722 introduced the incompatible style assignment. This change
reuses the existing `SecondaryIsEnabledTextBlockStyle`, which targets
`controls:IsEnabledTextBlock` and preserves the intended secondary
foreground and 12px font size.

The same regression is present on `stable`; this fix should be included
in the v0.101 release branch after merge.

## Validation Steps Performed

- Built `src/settings-ui/PowerToys.Settings.slnf` in Release x64.
- Ran `Settings.UI.UnitTests.dll`: 185 passed, 0 failed, 0 skipped.
- Launched the fixed Release Settings binary directly on `Overview`; the
General header and Update channel controls rendered.
- Confirmed no new `NavigationService` or `XamlParseException` log
entries and no relevant Event Viewer crash.

Copilot-Session: e9f79ac2-9a7b-4083-834c-0d87e8c83bfd
2026-08-11 12:07:52 +08:00
Gordon Lam
9ee025f2a7 Prefer running executable location when resolving PowerToys install path (#48905)
## Summary of the Pull Request

`PowerToysPathResolver.GetPowerToysInstallPath()` now resolves the
PowerToys installation directory from the **running executable''s own
location** first, and only falls back to the registry when the caller is
not running from within the PowerToys install tree.

Previously the resolver always went through the registry (the
`powertoys` protocol registration) for release builds. For the common
callers — module executables that ship in the PowerToys install folder
(Settings deep links from Color Picker, FancyZones, Image Resizer,
Workspaces, etc.) — the install directory is simply the folder the
binary was loaded from, so reading it from the running process is more
direct and does not depend on the registry registration being present or
up to date.

The registry path is retained as a fallback for callers that
legitimately run **outside** the install tree — notably the packaged
Command Palette extension host (MSIX, deployed under `WindowsApps`),
which has no other way to locate a separately-installed PowerToys to
launch `WinUI3Apps\PowerToys.Peek.UI.exe`.

## PR Checklist

- [ ] Closes: #xxx
- [x] **Communication:** discussed with core contributors
- [ ] **Tests:** Added/updated and all pass
- [x] **Localization:** No end-user-facing strings changed
- [x] **Dev docs:** Not applicable
- [x] **New binaries:** None added

## Detailed Description of the Pull Request / Additional comments

`GetPowerToysInstallPath()` (release path) now:

1. Resolves from the current process location first via the existing
`GetPathFromCurrentProcess()` helper. This works for both per-user and
per-machine installs and for any caller that runs from inside the
install tree.
2. Falls back to the registry only when step 1 yields nothing — i.e. for
the packaged Command Palette extension host that runs from
`WindowsApps`.

The per-machine (HKLM) registration is consulted for any process running
with administrator rights, since the per-user (HKCU) registration is
only meaningful for the interactive user. The change reuses existing
helpers (`GetPathFromCurrentProcess`, `GetPathFromRegistry`) and adds no
new public API, dependencies, or binaries. Debug-build behavior is
unchanged.

## Validation Steps Performed

- Built `ManagedCommon` (Release) — compiles clean, 0 warnings / 0
errors.
- Verified the three callers of `GetPowerToysInstallPath()`:
- In-tree module callers (Settings deep links, Workspaces) resolve via
the running executable location.
- The packaged Command Palette Indexer (`PeekFileCommand`) still
resolves via the registry fallback, since it runs from `WindowsApps` and
PowerToys is installed separately.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Boliang Zhang (from Dev Box) <bozhang@microsoft.com>
Copilot-Session: 41b6b39b-b620-4e02-b7ca-8ae470a9c1e2
2026-08-11 12:07:52 +08:00
Boliang Zhang
d1a567178b build(release): advance release train to 0.101 (#49795)
## Summary of the Pull Request

Updates `ReleaseTrainVersion` in `src/Version.props` from `0.100` to
`0.101` so automatic builds from `main` use the 0.101 release train.

## PR Checklist

- [x] **Communication:** This release-train transition was requested and
discussed with a core contributor
- [x] **Tests:** Existing version resolution was exercised with the
updated checked-in value

## Detailed Description of the Pull Request / Additional comments

The release pipeline defaults `versionNumber` to `auto`, which reads the
checked-in release train from `src/Version.props`. This change advances
that source of truth to `0.101` while retaining `ReleaseTrainEpoch` as
`2026-01-01` because the train transition occurs in the same calendar
year.

Automatic builds now generate versions in the form `0.101.<YDDDB>.0`.

## Validation Steps Performed

- Ran `.pipelines/resolveBuildMetadata.ps1` for a `main` build with
`versionNumber=auto`, build date `20260810`, and daily sequence `1`.
- Confirmed the resolved version is `0.101.2221.0` with the `preview`
channel.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8e04a72e-3b0f-4ac4-8156-d04ea9b8bb85
v0.101.2211.0
2026-08-10 12:48:20 +08:00
Boliang Zhang (from Dev Box)
a5cffe446b Merge main into stable for 0.101 release (rev 2)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ad8b7909-0472-4464-bdee-deaeca726f94
2026-08-10 11:22:30 +08:00
Jiří Polášek
5b7b91c9de CmdPal: Add extension gallery deep links (#49780)
## Summary of the Pull Request


This PR extends the x-cmdpal:// protocol to allow opening the Extension
Gallery and individual Extension Gallery items.

Extension developers can use this to link users directly from their
websites to the gallery, shortening the path to discovering and
installing Command Palette extensions.

- Adds typed x-cmdpal:// URI parsing in CmdPalProtocolActivation.
- Adds gallery and specific-extension deep links.
    - `x-cmdpal://extensions/gallery`
    - `x-cmdpal://extensions/gallery/{extension-id}`
- Opens extension details after the gallery loads.
- Integrate into existing gallery navigation to prevent garbage nav
stack.

Pictures? Pictures!


https://github.com/user-attachments/assets/d4d55b2a-2624-4a93-bdf7-55348b044b76

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

- [x] Closes: #49770
<!-- - [ ] 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
- [ ] **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
2026-08-09 14:15:20 -05:00
Hashim Khan
66f63c988a Fix PowerToys Run settings text: searchbox -> search box (#49777)
## Summary

Fixes #49717.

On the PowerToys Run settings page, the plugin keywords description said
"searchbox". Updated the English string to "search box".

## Validation Steps / Documentation

1. Open PowerToys Settings
2. Go to PowerToys Run
3. Confirm the plugin keywords description uses "search box"

## PR Checklist

- [x] Closes: #49717
- [x] Communication: I've discussed this with a PowerToys maintainer or
discussed this in a GitHub issue / discussion
- [ ] Tests: Added or updated tests for this change / N/A for
string-only change
- [ ] Docs: Documentation has been updated or N/A
- [x] Binary assets: N/A
2026-08-09 17:22:28 +00:00
Gordon Lam
68a2a0d57b [Modules] Handle WM_ENDSESSION in run_message_loop daemons (GrabAndMove, AlwaysOnTop, FancyZones) (#48404)
## Summary

Companion PR to #48378 (runner). Fixes the same
`APPLICATION_HANG_QUIESCE_*_PowerToys.exe!run_message_loop` WER bucket
in the other PowerToys daemons whose top-level windows ignored
`WM_ENDSESSION`.

## Root cause (same as #48378)

`run_message_loop` (`src/common/utils/window.h`) calls `GetMessageW`
which only returns `0` on `WM_QUIT`. If a daemon's WndProc lets
`WM_ENDSESSION` fall through to `DefWindowProc`, no `WM_QUIT` is ever
posted on logoff/shutdown, the loop blocks, CSRSS hits the quiesce
timeout (~5s), `TerminateProcess` fires, and Watson logs
`APPLICATION_HANG_QUIESCE`.

## `run_message_loop` callsite audit

8 production callsites. Persistent daemons that own a top-level window
and were affected:

| Module | Status before | Fix here |
|---|---|---|
| `runner` | hang | Fixed in #48378 |
| `GrabAndMove` | hang (tray icon, NIM_DELETE in WM_DESTROY) | 
`main.cpp` |
| `AlwaysOnTop` | hang |  `AlwaysOnTop.cpp` |
| `FancyZones` | hang |  `FancyZones.cpp` |
| `KeyboardManagerEngine` | n/a | No top-level window → OS skips
WM_ENDSESSION and TerminateProcess directly; no hang bucket possible |
| `ZoomIt` | already handled | SysInternals heritage |
| `PowerLauncher` | already handled | Managed `SessionEnding` event |
| `MeasureTool`, `Notifications` | transient/spawned on demand | Not a
shutdown-time daemon |

## Fix pattern

For `AlwaysOnTop` and `FancyZones` (no tray icon to clean up) — minimal:

```cpp
case WM_ENDSESSION:
    if (wparam) PostQuitMessage(0);  // wparam==FALSE => shutdown vetoed
    return 0;
```

For `GrabAndMove` (has `Shell_NotifyIcon` cleanup in `WM_DESTROY` that
must not run on shutdown) — use a `g_session_ending` flag and skip the
tray-icon delete in `WM_DESTROY`, mirroring runner's `tray_icon.cpp`
pattern from #48378.

No shared header: each module's `WM_DESTROY` cleanup is module-specific;
the abstraction would be too thin and would hide the variance in what to
*skip*.

## Why no logging on the shutdown path

Same reasoning as #48378 review feedback — `spdlog::flush_on(info)`
synchronously flushes to disk; emitting log lines from
`WM_ENDSESSION`/`WM_DESTROY` burns the ~5s quiesce budget for no
diagnostic value (Watson already records the bucket on failure).

## Verification

- Built clean (Debug|x64): GrabAndMove.vcxproj, AlwaysOnTop.vcxproj,
FancyZonesLib.vcxproj — all exit 0.
- Runner counterpart fix (#48378) verified end-to-end with real reboot +
WM_ENDSESSION injection; quiesce 1–8 ms. Same OS-level mechanism applies
here.

## Related

- #48378 — runner fix (this PR's companion)
- #48363 — original community fix (over-engineered; this approach is the
minimal correct one)

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-09 21:01:48 +08:00
Gordon Lam
ed7595f3a7 Harden IPC pipe ownership and shutdown lifecycle (#48902)
## Summary of the Pull Request

The two-way named-pipe IPC server (`TwoWayPipeMessageIPC`, shared by the
runner, Settings, and Quick Access host) created every pipe instance
without `FILE_FLAG_FIRST_PIPE_INSTANCE`. If a pipe with the same name
already existed — for example a leftover instance from a previous run or
another process — `CreateNamedPipe` would quietly create an *additional*
instance and share the name instead of owning it.

This makes `start_named_pipe_server` create the **first** instance with
`FILE_FLAG_FIRST_PIPE_INSTANCE`, so `CreateNamedPipe` fails fast on a
name collision and the server is the authoritative owner of its pipe
name.

## PR Checklist

- [ ] **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
(N/A — no user-facing strings)
- [x] **Dev docs:** Added/updated (N/A)
- [x] **New binaries:** Added on the required places (N/A — no new
binaries)

## Detailed Description of the Pull Request / Additional comments

- The flag is applied **only** to the first instance. Subsequent
instances continue to omit it, so the existing
`PIPE_UNLIMITED_INSTANCES` behavior is fully preserved.
- The change is contained to a single function in
`src/common/interop/two_way_pipe_message_ipc.cpp`. Public signatures and
the `PowerToys.Interop` ABI are unchanged, so the runner, Settings, and
Quick Access host all benefit without any code changes on their side.

## Validation Steps Performed

- The existing `Common.Interop.UnitTests` `TestSend` exercises the
modified first-instance code path (`Start()` →
`start_named_pipe_server`) and continues to pass — a full IPC round-trip
still works.
- Verified the updated `CreateNamedPipe` open-mode logic compiles
cleanly.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 49797c8c-784d-47e6-bc0f-53464eecec4b
2026-08-09 20:56:12 +08:00
Boliang Zhang
9d96049b1f [Mouse Jump] Sign new WinUI3 binaries (#49747)
## Summary
- add the new Mouse Jump HotKeys, Models, and WinUI3 binaries to the
core ESRP signing policy
- remove the retired MouseJumpUI signing entries

## Context
The signed main build
[154175666](https://microsoft.visualstudio.com/Dart/_build/results?buildId=154175666)
failed for both x64 and ARM64 because the binaries introduced by #48393
were not selected for signing.

## Validation
- parsed `.pipelines/ESRPSigning_core.json` successfully
- confirmed all four new binary names are present and the two obsolete
names are removed

---------

Copilot-Session: 11e23507-f1c3-45e5-888d-22cd78240f6b
2026-08-09 19:00:04 +08:00
Jiří Polášek
9e12b7a8ee CmdPal: Reduce items on default perfmon band (#49674)
<!-- 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 limits the number of items shown in the default Performance
Monitor dock band to prevent an overcrowded Dock experience.

- Limits the primary Performance Monitor dock band to CPU and RAM.
- Adds a new single-item dock band for network speed, showing upload and
download traffic. (The existing single-item Network shows only % usage).
- Updates the default docks to include both the primary Performance
Monitor band (CPU and RAM) and the new Network Speeds (Received / Sent)
band.

This PR intentionally avoids solving the question of what to do with the
original Performance dock band, that should be triaged separately.

<!-- 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
- [ ] **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
2026-08-08 13:41:42 -05:00
Jiří Polášek
03c571e1fc CmdPal: Aggregate net adapter stats and default adapter selection (#49678)
## Summary of the Pull Request

This PR introduces a new virtual network adapter in performance monitor
that sums up data from all physical adapters. That way users will see
any network usage, and for most of them it might be good enough. For the
rest, this PR adds a new command to set any network adapter as a
default.

- Switches from Performance Counters to raw GetIfTable2.
- Adds a new virtual network adapter "All" and uses it as a default.
- Adds a new command to set an actual default network adapter for the
perfmon.

<!-- 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
- [ ] **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
2026-08-08 13:40:59 -05:00
Jiří Polášek
9cfba78b60 CmdPal: Clean up removed top-level view models (#49728)
<!-- 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 ensures that manager-owned top-level commands and dock bands
release their extension subscriptions when they leave their collections.
Previously, provider reloads, removals, and enable/disable cycles could
retain discarded view models and their extension object graphs.

- Add an explicit cleanup path to `TopLevelViewModel`.
- Clean up commands and dock bands displaced by provider updates.
- Clean up entries removed during full command reloads.
- Clean up provider entries when a provider is removed or disabled.
- Perform cleanup after releasing collection locks.

<!-- 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
- [ ] **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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-08 13:39:50 -05:00
Jiří Polášek
a18779ec7c CmdPal: Clean up replaced command view models (#49730)
<!-- 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 formalizes ownership of command view models so replacing a
command releases the outgoing owned instance without cleaning up
commands borrowed by synthetic context items. It applies the same
cleanup discipline to parameter commands and partially built parameter
lists.

This is one of the places that let Command Palette hold COM proxies much
longer than it's desirable.

- Track whether a `CommandViewModel` is owned or borrowed.
- Add replacement logic that cleans up outgoing owned commands.
- Add a borrowing path for shared command instances.
- Clean up commands replaced in parameter view models.
- Roll back partially initialized parameter-list updates.
- Add regression tests for replacement and failure paths.

<!-- 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
- [ ] **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
2026-08-08 13:05:35 -05:00
Jiří Polášek
a0619fe430 CmdPal: Release extension objects after navigation (#49732)
<!-- 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 replaces the bare collection performed after leaving a list page
with a complete collection and finalization cycle. WinRT and COM proxies
are released by their finalizers, so a single `GC.Collect()` can leave
extension-owned objects retained on the finalizer queue.

Correctly offloaded onto background thread shouldn't pose UX issue, and
finalizers are only way to release COM garbage.

For now, I left the call only in the original place:
- Content and Parameter pages shouldn't generate too much garbage, so we
don't have to push for release explicitly.
- I considered cleanup when the CmdPal cloaks, but that would be
redundant to the cleanup after navigation.

Changes:
- Adds a reusable `ExtensionObjectReleaser` class that can push hard
enough on GC to trash COM garbage.
- Schedules cleanup after navigation instead of collecting immediately.
- Runs a collect, finalizer drain, and second collect off the UI thread.
- Debounces navigation bursts into a single cleanup cycle.
- Reschedules requests when another release cycle is already running.

<!-- 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
- [ ] **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
2026-08-08 13:01:47 -05:00
Copilot
14b09db016 Add Brave Browser keyboard shortcuts manifest for Shortcut Guide (#49615)
Shortcut Guide had no manifest for Brave Browser, so no shortcuts were
displayed when Brave was the active window.

## Summary of the Pull Request

Adds `BraveSoftware.BraveBrowser.en-US.yml` to the Shortcut Guide
manifests directory. Uses `WindowFilter: "brave.exe"` to match the
active process. The index is auto-generated at runtime by enumerating
all `.yml` files, so no code changes are required.

## PR Checklist

- [ ] **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

57 shortcuts across 4 sections, mirroring the Chrome manifest structure
(Brave is Chromium-based) with Brave-specific adjustments:

- **Tabs and windows** — standard tab/window management plus Brave's
unique "New private window with Tor" (`Ctrl+Alt+N`)
- **Brave features** — Brave Shields toggle (`Alt+D`), bookmarks bar,
history, downloads, DevTools, task manager, find bar, clear browsing
data
- **Address bar** — navigation and search shortcuts
- **Web page** — print, save, reload, zoom, bookmarking, page source,
scrolling

## Validation Steps Performed

- YAML parsed and validated programmatically; structure matches the
existing manifest schema
- Confirmed `WindowFilter: "brave.exe"` matches the Brave Browser
executable name
- Confirmed index.yml is generated at runtime from all `.yml` files — no
index update needed

<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes #49605

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-08-08 19:58:14 +02:00
Jiří Polášek
d96144a506 CmdPal: Prevent crashes when switching main window backdrops on the fly (#49755)
<!-- 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 prevents CmdPal from crashing when switching backdrops and fixes
transparent tint.

- Keeps a single SystemBackdrop attached and root projected targets
until WinUI disconnects them.
- Swaps and dispose controllers, brushes, and compositors on the XAML
thread.
- Restores tint for transparent solid backdrops using a retained
composition brush.
- Coalesces theme updates and retry transient native backdrop handoffs.
- Adds a fallback background if "Ooops" happens.


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

- [x] Closes: #49744
<!-- - [ ] 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
- [ ] **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
2026-08-08 12:48:24 -05:00
Mike Griese
f2796b74a5 CmdPal: make dialogs prevent compact mode from being collapsed (#49451)
ContentDialogs we present for CommandResult.Confirm need to be visible.
When the window is clipped for compact mode, the dialog is predictably
also collapsed.

This makes sure that content dialogs are always visible, by forcing us
out of compact mode when dialogs are shown.

Closes: quite sure it was filed somewhere, right?
2026-08-08 10:34:53 -05:00
Gleb Khmyznikov
a87f5b07a9 Advanced Paste additional customizations and PhiSilica provider (#46727)
## Summary

Adds an on-device **Phi Silica (Windows AI) paste provider** to Advanced
Paste and richer
per-action customization, plus the **package-identity plumbing** that
lets the unpackaged
Advanced Paste app use Windows AI APIs.

> Note: this supersedes the earlier "self-contained MSIX package
installed/registered by the
> WiX installer" approach. Advanced Paste is **not** packaged or
installed as a standalone
> MSIX. It keeps shipping as the existing unpackaged, self-contained
WinUI 3 executable in
> `WinUI3Apps/` and acquires **package identity at runtime from the
existing PowerToys sparse
> package** — there are no installer or ESRP MSIX repack changes.

## Advanced Paste features

- **New Phi Silica paste provider**
(`CustomActions/PhiSilicaPasteProvider.cs`): an on-device
AI provider backed by the Windows AI Phi Silica language model — no
cloud endpoint or API
key required. Registered as a new `AIServiceType` via
`PasteAIProviderFactory` /
  `AIServiceTypeRegistry`.
- **Additional custom actions** (`AdvancedPasteAdditionalAction`):
user-defined actions with
their own prompt, system prompt, AI provider, and shortcut — plus an
optional "coaching"
prompt/system-prompt/provider/shortcut and shortcut-conflict detection.
- **Built-in default prompts** (`AdvancedPasteDefaultPrompts`) and
updates to
  `AdvancedPasteCustomAction`, `PasteFormat(s)`, `OptionsViewModel`, and
`PasteFormatExecutor` to support per-action provider selection and
system prompts.
- **Settings UI** (`AdvancedPastePage.xaml`/`.xaml.cs`,
`Resources.resw`): configure the
Phi Silica provider, choose a provider per action, edit system/coaching
prompts, and a
Phi Silica availability/readiness experience — Settings queries the
Advanced Paste
executable via `--check-phi-silica`, and a **"Download model"** action
triggers
  `--prepare-phi-silica` to fetch the model and then re-probes.

## Package identity for Windows AI (replaces the MSIX-install approach)

- Phi Silica is a **Limited Access Feature (LAF)** that can only be
unlocked by a process
with a registered **package identity**. Advanced Paste runs unpackaged,
so it obtains
identity from the existing **`Microsoft.PowerToys.SparseApp`** sparse
package
(`src/PackageIdentity/`): a new `<Application
Id="PowerToys.AdvancedPasteUI">` entry in
`AppxManifest.xml` maps it to `PowerToys.AdvancedPaste.exe`, with
matching updates to
  `BuildSparsePackage.ps1`.
- **LAF unlock** at runtime via `PhiSilicaLafHelper.cs`. The
token/attestation are baked at
build time by the `GeneratePhiSilicaLafCredentials` MSBuild target into
`PhiSilicaLafCredentials.g.cs` — local **dev defaults** live in
`src/PhiSilicaLaf.props`
(imported from `Directory.Build.props`) and the **production secret** is
injected via
  `/p:` in the release pipeline.
- New **`AdvancedPaste.dev.manifest` / `AdvancedPaste.prod.manifest`**
application manifests
(selected by `CIBuild`) declaring full-trust and the system AI models
capability.

## Build & pipeline

- **Windows App SDK** moved to the coherent **stable `2.2.0`** line and
**added
`Microsoft.WindowsAppSDK.AI` `2.2.3`** (the Phi Silica APIs). Foundation
`2.1.0` carries the
sparse-identity PRI fix, and the stable AI build matches the OS Windows
AI runtime.
- **Independent versioning** for Advanced Paste
(`src/modules/AdvancedPaste/custom.props`,
XES one-store versioning, `AdvancedPasteVersion`). A
`steps-setup-versioning.yml` step is
added for Advanced Paste in `job-build-project.yml`, ordered **before**
CmdPal to avoid a
  version-collision installer failure (WIX0103).
- `release.yml` passes `PhiSilicaLafToken`/`PhiSilicaLafAttestation`
into the main build;
  spell-check allow-list/patterns updated.
- Removed now-unneeded dependencies: the
`Microsoft.Windows.Compatibility` reference and the
  `Common.UI` "force matching DLL versions" hack.
  
<img width="1073" height="716" alt="image"
src="https://github.com/user-attachments/assets/9364d86a-c0d1-4a08-a669-d98cbcb4b140"
/>
<img width="1038" height="308" alt="image"
src="https://github.com/user-attachments/assets/00eef1dd-b407-4841-bd64-f54f8a145c46"
/>
<img width="194" height="405" alt="image"
src="https://github.com/user-attachments/assets/d2f9c5bb-2507-4112-b3e0-56da681f88ea"
/>
<img width="489" height="453" alt="image"
src="https://github.com/user-attachments/assets/811d1afd-9993-48be-824e-82bb56c5ceca"
/>

[Video clip
internal](https://onedrive.cloud.microsoft/✌️/a@9n6nl3fp/S/cQpvAHrL5M9ZR6eUawztyfyBEgUCwCF-aKg9TbKyyGWP4c0KMA)

[Build
internal](https://microsoft.visualstudio.com/Dart/_build/results?buildId=149920754&view=artifacts&pathAsName=false&type=publishedArtifacts)

---------

Co-authored-by: Niels Laute <niels.laute@live.nl>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-08 07:43:59 +02:00
Jiří Polášek
56025d7372 CmdPal: Separate in-flight icon loads from cached results (#49738)
<!-- 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 stacked on #49737 and separates in-flight icon loading from
completed-result caching. The XAML request path no longer takes a
provider-wide lock, while concurrent requests for the same icon still
share a single task and completion cleanup can retire only that exact
task generation.

The loader now reports whether queue admission succeeded, preventing
requests rejected during shutdown from remaining pending indefinitely.

Overall, it seems that we got rid of a lock and actually reduced
turnaround on UI thread. The separate in-flight tracking takes its tall,
but overall throughput increased (tl;dr - it's faster).

- Deduplicate outstanding icon loads in a dedicated in-flight
dictionary.
- Cache successful tasks before atomically retiring their in-flight
entries.
- Keep failed and rejected loads out of the adaptive cache so they can
be retried.
- Replace `EnqueueLoad` with `TryEnqueueLoad` and fault rejected
requests.
- Add tests for concurrent loading, publication ordering, failures,
rejection, and retries.

<!-- 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
- [ ] **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
2026-08-07 14:15:34 -05:00
Jiří Polášek
601460561a CmdPal: Avoid all-stripe locking in the adaptive icon cache (#49737)
<!-- 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 removes all-stripe synchronization from `AdaptiveCache`. Using
`ConcurrentDictionary.Count` for capacity checks and `Keys` while
clearing could acquire every dictionary stripe, allowing XAML-bound icon
cache operations to wait behind unrelated concurrent mutations.

**The main problem here is that WinUI doens't take locked main STA
thread well and can fail-fast the app.**

- Track an approximate entry count with atomic updates after successful
mutations.
- Use the approximate count for capacity checks and maintenance
decisions.
- Enumerate the dictionary directly when clearing instead of
snapshotting `Keys`.
- Add concurrent cleanup and count-consistency regression tests.
- Add a matching CmdPal UI unit-test project to the solution.

<!-- 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
- [ ] **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
2026-08-07 12:40:13 -05:00
Jiří Polášek
3a84795531 CmdPal: Avoid redundant performance widget refreshes (#49735)
<!-- 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 removes a redundant collection refresh from Performance
Monitor's periodically invoked disk metrics callback. The callback
already updates the existing list item titles in place, so raising
`ItemsChanged` on every sample needlessly asks Command Palette to
refresh an unchanged collection.

- Stop raising `ItemsChanged` from the disk page's `Updated` handler.
- Continue updating disk usage and read/write speed titles in place.
- Avoid repeated collection refresh work during periodic performance
sampling.
2026-08-07 12:30:15 -05:00
Jiří Polášek
a5b1ec8124 CmdPal SDK: Fix weak command property subscriptions (#49731)
<!-- 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 fixes a weak-event subscription in the CmdPal toolkit that still
captured its owning `CommandItem` through an instance callback. That
strong reference defeated the weak listener, while command replacement
could also leave a stale handler attached to the outgoing command.

- Make the command property-change callback static.
- Resolve the owning `CommandItem` through the listener's weak
reference.
- Explicitly unsubscribe from the outgoing command during replacement.
- Retain the detach callback that removes dead listeners from long-lived
commands.
2026-08-07 12:28:40 -05:00
Jiří Polášek
d70ab95355 CmdPal: Remove article from "Select a file" button text (#49752)
<!-- 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 changes file picker parameter button text from "Select a file"
to "Select file".

## Pictures? Pictures!

<img width="1600" height="953" alt="image"
src="https://github.com/user-attachments/assets/221eeceb-ac49-4469-8989-b8d01cb4dd2c"
/>


<!-- 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
- [ ] **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
2026-08-07 15:58:28 +00:00
Niels Laute
57d32bcb6b Fix Keyboard Manager editor file picker not opening when elevated (#48876)
## Summary

Fixes #48845.

In the new WinUI 3 Keyboard Manager editor, clicking the **browse icon**
to select a program path (or "start in" folder) for the *Run Program*
action did nothing — no dialog appeared.

### Root cause

The editor (`PowerToys.KeyboardManagerEditorUI.exe`) is launched by the
Keyboard Manager module DLL via `ShellExecuteExW` from inside the
PowerToys runner (`src/modules/keyboardmanager/dll/dllmain.cpp`). When
PowerToys runs elevated, the editor **inherits that elevation**.

The browse buttons used the legacy **`Windows.Storage.Pickers`**
(`FileOpenPicker` / `FolderPicker` + `InitializeWithWindow`). Those
pickers activate through the UWP runtime broker, which fails with
`E_ACCESSDENIED` in an elevated process. The handlers were `async void`
with no `try/catch`, so the exception was swallowed and no dialog ever
opened. Typing/pasting a path into the field still worked — matching the
bug report.

### Fix

Switch both handlers to the Windows App SDK
**`Microsoft.Windows.Storage.Pickers`** API, constructed with a
`WindowId`. Those pickers are a thin wrapper over the in-process Win32
Common Item Dialog (`IFileOpenDialog`, `CLSCTX_INPROC_SERVER`) and work
correctly in elevated processes — the same mechanism already used
elsewhere in PowerToys (e.g. Settings UI
`IFileDialog`/`GetOpenFileName`, and CmdPal which already uses this
exact namespace). Also wrapped the handlers in `try/catch` with
`Logger.LogError` so any future failure is logged instead of silently
swallowed.

### Verification

- Built `KeyboardManagerEditorUI.csproj` (Release / x64) with all native
dependencies — exit code 0.
- Confirmed against the Windows App SDK source that
`Microsoft.Windows.Storage.Pickers.FileOpenPicker` uses
`create_instance<IFileOpenDialog>(CLSID_FileOpenDialog,
CLSCTX_INPROC_SERVER)` and `dialog->Show(hwnd)`, i.e. the elevation-safe
in-process dialog.

### Notes / out of scope

The report also mentions some apps (e.g. `visio.exe`) not launching
while others (`winword.exe`) do. That's a separate issue in the launch
path (`run_non_elevated` uses `CreateProcessW`, which ignores registry
App Paths / shell activation, unlike `ShellExecute` used by the *Open
URI* action) and is **not** addressed here.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Copilot-Session: 1f00def4-e790-4071-96c6-a81c9c2adba5
2026-08-07 17:05:47 +02:00
Jiří Polášek
9f2ddf6e85 CmdPal: Set Settings window titlebar PreferredTheme to UseDefaultAppMode (#49750)
## Summary of the Pull Request

This PR should fix the incorrect foreground color of title bar glyphs
after a theme change by setting the Settings window's title bar
`PreferredTheme` to [`TitleBarTheme.UseDefaultAppMode`](https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.titlebartheme?view=windows-app-sdk-2.0).
2026-08-07 09:57:35 -05:00
Jiří Polášek
81d3bb8e34 CmdPal: Initialize page icons after property changes in PageViewModel (#49672)
## Summary of the Pull Request

This PR is a quick fix for pages that changes their icon at runtime, and
then the icon is nowhere to be seen.

<!-- 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
- [ ] **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
2026-08-07 09:53:08 -05:00
Niels Laute
363226587b feat(settings-ui): add update channel selector (#49722)
Supersedes #49719, which cannot be reopened because its original base
branch was deleted after #49414 merged.

## Summary of the Pull Request Improves the update settings introduced
by #49414 by replacing the prerelease checkbox with a dedicated **Update
channel** expander. Users can choose between Stable and Insider
channels, see the current selection while the expander is collapsed, and
access the PowerToys Insider documentation. The new expander preserves
the existing `IncludePrereleaseUpdates` setting and displays its own
managed-by-organization state when the preview update policy is
configured. <img width="1576" height="526" alt="image"
src="https://github.com/user-attachments/assets/35863d4b-5ca1-4662-9d84-f184c98dbbc6"
/> ## PR Checklist - [x] **Communication:** This builds on the update
channel work merged in #49414 - [ ] **Tests:** No automated tests added;
this is a Settings UI presentation change over the existing setting -
[x] **Localization:** All end-user-facing strings can be localized - [ ]
**Documentation updated:** Documentation changes are maintained
separately ## Detailed Description of the Pull Request / Additional
comments - Moves `IncludePrereleaseUpdates` out of the general update
settings list into a dedicated SettingsExpander in
`src/settings-ui/Settings.UI/SettingsXAML/Views/GeneralPage.xaml`. -
Adds Stable and Insider radio-button choices, descriptions, collapsed
status text, and an Insider learn-more link. - Adds localized strings in
`src/settings-ui/Settings.UI/Strings/en-us/Resources.resw`. - Separates
the preview update policy warning from the other update settings
warnings in
`src/settings-ui/Settings.UI/ViewModels/GeneralViewModel.cs`. ##
Validation Steps Performed - Built
`src/settings-ui/Settings.UI/PowerToys.Settings.csproj` for Debug ARM64
with the repository build script. - Applied the repository XAML Styler
configuration to `GeneralPage.xaml`.

---------

Copilot-Session: 4169c03d-5e17-4495-b7b1-8e6af0d6565c
2026-08-07 16:40:44 +08:00
Niels Laute
9df98bdad3 Add progress/result window to the Bug Report flow with a GitHub issue shortcut (#48980)
## Summary of the Pull Request

Adds a small, native progress/result window to the **Bug Report** flow
so users get feedback while the report is generated and a one-click path
to file a GitHub issue.

Previously, triggering "Report bug" (from the tray menu or **Settings →
General**) ran `PowerToys.BugReportTool.exe` hidden for ~30 seconds with
**no feedback at all**, then popped a plain message box. Many users then
had to manually find the `.zip` and figure out where to file the issue.

Now the runner shows a lightweight window that:

- Displays an animated **"Generating bug report…"** state while the tool
runs.
- On completion, shows **where the `.zip` was saved**
(`…\Desktop\PowerToysReport_<timestamp>.zip`) in a read-only, copyable
field.
- Offers **Open folder** (reveals/selects the `.zip` in Explorer) and
**Report on GitHub** (opens the prefilled `bug_report.yml` issue
template *and* reveals the `.zip` so it can be dragged into the issue).
- Shows a clear error state if the report could not be created.

> Note: GitHub has no API/URL to pre-attach a binary to a new issue
(attachments only happen via browser drag-drop). So the "Report on
GitHub" action does the next best thing: opens the prefilled issue page
and highlights the `.zip` in Explorer for a single drag to attach.


https://github.com/user-attachments/assets/9307d728-bbbd-4258-9480-ced65d2fa065


## PR Checklist

- [ ] Closes: #xxx
- [x] **Communication:** Lightweight, additive UX on an existing
feature; happy to adjust per maintainer feedback.
- [ ] **Tests:** No automated tests (native Win32 window in the runner);
validated manually — see below.
- [x] **Localization:** All end-user-facing strings are added to
`src/runner/Resources.resx` and loaded via `GET_RESOURCE_STRING`.
- [ ] **Dev docs:** N/A
- [x] **New binaries:** None — `bug_report_dialog.cpp/.h` compile into
the existing `PowerToys.exe` (runner). No new WinUI app or DLL, so no
signing/WXS/CI changes required.

## Detailed Description of the Pull Request / Additional comments

- New files `src/runner/bug_report_dialog.{h,cpp}` implement the window
as plain Win32 (no Common Controls v6 dependency, no managed/WinUI
payload), so it works for **both** entry points since it lives in the
runner.
- `bug_report.cpp` now calls `run_bug_report_dialog(...)` instead of the
silent run + message box. The "running" state (observed by Settings) is
cleared as soon as the **tool process** exits, so the result window can
stay open without keeping the Settings button spinning. A guard
re-focuses an already-open window instead of starting a second report.
- The window uses the canonical `AttachThreadInput` foreground recipe so
it reliably surfaces even when launched from Settings (a different
foreground process), and gets a taskbar button so it stays findable
during the ~30s run.
- The output path is discovered by locating the newest
`PowerToysReport_*.zip` in the Desktop folder after the tool exits (the
tool names the file internally with a timestamp).
- Strings added: dialog title, generating/hint text, done header/hint,
failed text, and button captions.

## Validation Steps Performed

- Triggered **Report bug** from the **system tray** menu: window appears
in the foreground, animates "Generating…", then shows the saved `.zip`
path with working **Open folder** and **Report on GitHub** buttons.
- Verified **Open folder** selects the `.zip` in Explorer and **Report
on GitHub** opens the prefilled `bug_report.yml` issue template with the
`.zip` highlighted for drag-and-drop.
- Verified the error state renders correctly (and wraps long localized
text) when the tool can't run.
- Built `runner` (ARM64, Debug) clean; verified end-to-end on a high-DPI
display.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-08-07 10:08:56 +02:00
Boliang Zhang
bb12277d8d fix(ci): support automatic versions and counter-exhaustion recovery (#49745)
## Summary of the Pull Request

Follow-up to #49414 that fixes two release-pipeline recovery issues:

- Azure DevOps treats an empty runtime string parameter as required, so
`.pipelines/v2/release.yml` now uses `auto` as the default version
override.
- Explicit `main` and `stable` version overrides are resolved before
automatic `YDDDB` generation, allowing a manually versioned build to
proceed after the daily sequence exceeds 9.

## PR Checklist

- [x] **Communication:** This is a follow-up to the reviewed
preview-release versioning design in #49414
- [x] **Tests:** Added/updated and all pass

## Detailed Description of the Pull Request / Additional comments

`auto` is normalized to an empty override in
`.pipelines/resolveBuildMetadata.ps1`, preserving automatic
release-train version generation without requiring input in the Run
Pipeline dialog.

Override parsing is now separated from automatic version generation.
Full explicit versions bypass daily-sequence and generated-date
validation, while automatic versions continue to require a sequence from
1 through 9 and fail closed outside that range.

`.pipelines/tests/resolveBuildMetadata.Tests.ps1` covers scheduled
`main` with the `auto` default, automatic `stable` generation, and
explicit preview/stable recovery when the daily counter has reached 10.

## Validation Steps Performed

- `Invoke-Pester .pipelines\tests\resolveBuildMetadata.Tests.ps1
-EnableExit` — 22 passed
- Confirmed `auto` resolves a first August 7 stable build to
`0.100.2191.0`
- Confirmed explicit `0.101.0` resolves to `0.101.0.0` with daily
sequence 10

Copilot-Session: 8e04a72e-3b0f-4ac4-8156-d04ea9b8bb85
2026-08-07 15:34:29 +08:00