Skip to content

CmdPal: Virtualize grid views and polish it - #50233

Open
Jiří Polášek (jiripolasek) wants to merge 1 commit into
microsoft:mainfrom
jiripolasek:dev/jpolasek/f/44408-cmdpal-gridview-virtualization-and-polish
Open

CmdPal: Virtualize grid views and polish it#50233
Jiří Polášek (jiripolasek) wants to merge 1 commit into
microsoft:mainfrom
jiripolasek:dev/jpolasek/f/44408-cmdpal-gridview-virtualization-and-polish

Conversation

@jiripolasek

@jiripolasek Jiří Polášek (jiripolasek) commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

Warning

It is a good idea necessary to merge #50231 before this.
The icon fix not only makes it look good, but also prevents layout cycle.

This PR replaces that implementation with a grouped GridView backed by the native ItemsWrapGrid, allowing WinUI to realize and recycle only the containers needed for the current viewport.

CmdPal grid and gallery pages used a custom WrapPanel that measured and arranged every item. This prevented container virtualization and made large result sets increasingly expensive.

And because I'm lazy splitting and retesting everything, this PR is packing some other fixes on a way toward making the grid view usable, like keyboard navigation.

  • Projects the existing flat item collection into native grid groups while preserving headers, separators, ordering, and repeated header occurrences.
  • Reuses existing group and item wrappers during updates to avoid resetting the view or unnecessarily recreating containers.
  • Coalesces collection changes and safely handles reentrant updates and late header metadata.
  • Releases the grouped source and its subscriptions together when the view unloads or its data context changes. This prevents updates from reaching torn-down native group state, which caused the back-navigation crash.
  • Implements grid-aware Left/Right, Up/Down, and PageUp/PageDown navigation without depending on containers being realized.
  • Preserves the intended column across partial rows and section headers, scrolls off-screen targets into view, and wraps arrow navigation at list boundaries.
  • Adds Native AOT type preservation for ItemsWrapGrid.
  • Adds an issue-specific large-grid sample and packages the gallery image assets needed by Sample Pages.
  • Removes the obsolete custom wrap panel and grid template selectors.

Pictures? Pictures!

Screen.Recording.2026-08-29.091926.mp4
Screen.Recording.2026-08-29.095121.mp4

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

@jiripolasek Jiří Polášek (jiripolasek) added the Product-Command Palette Refers to the Command Palette utility label Aug 29, 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 Aug 29, 2026
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown

✅ PR intake

All automated intake checks now pass. Thanks for the updates!

Automated PR intake; PowerToys maintainers make final decisions.

@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 Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Command Palette Refers to the Command Palette utility Ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CmdPal: Grid arrow navigation does not wrap at boundaries CmdPal: Gallery / grid view is not virtualizing

2 participants