-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
format mac hints according to guidelines #5
Conversation
index.js
Outdated
if (window.navigator.platform.indexOf('Mac') === 0) { | ||
return pretty | ||
return sortMacKeys(prettyParts) | ||
.join(' ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a space? The screenshot didn’t have them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, the hint looks too loose with spaces:
Without spaces it looks better:
And you always have an option to use letter-spacing
CSS property to control the spacing.
BTW, hints in the native Mac menus have a more complex layout, each key and modifier is aligned within its own column - so it won't look exactly right anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also use short-space symbol " "
You will need to update |
test/index.test.ts
Outdated
|
||
test('makes mac hotkey hint prettier', () => { | ||
equal(getHotKeyHint(MAC_WINDOW, 'alt+b'), '⌥ B') | ||
equal(getHotKeyHint(MAC_WINDOW, 'meta+ctrl+shift+alt+b'), '⌃ ⌥ ⇧ ⌘ B') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also check that Win order is correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a test for windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean not a test, but to find what order is canonical on Windows.
Tried a new approach (regex instead of |
Last things to do:
|
@ai For Windows, the modifier order is Meta (Win), Ctrl, Alt, Shift. Would you be OK with this as the canonical order of modifiers for |
Yes, we just need to check that We don’t need to change this helper function, just change docs if needed. |
@ai All right, some changes are required in |
Agree. In this case only two steps. |
e67ddd1
to
7b7a589
Compare
Thanks. Released in 0.3. |
MacOS has specific guidelines regarding how hotkey shortcuts should be represented. Most importantly, they should be listed in a specific order (Ctrl, Alt, Shift, Meta), and the plus sign is not used a delimiter:
This PR implements those recommendations.