Skip to content

fix: keep the plus key in macOS shortcut labels - #110

Open
Jacob-9909 wants to merge 1 commit into
golbin:mainfrom
Jacob-9909:fix/macos-shortcut-plus-key
Open

Jacob-9909 wants to merge 1 commit into
golbin:mainfrom
Jacob-9909:fix/macos-shortcut-plus-key

Conversation

@Jacob-9909

Copy link
Copy Markdown

Summary

On macOS, the menu shortcuts for zoom in (Shift+Num +) and level decrease (Ctrl+Num +) are shown as a bare ⇧ / ⌘, because normalizeShortcutLabel removes every +, including the key itself.

Changes

  • apps/studio-host/src/core/platform.ts: only strip a + that joins two keys, so Shift+Num + becomes ⇧+ and Ctrl+Num + becomes ⌘+. Existing labels such as Ctrl+Shift+S -> ⌘⇧S and (Ctrl+F) -> (⌘F) are unchanged.
  • apps/studio-host/src/core/desktop-chrome.test.ts: added cases for Shift+Num +, Ctrl+Num + and Shift+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.

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

No deployments
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.

1 participant