Skip to content

feat(shortcut-guide): add Postman manifest and fix numbered-key display#48461

Open
brycewc wants to merge 3 commits into
microsoft:mainfrom
brycewc:shortcut-guide-postman-numbered-keys
Open

feat(shortcut-guide): add Postman manifest and fix numbered-key display#48461
brycewc wants to merge 3 commits into
microsoft:mainfrom
brycewc:shortcut-guide-postman-numbered-keys

Conversation

@brycewc

@brycewc brycewc commented Jun 10, 2026

Copy link
Copy Markdown

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.

  • Fix numbered-key renderingsrc/modules/ShortcutGuide/ShortcutGuide.Ui/Converters/ShortcutDescriptionToKeysConverter.cs: a single digit (09) in a manifest's Keys was treated as a Windows virtual-key code instead of the literal digit. Since VK 1 is the left mouse button, VK 9 is Tab, and VK 0 is undefined, shortcuts such as Ctrl+0 (reset zoom) and Ctrl+9 (last tab) rendered as blank/incorrect glyphs. Single digits are now rendered as the literal character.
  • Add Postman shortcutssrc/modules/ShortcutGuide/ShortcutGuide.Ui/Assets/ShortcutGuide/Manifests/Postman.Postman.en-US.yml: new manifest for Postman.exe covering Tabs, Sidebar, Request, Interface, Window and modals, and Console. Auto-included via the existing Manifests/*.yml glob in ShortcutGuide.Ui.csproj.
  • Show tab-number ranges — Edge, Chrome, Firefox, and Postman manifests: the "switch to a specific tab" entry used the literal key 1, which (after the fix above) read as Ctrl + 1. It now uses a 1 - 8 range so the keycap conveys "any tab number 1 through 8". The separate "last tab" (9) and "reset zoom" (0) entries remain literal single keys.
  • Add unit tests — new ShortcutGuide.UnitTests (MSTest) project covering ShortcutDescriptionToKeysConverter.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 by ShortcutDescriptionToKeysConverter. Numeric key strings were unconditionally parsed as virtual-key codes, so literal-digit shortcuts rendered wrong. The fix adds a >= 0 and <= 9 case 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 literal 1 to the 1 - 8 range string, rendered verbatim by KeyVisual (the same path used by the existing Number (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):

  • Built ShortcutGuideModuleInterface, ShortcutGuide.Ui, and ShortcutGuide.IndexYmlGenerator; launched the Debug PowerToys.exe.
  • Triggered Shortcut Guide (Win+Shift+/) with Postman focused: the Postman section renders with all categories, and Ctrl+1 / Ctrl+9 / Ctrl+0 display correctly (previously blank/incorrect).
  • Verified the "specific tab" entry renders as Ctrl + 1 - 8 in Edge, Chrome, Firefox, and Postman.
  • Built ShortcutGuide.UnitTests and ran via vstest.console.exe: 8/8 tests pass.
PowerToys Shortcut Guide Running Postman

Co-Authored-By: Claude Opus 4.8

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>
@github-actions

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>
@brycewc

brycewc commented Jun 10, 2026

Copy link
Copy Markdown
Author

@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>
@github-actions

This comment has been minimized.

@niels9001

Copy link
Copy Markdown
Collaborator

@brycewc Thanks for this PR! Can you add a screenshot in the PR description of the built version with the changes applied?

@niels9001 niels9001 requested a review from noraa-junker June 11, 2026 14:32
@noraa-junker

Copy link
Copy Markdown
Collaborator

Please use <0>, <1> and so on for numbers. That is the intended way. We should probably document it.

@brycewc

brycewc commented Jun 11, 2026

Copy link
Copy Markdown
Author

Please use <0>, <1> and so on for numbers. That is the intended way. We should probably document it.

@noraa-junker, thanks! That makes sense. <9> is already handled by the bracket-strip in KeyVisual, and since the spec defines a bare number as a virtual-key code, <N> is the correct way to express a literal number key. I'm happy to switch to it and add <0> through <9> to the "Special keys" table in the spec.

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 <N>, those existing manifests will render incorrectly again unless they are also converted.

Would you like this PR to:

Convert all existing manifests to <N> and revert the converter change. This fully fixes the rendering the intended way, but it is a larger diff.
Keep it scoped to the new Postman manifest plus document the <N> convention, with the bulk conversion as a follow-up issue.
Also, for ranges like "switch to a specific tab (1-8)", is a literal label such as 1 - 8 fine, or do you have a preferred notation? (<1> - <8> will not render cleanly, since the bracket-strip only trims the ends.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shortcut Guide renders single-digit shortcut keys incorrectly (Ctrl+0, Ctrl+9)

4 participants