Skip to content
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

Dynamic label for toggle sidebar element in keyboard shortcuts #16218

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/application-extension/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,14 @@ const mainCommands: JupyterFrontEndPlugin<void> = {
});

commands.addCommand(CommandIDs.toggleSidebarWidget, {
label: trans.__('Toggle Sidebar Element'),
label: args =>
args === undefined ||
args.side === undefined ||
args.index === undefined
? trans.__('Toggle Sidebar Element')
: args.side === 'right'
? trans.__('Toggle Element %1 in Right Sidebar', args.index)
: trans.__('Toggle Element %1 in Left Sidebar', args.index),
itsmevichu marked this conversation as resolved.
Show resolved Hide resolved
execute: args => {
const index = parseInt(args.index as string, 10);
if (args.side != 'left' && args.side != 'right') {
Expand Down