feat(shortcut-guide): add Postman manifest and fix numbered-key display#48461
feat(shortcut-guide): add Postman manifest and fix numbered-key display#48461brycewc wants to merge 3 commits into
Conversation
Add a Shortcut Guide manifest for Postman (Postman.exe). Also fix a bug where single-digit keys (0-9) in a manifest were treated as Windows virtual-key codes instead of literal digits, so shortcuts like Ctrl+0 (reset zoom) and Ctrl+9 (last tab) rendered as blank/incorrect glyphs. Show the 'switch to a specific tab' shortcut as a '1 - 8' range instead of a literal '1' in the Edge, Chrome, Firefox, and Postman manifests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Add ShortcutGuide.UnitTests (MSTest) with tests for ShortcutDescriptionToKeysConverter.GetKeysList: single-digit keys render as the literal digit (regression for VK-code misinterpretation), modifier ordering, non-numeric passthrough, and arrow-key VK mapping. Registered in PowerToys.slnx; CI discovers it via the existing **\*UnitTest*.dll glob. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@microsoft-github-policy-service agree |
Postbot is Postman's built-in AI assistant, referenced in the Postman shortcut manifest. Add it to the check-spelling expect list. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
@brycewc Thanks for this PR! Can you add a screenshot in the PR description of the built version with the changes applied? |
|
Please use |
@noraa-junker, thanks! That makes sense. One scoping question before I push the change. The converter tweak in this PR currently makes bare digits render as literal numbers globally. There are about 90 bare-digit keys across 15 existing manifests (Adobe apps, Slack, IntelliJ, VS Code, Blender, and others). If I revert the converter and move to Would you like this PR to: Convert all existing manifests to |
Summary of the Pull Request
Adds a Shortcut Guide manifest for Postman and fixes a rendering bug where single-digit keys in manifests displayed incorrectly.
src/modules/ShortcutGuide/ShortcutGuide.Ui/Converters/ShortcutDescriptionToKeysConverter.cs: a single digit (0–9) in a manifest'sKeyswas treated as a Windows virtual-key code instead of the literal digit. Since VK1is the left mouse button, VK9is Tab, and VK0is undefined, shortcuts such asCtrl+0(reset zoom) andCtrl+9(last tab) rendered as blank/incorrect glyphs. Single digits are now rendered as the literal character.src/modules/ShortcutGuide/ShortcutGuide.Ui/Assets/ShortcutGuide/Manifests/Postman.Postman.en-US.yml: new manifest forPostman.execovering Tabs, Sidebar, Request, Interface, Window and modals, and Console. Auto-included via the existingManifests/*.ymlglob inShortcutGuide.Ui.csproj.1, which (after the fix above) read asCtrl + 1. It now uses a1 - 8range so the keycap conveys "any tab number 1 through 8". The separate "last tab" (9) and "reset zoom" (0) entries remain literal single keys.ShortcutGuide.UnitTests(MSTest) project coveringShortcutDescriptionToKeysConverter.GetKeysList, including the single-digit regression.PR Checklist
Detailed Description of the Pull Request / Additional comments
The Shortcut Guide displays per-app shortcuts from YAML manifests, matched to the foreground window via
WindowFilter. Keys are converted to keycaps byShortcutDescriptionToKeysConverter. Numeric key strings were unconditionally parsed as virtual-key codes, so literal-digit shortcuts rendered wrong. The fix adds a>= 0 and <= 9case that emits the digit character as-is; non-digit numeric codes (arrows, etc.) are unchanged.The new Postman manifest exercises this with
Ctrl+0/Ctrl+9. The browser/Postman "specific tab" entries were updated from the literal1to the1 - 8range string, rendered verbatim byKeyVisual(the same path used by the existingNumber (1-9)key in the Windows Explorer manifest).A new
ShortcutGuide.UnitTests(MSTest) project covers the converter: single digits render literally (regression test), modifier ordering, non-numeric passthrough (e.g.1 - 8), and arrow-key VK mapping.Validation Steps Performed
Built and ran locally (x64 Debug):
ShortcutGuideModuleInterface,ShortcutGuide.Ui, andShortcutGuide.IndexYmlGenerator; launched the DebugPowerToys.exe.Win+Shift+/) with Postman focused: the Postman section renders with all categories, andCtrl+1/Ctrl+9/Ctrl+0display correctly (previously blank/incorrect).Ctrl + 1 - 8in Edge, Chrome, Firefox, and Postman.ShortcutGuide.UnitTestsand ran viavstest.console.exe: 8/8 tests pass.Co-Authored-By: Claude Opus 4.8