File tree Expand file tree Collapse file tree 4 files changed +35
-0
lines changed
packages/notebook-extension Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 33 "description" : " Jupyter Notebook Menu Entries" ,
44 "jupyter.lab.menus" : {
55 "main" : [
6+ {
7+ "id" : " jp-mainmenu-file" ,
8+ "items" : [
9+ {
10+ "command" : " notebook:open-tree-tab" ,
11+ "rank" : 1
12+ }
13+ ]
14+ },
615 {
716 "id" : " jp-mainmenu-edit" ,
817 "items" : [
Original file line number Diff line number Diff line change @@ -177,6 +177,31 @@ const closeTab: JupyterFrontEndPlugin<void> = {
177177 } ,
178178} ;
179179
180+ /**
181+ * Add a command to open the tree view from the notebook view
182+ */
183+ const openTreeTab : JupyterFrontEndPlugin < void > = {
184+ id : '@jupyter-notebook/notebook-extension:open-tree-tab' ,
185+ description :
186+ 'Add a command to open a browser tab on the tree view when clicking "Open...".' ,
187+ autoStart : true ,
188+ optional : [ ITranslator ] ,
189+ activate : ( app : JupyterFrontEnd , translator : ITranslator | null ) => {
190+ const { commands } = app ;
191+ translator = translator ?? nullTranslator ;
192+ const trans = translator . load ( 'notebook' ) ;
193+
194+ const id = 'notebook:open-tree-tab' ;
195+ commands . addCommand ( id , {
196+ label : trans . __ ( 'Open…' ) ,
197+ execute : async ( ) => {
198+ const url = URLExt . join ( PageConfig . getBaseUrl ( ) , 'tree' ) ;
199+ window . open ( url ) ;
200+ } ,
201+ } ) ;
202+ } ,
203+ } ;
204+
180205/**
181206 * The kernel logo plugin.
182207 */
@@ -570,6 +595,7 @@ const editNotebookMetadata: JupyterFrontEndPlugin<void> = {
570595const plugins : JupyterFrontEndPlugin < any > [ ] = [
571596 checkpoints ,
572597 closeTab ,
598+ openTreeTab ,
573599 editNotebookMetadata ,
574600 kernelLogo ,
575601 kernelStatus ,
You can’t perform that action at this time.
0 commit comments