File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 7171 "command" : " drives:create-new-notebook" ,
7272 "selector" : " .jp-DirListing-content" ,
7373 "rank" : 54
74+ },
75+ {
76+ "command" : " filebrowser:rename" ,
77+ "selector" : " .jp-DirListing-item[data-isdir]" ,
78+ "rank" : 5 ,
79+ "disabled" : true
80+ },
81+ {
82+ "command" : " drives:rename" ,
83+ "selector" : " .jp-DirListing-item[data-isdir]" ,
84+ "rank" : 5
7485 }
7586 ]
7687 },
95106 "default" : []
96107 }
97108 },
109+ "jupyter.lab.shortcuts" : [
110+ {
111+ "command" : " drives:rename" ,
112+ "keys" : [" F2" ],
113+ "selector" : " .jp-DirListing-content .jp-DirListing-itemText"
114+ }
115+ ],
98116 "additionalProperties" : false ,
99117 "definitions" : {
100118 "toolbarItem" : {
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ import {
2525 IScore ,
2626 newFolderIcon ,
2727 fileIcon ,
28- notebookIcon
28+ notebookIcon ,
29+ editIcon
2930} from '@jupyterlab/ui-components' ;
3031import { CommandRegistry } from '@lumino/commands' ;
3132import { Widget } from '@lumino/widgets' ;
@@ -413,5 +414,16 @@ namespace Private {
413414 icon : notebookIcon . bindprops ( { stylesheet : 'menuItem' } ) ,
414415 label : 'New Notebook'
415416 } ) ;
417+
418+ app . commands . addCommand ( CommandIDs . rename , {
419+ isEnabled : ( ) => {
420+ return browser . model . path !== 's3:' ;
421+ } ,
422+ execute : ( ) => {
423+ app . commands . execute ( 'filebrowser:rename' ) ;
424+ } ,
425+ icon : editIcon . bindprops ( { stylesheet : 'menuItem' } ) ,
426+ label : 'Rename'
427+ } ) ;
416428 }
417429}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export namespace CommandIDs {
1313 export const createNewDirectory = 'drives:create-new-directory' ;
1414 export const createNewFile = 'drives:create-new-file' ;
1515 export const createNewNotebook = 'drives:create-new-notebook' ;
16+ export const rename = 'drives:rename' ;
1617}
1718
1819/**
You can’t perform that action at this time.
0 commit comments