-
Notifications
You must be signed in to change notification settings - Fork 897
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
Make Cmd left/right go back/forward #6466
Changes from 1 commit
aeffacb
a32e332
98d8e39
aa69384
7a81b13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1021,10 +1021,14 @@ export function addKeyboardShortcutToActionTitle(actionTitle, shortcut) { | |
|
||
/** | ||
* @param {string} localizedActionTitle | ||
* @param {string} unlocalizedShortcut | ||
* @param {string|string[]} sometimesManyUnlocalizedShortcuts | ||
* @returns {string} the localized action title with keyboard shortcut | ||
*/ | ||
export function localizeAndAddKeyboardShortcutToActionTitle(localizedActionTitle, unlocalizedShortcut) { | ||
const localizedShortcut = getLocalizedShortcut(unlocalizedShortcut) | ||
return addKeyboardShortcutToActionTitle(localizedActionTitle, localizedShortcut) | ||
export function localizeAndAddKeyboardShortcutToActionTitle(localizedActionTitle, sometimesManyUnlocalizedShortcuts) { | ||
let unlocalizedShortcuts = sometimesManyUnlocalizedShortcuts | ||
if (!Array.isArray(sometimesManyUnlocalizedShortcuts)) { | ||
unlocalizedShortcuts = [unlocalizedShortcuts] | ||
} | ||
const localizedShortcuts = unlocalizedShortcuts.map((s) => getLocalizedShortcut(s)) | ||
return addKeyboardShortcutToActionTitle(localizedActionTitle, localizedShortcuts.join('/')) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (blocking): I think we should localize this like we do here for the plus sign. This is the best quick source I could find, but I think it's apparent enough that some languages do this differently:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1146,6 +1146,8 @@ KeyboardShortcutPrompt: | |
Show Keyboard Shortcuts: Show keyboard shortcuts | ||
History Backward: Go back one page | ||
History Forward: Go forward one page | ||
History Backward (Mac only): Go back one page (Mac only) | ||
History Forward (Mac only): Go forward one page (Mac only) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As these new strings are no longer used please remove them. |
||
New Window: Create a new window | ||
Navigate to Settings: Navigate to the Settings page | ||
Navigate to History: Navigate to the History page | ||
|
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.
suggestion (non-blocking): I'm curious if showing a non-monospace slash character joining the different alts would be more elegant than separate entries for alts. I was thinking about storing alts by storing the shortcut constant as
A|B
, which is then parsed intoA<span>/</span>B
, where we can then apply a separate styling rule (no monospace) to the nestedspan
s. But that would need some special logic in the caller as well for Mac-only additional shortcut cases like this one, or a separate character for representing non-Mac and Mac-exclusive shortcut alts (e.g.,┛A|┗B|C|D
for Windows/Mac-specific alt A, Mac-specific alt B, and universal alts C and D).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.
Way too complicated to understand
Left for another PR at least -_-
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.
Sounds good - this will currently be the only action with two displayed shortcuts we have in the modal (I excluded the dupe alt shortcuts in the original PR), so I suggest we move to a more elegant solution when we want to add more of 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.
As this extra shortcut is only displayed to MacOS users, do we really need to specify in the text that it is macOS only? It also uses the command key which doesn't exist on Windows or Linux, so it seems unlikely that someone would try to use it on Windows or Linux anyway if they happen to use macOS + Windows or Linux.
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.
The best way is to have 1 action to N shortcut(s)
Not sure how to do that yet...
Let me take a look
~_~
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't you just have two mappings that use the same title, the Map uses the shortcuts as the key, so it should work? That way it'll still be displayed as two separate lines/rows but with different shortcuts.
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.
Updated
Also in PR description