Boliang ZhangandCopilot a00b2bce74 fix(quick-accent): defer selection until the current list is ready (#51583)
<!--
HARD RULE: You (the human contributor) must write this PR description in
your own words.
AI tools and agents: Do NOT write the Summary, Detailed Description, or
Validation Steps sections.
Leave them for the human. You may put AI-generated text ONLY inside an
"AI-generated summary" <details> block at the bottom.
Maintainers will close PRs whose description they think was not written
by a human.
See
https://github.com/microsoft/PowerToys/blob/main/CONTRIBUTING.md#pull-request-descriptions-must-be-written-by-a-human
-->

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

<details>
<summary>AI-generated summary</summary>

### Change

Fixes a Quick Accent crash when the initial arrow selection for a new
character list is applied to the retained list from the preceding
gesture. The source-level regression traces to #49633, which
deliberately stopped clearing the list on hide to prevent a blank first
frame.

`src\modules\poweraccent\PowerAccent.UI\PowerAccentXAML\MainWindow.xaml.cs`
now caches selection while the current list is not ready. After the
delayed display installs the current items, it applies the cached
selection. Live navigation remains immediate. Hiding/canceling resets
readiness; the existing generation checks and retained-content
first-frame protection remain in place.

No settings schema, native interface, localization, dependency or
installer changes.

### Reproduction observed before this fix

On installed `0.102.2933.0`, with start-from-left disabled and arrow
activation allowed:

1. Select Currency, hold S and press Right, then release.
2. Select French without restarting Quick Accent.
3. Hold E and press Right.

The module terminated with an unhandled native exception (`e06d7363`)
and `ucrtbase.dll` fatal exit (`0xc0000409`, offset `0xA527E`). Currency
S leaves two UI items; French E computes initial index 2 for its
five-item list before the delayed UI replacement. The same signature was
independently observed during manual reproduction.

### Added regression coverage

`src\modules\poweraccent\PowerAccent.UITests\PowerAccentEndToEndTests.cs`
adds:

- `ArrowActivationUsesNewCharacterListAfterLanguageChange`: Currency S
-> French E with Right; verifies selected and inserted character.
- `ArrowActivationUsesNewCharacterListAfterShortList`: French C -> E
with Left and Right as separate data rows; no module restart between
gestures.

### Validation completed

Worktree: `D:\PT-QA`. Commands ran in the installed Visual Studio 2022
x64 developer environment, selecting the existing .NET 10.0.100 SDK
through `DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR`,
`DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR` and
`DOTNET_MSBUILD_SDK_RESOLVER_SDKS_VER`. The default VS 2026 Build Tools
installation lacks its .NET SDK resolver. This fallback emitted
`NETSDK1233` compatibility warnings; it is not a claim of a warning-free
VS 2026 build.

The shortened worktree has no source paths exceeding MAX_PATH.
`SkipLongPathsCheck` avoids changing the host's system-wide long-path
setting.

| Exact command | Result |
|---|---|
| `pwsh -NoProfile -File D:\PT-QA\tools\build\build.ps1 -Path
D:\PT-QA\src\modules\poweraccent\PowerAccent.UI -Platform x64
-Configuration Debug /restore /p:RestorePackagesConfig=true
/p:SolutionDir=D:\PT-QA\ /p:SkipLongPathsCheck=true /nr:false` | Passed,
exit 0; actual UI executable/DLL produced; 0 errors |
| `pwsh -NoProfile -File D:\PT-QA\tools\build\build.ps1 -Path
D:\PT-QA\src\modules\poweraccent\PowerAccent.UITests -Platform x64
-Configuration Debug /restore /p:RestorePackagesConfig=true
/p:SolutionDir=D:\PT-QA\ /p:SkipLongPathsCheck=true /nr:false` | Passed,
exit 0; regression test executable/DLL produced; 0 errors |
| `pwsh -NoProfile -File D:\PT-QA\tools\build\build.ps1 -Path
D:\PT-QA\src\modules\poweraccent\PowerAccent.Core.UnitTests -Platform
x64 -Configuration Debug /restore /p:RestorePackagesConfig=true
/p:SolutionDir=D:\PT-QA\ /p:SkipLongPathsCheck=true /nr:false` | Passed,
exit 0 |
|
`D:\PT-QA\x64\Debug\tests\PowerAccent.Core.UnitTests\PowerToys.PowerAccent.Core.UnitTests.exe
--report-trx --report-trx-filename core-tests.trx --results-directory
D:\PowerToys-qa-diagnostic-20261026\fix-build\core-test-results` |
Passed, exit 0; 35 executed, 35 passed, 0 skipped |
| `dotnet format whitespace D:\PT-QA --folder --include
src\modules\poweraccent\PowerAccent.UI\PowerAccentXAML\MainWindow.xaml.cs
src\modules\poweraccent\PowerAccent.UITests\PowerAccentEndToEndTests.cs
--verify-no-changes --verbosity quiet` | Passed, exit 0 |
| `git -C D:\PT-QA diff --check` | Passed |

### Local runtime verification completed

On 2026-10-26, the verification skill's Scenario B local-build path
exercised the exact candidate `78c027449e590341e1ebe155713e7686768d36cf`
and its unchanged main parent
`1c39ab3492e0e90c133500c1cb3848704fe6ce5c`. Only the local Quick Accent
module was launched; installed Runner/Settings and unrelated modules
remained in place, with no installation overlay.

| Exact command | Result |
|---|---|
| `pwsh -NoProfile -File D:\PT-QA\tools\build\build.ps1 -Path
D:\PT-QA\src\modules\poweraccent\PowerAccent.UI -Platform x64
-Configuration Release /restore /p:RestorePackagesConfig=true
/p:SolutionDir=D:\PT-QA\ /p:SkipLongPathsCheck=true /nr:false` | Passed,
exit 0; fixed Release output built |
| `pwsh -NoProfile -File D:\PT-QA-Base\tools\build\build.ps1 -Path
D:\PT-QA-Base\src\modules\poweraccent\PowerAccent.UI -Platform x64
-Configuration Release /restore /p:RestorePackagesConfig=true
/p:SolutionDir=D:\PT-QA-Base\ /p:SkipLongPathsCheck=true /nr:false` |
Passed, exit 0; unchanged parent Release output built |
| `& "$w\drivers\run.ps1"` from `D:\PT-QA`, with `$w` the recorded
`verify-QuickAccent-PR51583-20261026-release` workspace | Completed with
exit 0 and verified cleanup; fixed checks **5 PASS / 0 FAIL / 0
BLOCKED**, separate unfixed control **FAIL (product)** |

The driver used actual held-key input, scoped `winapp ui` captures, UIA
candidate/selection reads and exact text readback from an owned Latin
editor. It did not replace keyboard navigation with UIA selection.

| Fixed-build check | Result |
|---|---|
| Currency S+Right -> French E+Right, without restarting | PASS;
selected and inserted U+20AA then U+00EA |
| French C+Space -> E+Left, without restarting | PASS; U+00E7 then
U+00E8 |
| French C+Space -> E+Right, without restarting | PASS; U+00E7 then
U+00EA |
| Right/Left/Space/Shift+Space navigation, wrap and Unicode descriptions
| PASS; final selected U+00E9 inserted exactly once |
| Early release before a 1000-ms delay, no stale toolbar, then sustained
reactivation | PASS; ordinary base `e` retained after cancellation, then
U+00EA selected and inserted |

**Release red/green evidence:** the unfixed parent successfully inserted
the Currency warm-up, then crashed on French E+Right (`ucrtbase.dll`,
`0xc0000409`, offset `0xA527E`). The fixed Release process survived all
five checks. Exact running paths, loaded assembly identities,
timestamps, candidate images and original errors are retained in the
local archive.

Earlier Debug verification passed all five fixed checks, but its one
parent control also passed. That non-reproduction is retained; the final
differential evidence above is specifically **Release**, not a claim
that Debug reproduced the crash.

Cleanup restored original settings bytes, UsageInfo absence, enabled
preference, shipped module, Settings geometry/scroll, foreground and
pointer. Installed file hashes and all 16 pre-existing unrelated
PowerToys process identities matched; owned fixtures exited. No
clipboard operations were performed.

**Separate known finding:** documented exit-event cleanup can raise
`Application.Exit / coreclr.dll / 0xc0000005` in both the installed
build and local modules. It was recorded separately from this
selector-crash fix and was not silently fixed or counted as a selector
failure.

### Remaining validation boundaries

These are targeted local verification results, **not execution of the
MSTest UI-test project**, complete module sign-off or the Windows 10/11
default/constrained, ARM64 and UI-test CI matrix. The local VM root is
not configured; no VM provisioning or machine permission changes were
made. Exact first-visible-frame timing was not measured.

The first inconclusive driver attempt, repaired Debug run and final
Release comparison are all retained separately. Reports, scripts, raw
actions and hash manifests are under the local
`PowerToys\Module-Signoff\verify-QuickAccent-PR51583-20261026-local`
archive, with final Release evidence in `release\report.md`. No private
backups or media were uploaded to this PR. The human contributor still
needs to fill the visible description and review the template checklist.

</details>

Copilot-Session: f8993945-7828-4e7a-bb4d-e7f55ba992da

(cherry picked from commit d6c59de74e)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 06dd32db-6c63-41bf-9e31-741a03493abf
2026-10-27 11:31:15 +08:00
2026-02-11 22:59:53 +01:00
2026-10-20 11:56:22 +08:00
2026-09-16 09:13:00 -07:00
2020-03-05 10:11:27 -08:00
2020-05-02 15:59:18 -07:00
2026-02-14 15:47:56 +08:00

Microsoft PowerToys

Microsoft PowerToys is a collection of utilities that help you customize Windows and streamline everyday tasks.

Installation · Documentation · Blog · Release notes

🔨 Utilities

PowerToys includes over 30 utilities to help you customize and optimize your Windows experience:

Advanced Paste icon Advanced Paste Always on Top icon Always on Top Awake icon Awake
Color Picker icon Color Picker Command Not Found icon Command Not Found Command Palette icon Command Palette
Crop and Lock icon Crop And Lock Environment Variables icon Environment Variables FancyZones icon FancyZones
File Explorer Add-ons icon File Explorer Add-ons File Locksmith icon File Locksmith Grab And Move icon Grab And Move
Hosts File Editor icon Hosts File Editor Image Resizer icon Image Resizer Keyboard Manager icon Keyboard Manager
Light Switch icon Light Switch Mouse Utilities icon Mouse Utilities Mouse Without Borders icon Mouse Without Borders
New+ icon New+ Peek icon Peek PowerDisplay icon PowerDisplay
PowerRename icon PowerRename PowerToys Run icon PowerToys Run Quick Accent icon Quick Accent
Registry Preview icon Registry Preview Screen Ruler icon Screen Ruler Shortcut Guide icon Shortcut Guide
Text Extractor icon Text Extractor Window Hopper icon Window Hopper Workspaces icon Workspaces
ZoomIt icon ZoomIt

📦 Installation

For detailed installation instructions and system requirements, visit the installation docs.

But to get started quickly, choose one of the installation methods below:

Download the .exe file from GitHub

Go to the PowerToys GitHub releases, scroll down and select Assets to reveal the installation files, and choose the one that matches your architecture and install scope. For most devices, that would be x64 per-user.

Microsoft Store
You can easily install PowerToys from the Microsoft Store:

WinGet
Download PowerToys from [WinGet](https://github.com/microsoft/winget-cli#installing-the-client). Updating PowerToys via winget will respect the current PowerToys installation scope. To install PowerToys, run the following command from the command line / PowerShell:
  • User scope installer (default)
winget install Microsoft.PowerToys -s winget
  • Machine-wide scope installer
winget install --scope machine Microsoft.PowerToys -s winget
Other methods
There are [community driven install methods](https://learn.microsoft.com/windows/powertoys/install#community-driven-install-tools) such as Chocolatey and Scoop. If these are your preferred install solutions, you can find the install instructions there.

✨ What's new?

What's new image

To see what's new, check out the release notes.

🛣️ Roadmap

For v0.102, we're working on modernizing several utilities with WinUI 3, expanding Command Palette with tabs and JavaScript/TypeScript extensions, and adding new productivity improvements across PowerToys.

❤️ PowerToys Community

The PowerToys team is extremely grateful to have the support of an amazing active community. The work you do is incredibly important. PowerToys wouldn't be nearly what it is today without your help filing bugs, updating documentation, guiding the design, or writing features. We want to say thank you and take time to recognize your work. Your contributions and feedback improve PowerToys month after month!

Contributing

This project welcomes contributions of all types. Besides coding features / bug fixes, other ways to assist include spec writing, design, documentation, and finding bugs. We are excited to work with the power user community to build a set of tools for helping you get the most out of Windows. We ask that before you start work on a feature that you would like to contribute, please read our Contributor's Guide. We would be happy to work with you to figure out the best approach, provide guidance and mentorship throughout feature development, and help avoid any wasted or duplicate effort. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you grant us the rights to use your contribution and that you have permission to do so. For guidance on developing for PowerToys, please read the developer docs for a detailed breakdown. This includes how to setup your computer to compile.

Code of conduct

This project has adopted the Microsoft Open Source Code of Conduct.

Privacy statement

The application logs basic diagnostic data (telemetry). For more privacy information and what we collect, see our PowerToys Data and Privacy documentation.

Languages
C 39.8%
C# 31.3%
C++ 13.6%
JavaScript 12.5%
PowerShell 2.4%
Other 0.3%