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

Change number of icons in notebook toolbar #4747

Merged
merged 4 commits into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/1 Enhancements/4730.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Minimize number of icons on the notebook toolbar (put the rest in overflow).
35 changes: 16 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,10 @@
"command": "jupyter.notebookeditor.interruptkernel",
"title": "%jupyter.command.jupyter.interruptkernel.title%",
"category": "Notebook",
"icon": "$(primitive-square)",
"icon": {
"light": "resources/light/interrupt.svg",
"dark": "resources/dark/interrupt.svg"
},
"enablement": "notebookViewType == 'jupyter-notebook' && jupyter.isnotebooktrusted && jupyter.notebookeditor.canInterruptNotebookKernel"
},
{
Expand Down Expand Up @@ -785,55 +788,49 @@
{
"command": "jupyter.notebookeditor.runallcellsabove",
"title": "%DataScience.runAbove%",
"group": "navigation@1",
"group": "overflow@1",
"when": "notebookViewType == 'jupyter-notebook'"
},
{
"command": "jupyter.notebookeditor.runcellandallbelow",
"title": "%DataScience.runBelow%",
"group": "navigation@2",
"group": "overflow@2",
"when": "notebookViewType == 'jupyter-notebook'"
},
{
"command": "jupyter.notebookeditor.restartkernel",
"title": "%jupyter.command.jupyter.restartkernel.title%",
"group": "navigation@3",
"when": "notebookViewType == 'jupyter-notebook'"
"group": "navigation@1",
"when": "notebookViewType == 'jupyter-notebook' && jupyter.notebookeditor.canrestartNotebookkernel && !jupyter.notebookeditor.canInterruptNotebookKernel"
},
{
"command": "jupyter.notebookeditor.interruptkernel",
"title": "%jupyter.command.jupyter.interruptkernel.title%",
"group": "navigation@4",
"when": "notebookViewType == 'jupyter-notebook'"
"group": "navigation@1",
"when": "notebookViewType == 'jupyter-notebook' && jupyter.notebookeditor.canInterruptNotebookKernel"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe jupyter.isnotebooktrusted on interrupt / restart as well? Obviously it should be covered by canrestart or canInterrupt, but provides an extra degree of safety just in case we have a bug with those other contexts so that we don't accidentally enable something when not trusted. Surprised we didn't have the trusted check already.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually they already have the enablements in commands sections? That's odd, which version wins if they are different? I'd assume the more specific one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The more specific one

I didn't want to disable the command in the command palette

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So is runallcellsabove enabled when not trusted then? Looks like our more specific version here for the editor doesn't have the trusted check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's there but disabled.

},
{
"command": "jupyter.openVariableView",
"title": "%jupyter.command.jupyter.openVariableView.title%",
"group": "navigation@5",
"when": "notebookViewType == 'jupyter-notebook'"
"group": "navigation@2",
"when": "notebookViewType == 'jupyter-notebook' && jupyter.isnotebooktrusted"
},
{
"command": "jupyter.notebookeditor.export",
"title": "%DataScience.notebookExportAs%",
"group": "navigation@6",
"when": "notebookViewType == 'jupyter-notebook'"
"group": "navigation@3",
"when": "notebookViewType == 'jupyter-notebook' && jupyter.isnotebooktrusted"
},
{
"command": "jupyter.notebookeditor.trust",
"title": "%DataScience.trustNotebookCommandTitle%",
"group": "navigation@999",
"group": "navigation@1",
"when": "notebookViewType == 'jupyter-notebook' && !jupyter.isnotebooktrusted && jupyter.trustfeatureenabled"
},
{
"command": "jupyter.notebookeditor.trusted",
"title": "%DataScience.notebookIsTrusted%",
"group": "navigation@999",
"when": "notebookViewType == 'jupyter-notebook' && jupyter.isnotebooktrusted && jupyter.trustfeatureenabled"
},
{
"command": "jupyter.selectNativeJupyterUriFromToolBar",
"title": "%jupyter.command.jupyter.selectjupyteruri.title%",
"group": "navigation@1000",
"group": "overflow@1000",
"when": "notebookViewType == 'jupyter-notebook'"
}
],
Expand Down
3 changes: 3 additions & 0 deletions resources/dark/interrupt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions resources/light/interrupt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.