-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Handle mnemonic escaping #68196
Handle mnemonic escaping #68196
Conversation
@bpasero ping |
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.
@sbatten I am confused by the new (?) notion of &&&
to present a literal &
in the menu labels. I would prefer a solution that is consistent with our current approach where &&
is a mnemonic and &
is the literal &
. Otherwise we have competing notations for buttons vs menus.
See for example #64999 for a discussion around this for extensions.
@bpasero Electron's methodology is && => & and & => mnemonic. Our current menus do not have a method of presenting & literally. The &&& was a way to get us to a working state where we could escape mnemonics, but ideally we would eventually move all our commands to use & and &&. We supported & in menus for mnemonics as well because localizations were using this and it was getting sent to Electron that way and handled as a mnemonic. |
@sbatten I just checked how the old menu used to be and found e.g. this: https://github.com/Microsoft/vscode/blob/1.20.1/src/vs/code/electron-main/menus.ts#L382 which seems to indicate to me that for translations we always said that Can we get to a solution where |
@bpasero please verify on macOS |
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.
Much better, some comments.
@@ -383,7 +383,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, { | |||
group: '2_reference', | |||
command: { | |||
id: 'workbench.action.openTipsAndTricksUrl', | |||
title: nls.localize({ key: 'miTipsAndTricks', comment: ['&& denotes a mnemonic'] }, "Tips and Tri&&cks") | |||
title: nls.localize({ key: 'miTipsAndTricks', comment: ['&& denotes a mnemonic'] }, "Tips &&& Tri&&cks") |
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.
@sbatten should this be &
instead of &&&
?
src/vs/base/browser/ui/menu/menu.ts
Outdated
@@ -767,6 +770,10 @@ class MenuSeparatorActionItem extends ActionItem { | |||
} | |||
} | |||
|
|||
/** |
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.
@sbatten is this something you still work on? The TODO I mean.
* handle mnemonic escapes * Update src/vs/workbench/electron-browser/main.contribution.ts * update custom menu and recent items list to support escaped mnemonics * remove need for &&& * qfix
fixes #61139
replaces #66761