Skip to content

Commit 5cb67ea

Browse files
authored
Add 'New JupyterCAD file' option to context menu (#634) (#737)
1 parent a4b21cc commit 5cb67ea

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

python/jupytercad_core/src/jcadplugin/plugins.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const activate = (
126126
});
127127

128128
app.commands.addCommand(CommandIDs.createNew, {
129-
label: args => 'CAD File',
129+
label: args => (args['label'] as string) ?? 'CAD file',
130130
caption: 'Create a new JCAD Editor',
131131
icon: logoIcon,
132132
execute: async args => {
@@ -180,6 +180,14 @@ const activate = (
180180
});
181181
}
182182
}
183+
184+
// Inject “New JupyterCAD file” into the File Browser context menu
185+
app.contextMenu.addItem({
186+
command: CommandIDs.createNew,
187+
selector: '.jp-DirListing',
188+
rank: 55,
189+
args: { label: 'New JupyterCAD file' }
190+
});
183191
};
184192

185193
const jcadPlugin: JupyterFrontEndPlugin<void> = {

0 commit comments

Comments
 (0)