Repository navigation
fix: keep the plus key in macOS shortcut labels - #110
Open
Jacob-9909 wants to merge 1 commit into
Open
Jacob-9909 wants to merge 1 commit into
Jacob-9909 wants to merge 1 commit into
Conversation
normalizeShortcutLabel stripped every "+", including the key itself, so "Shift+Num +" (zoom in) rendered as "⇧" and "Ctrl+Num +" (level decrease) as "⌘". Only strip a "+" that joins two keys. Verified with the studio-host vitest suite (160 passed) and tsc.
This branch has not been deployed
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
On macOS, the menu shortcuts for zoom in (
Shift+Num +) and level decrease (Ctrl+Num +) are shown as a bare⇧/⌘, becausenormalizeShortcutLabelremoves every+, including the key itself.Changes
apps/studio-host/src/core/platform.ts: only strip a+that joins two keys, soShift+Num +becomes⇧+andCtrl+Num +becomes⌘+. Existing labels such asCtrl+Shift+S->⌘⇧Sand(Ctrl+F)->(⌘F)are unchanged.apps/studio-host/src/core/desktop-chrome.test.ts: added cases forShift+Num +,Ctrl+Num +andShift+Num -.No build, release, or upstream (
third_party/rhwp) impact. Windows and Linux labels are not touched (the function returns early for non-macOS).Testing
pnpm --filter @golbin/hop-studio-host exec vitest run: 160 passed (159 before, plus the new case). The new case fails without the fix (expected '⇧' to be '⇧+').tsc --noEmit -p apps/studio-host: clean.