CmdPal: Icons (12/n) - Share Shell icons by identity and display file-type previews - #50192
Open
Jiří Polášek (jiripolasek) wants to merge 2 commits into
Conversation
11 tasks
Jiří Polášek (jiripolasek)
marked this pull request as ready for review
August 28, 2026 16:57
🧭 PR intakeVisual evidence: Required — The pull request changes product UI files, so reviewers need to see the visible result. Visual evidence is currently missing. Author actionJiří Polášek (@jiripolasek), please update the following before review:
See the contribution guide for the full checklist. If there is no author response within 7 days, this PR will be automatically closed. Automated PR intake; PowerToys maintainers make final decisions. |
- Adds host-side Shell icon resolution and extraction so paths sharing the same system icon reuse one cached source. - Introduces generation-aware invalidation, direct HICON conversion, safe fallbacks, Indexer integration, diagnostics, samples, and regression tests.
- Publishs a shared file-type icon before performing exact Shell refinement. - Keeps intermediate presentation off the STA and coalesce dispatcher updates. - Skips shortcut previews and add diagnostics and regression coverage.
Jiří Polášek (jiripolasek)
force-pushed
the
dev/jpolasek/f/49944-cmdpal-svg-icons
branch
from
August 29, 2026 10:53
78f8e33 to
3a166b7
Compare
Jiří Polášek (jiripolasek)
force-pushed
the
dev/jpolasek/f/50131-cmdpal-shell-icon-identity
branch
from
August 29, 2026 10:53
37575e7 to
cc6f3c0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Part 12 of 12 in the CmdPal icon-loading series. Depends on #50191.
This PR resolves Shell identity before materialization so different item paths can share one cached icon, and adds a quick file-type preview before exact refinement.
Motivation: thousands of files often share a small set of icons. Avoid repeating extraction/materialization, while giving the user a useful preview during per-item resolution.
Note: A dear reviewer will observe that both System32 samples are still slow as a drunk crippled squirrel and icons are loading slowly anyway. The reason for that is that the list items are initialized in order, and before it is initialized, list item view model doesn't know anything about its icon at all. There's a follow-up PR that tackles this issue.
Examples
Using
Microsoft.CommandPalette.Extensions.Toolkit:The first two serialize as:
The last example requests the DLL file's Shell icon. It does not mean “extract icon resource 1,” which remains a different request:
Evidence
These are Shell-specific characterizations, not an accepted comparison with the preceding PR.
The counts demonstrate sharing, not instantaneous visible icons. Repeat a matched-page cold/warm comparison on the final build and explain the warm re-extraction run before claiming a reliable latency improvement. All apps/Home scenarios do not substitute for a Shell workload.
Technical notes
SHGFI_USEFILEATTRIBUTESsupplies only the provisional type icon, not proof of the exact item's identity. Exact lookup still corrects custom icons. Extensionless items and shortcuts skip this phase; a dotted directory can briefly receive a file-type preview rather than forcing a filesystem check on the STA.Implementation:
src/modules/cmdpal/Microsoft.CmdPal.UI/Helpers/Icons/ShellIconLocationResolver.cs.PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed