Skip to content

CmdPal: Prioritize initialization of visible and selected list items - #50469

Open
Jiří Polášek (jiripolasek) wants to merge 5 commits into
mainfrom
feature/50179-cmdpal-realized-item-initialization
Open

CmdPal: Prioritize initialization of visible and selected list items#50469
Jiří Polášek (jiripolasek) wants to merge 5 commits into
mainfrom
feature/50179-cmdpal-realized-item-initialization

Conversation

@jiripolasek

@jiripolasek Jiří Polášek (jiripolasek) commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

This PR prioritizes initialization of visible and selected CmdPal list items. When users scroll or change selection, newly needed items move ahead of pending off-screen work, helping their content and icons appear sooner.

  • Initializes visible and selected items first, while allowing work already in progress to finish.
  • Uses lock-free demand signaling and the existing background initializer, without adding workers or UI-thread locks.
  • Preserves demand as item containers are recycled and initialization coordinators are replaced.
  • Recovers interrupted work when navigating Back, without refetching unchanged pages whose contents were already published.
  • Adds regression coverage for cancellation, recycling, coordinator replacement, and navigation races.

Note: if you see this and think, didn't we already approved and merged this? Well, sort of... this is the same patch as #50203, just rebased on top of main.

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
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

…ed (#50203)

## Summary of the Pull Request

> [!NOTE]
> This is a follow-up to the icon PR, but I’d prefer not to stack the
two. It addresses similar performance concerns but is independent of the
icon-loading changes. 🐿️

This PR prioritizes initialization of visible and selected CmdPal list
items. When users scroll or change selection, newly needed items move
ahead of pending off-screen work, helping their content and icons appear
sooner.

- Initializes visible and selected items first, while allowing work
already in progress to finish.
- Uses lock-free demand signaling and the existing background
initializer, without adding workers or UI-thread locks.
- Preserves demand as item containers are recycled and initialization
coordinators are replaced.
- Recovers interrupted work when navigating Back, without refetching
unchanged pages whose contents were already published.
- Adds regression coverage for cancellation, recycling, coordinator
replacement, and navigation races.


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

- [x] Closes: #50179 
<!-- - [ ] 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
@jiripolasek Jiří Polášek (jiripolasek) added the Product-Command Palette Refers to the Command Palette utility label Sep 8, 2026
@github-actions github-actions Bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Sep 8, 2026
@github-actions

This comment was marked as resolved.

@jiripolasek Jiří Polášek (jiripolasek) removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Sep 8, 2026
@github-actions github-actions Bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Sep 8, 2026
- Tracks realized grid items and release demands per control on unload.
- Preserves publication completion across deferred filter updates.
- Replays suspended selection changes when navigation resumes.
- Prunes released demands from item lists and incoming queues on arrival.
- Preserves FIFO priority during concurrent pruning and dequeue.
- Releases the item snapshot when coordinator completed its job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Command Palette Refers to the Command Palette utility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CmdPal: prioritize initialization of visible list items

1 participant