diff --git a/client/common/useKeyDownHandlers.js b/client/common/useKeyDownHandlers.js
index dbe2ee06bb..75c81e1ff9 100644
--- a/client/common/useKeyDownHandlers.js
+++ b/client/common/useKeyDownHandlers.js
@@ -32,15 +32,19 @@ export default function useKeyDownHandlers(keyHandlers) {
if (!e.key) return;
const isMac = navigator.userAgent.toLowerCase().indexOf('mac') !== -1;
const isCtrl = isMac ? e.metaKey : e.ctrlKey;
- if (e.shiftKey && isCtrl) {
+
+ if (isCtrl && e.shiftKey && e.altKey && e.code === 'KeyN') {
+ // specifically for creating a new folder
+ handlers.current[`ctrl-alt-shift-n`]?.(e);
+ } else if (isCtrl && e.altKey && e.code === 'KeyN') {
+ // specifically for creating a new file
+ handlers.current[`ctrl-alt-n`]?.(e);
+ } else if (e.shiftKey && isCtrl) {
handlers.current[
`ctrl-shift-${
/^\d+$/.test(e.code.at(-1)) ? e.code.at(-1) : e.key.toLowerCase()
}`
]?.(e);
- } else if (isCtrl && e.altKey && e.code === 'KeyN') {
- // specifically for creating a new file
- handlers.current[`ctrl-alt-n`]?.(e);
} else if (isCtrl) {
handlers.current[`ctrl-${e.key.toLowerCase()}`]?.(e);
}
diff --git a/client/modules/IDE/components/Header/Nav.jsx b/client/modules/IDE/components/Header/Nav.jsx
index f40e9137bf..de59a4271c 100644
--- a/client/modules/IDE/components/Header/Nav.jsx
+++ b/client/modules/IDE/components/Header/Nav.jsx
@@ -139,6 +139,8 @@ const ProjectMenu = () => {
metaKey === 'Ctrl' ? `${metaKeyName}+H` : `${metaKeyName}+⌥+F`;
const newFileCommand =
metaKey === 'Ctrl' ? `${metaKeyName}+Alt+N` : `${metaKeyName}+⌥+N`;
+ const newFolderCommand =
+ metaKey === 'Ctrl' ? `${metaKeyName}+Alt+Shift+N` : `${metaKeyName}+⌥+⇧+N`;
return (
@@ -230,6 +232,7 @@ const ProjectMenu = () => {
dispatch(newFolder(rootFile.id))}>
{t('Nav.Sketch.AddFolder')}
+ {newFolderCommand}
dispatch(startSketch())}>
{t('Nav.Sketch.Run')}
diff --git a/client/modules/IDE/components/Header/__snapshots__/Nav.unit.test.jsx.snap b/client/modules/IDE/components/Header/__snapshots__/Nav.unit.test.jsx.snap
index 290528582a..c9d160a995 100644
--- a/client/modules/IDE/components/Header/__snapshots__/Nav.unit.test.jsx.snap
+++ b/client/modules/IDE/components/Header/__snapshots__/Nav.unit.test.jsx.snap
@@ -653,6 +653,11 @@ exports[`Nav renders editor version for desktop 1`] = `
role="menuitem"
>
Add Folder
+
+ Ctrl+Alt+Shift+N
+
- {
e.stopPropagation();
dispatch(newFile(rootFile.id));
},
+ 'ctrl-alt-shift-n': (e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ dispatch(newFolder(rootFile.id));
+ },
'ctrl-`': (e) => {
e.preventDefault();
dispatch(consoleIsExpanded ? collapseConsole() : expandConsole());
diff --git a/client/modules/IDE/components/KeyboardShortcutModal.jsx b/client/modules/IDE/components/KeyboardShortcutModal.jsx
index 8d402abad9..00cc92ddce 100644
--- a/client/modules/IDE/components/KeyboardShortcutModal.jsx
+++ b/client/modules/IDE/components/KeyboardShortcutModal.jsx
@@ -8,6 +8,10 @@ function KeyboardShortcutModal() {
metaKey === 'Ctrl' ? `${metaKeyName} + H` : `${metaKeyName} + ⌥ + F`;
const newFileCommand =
metaKey === 'Ctrl' ? `${metaKeyName} + Alt + N` : `${metaKeyName} + ⌥ + N`;
+ const newFolderCommand =
+ metaKey === 'Ctrl'
+ ? `${metaKeyName} + Alt + Shift + N`
+ : `${metaKeyName} + ⌥ + ⇧ + N`;
return (
@@ -75,6 +79,10 @@ function KeyboardShortcutModal() {
{newFileCommand}
{t('KeyboardShortcuts.CodeEditing.CreateNewFile')}
+
-
+ {newFolderCommand}
+ {t('KeyboardShortcuts.CodeEditing.CreateNewFolder')}
+
{t('KeyboardShortcuts.General')}
diff --git a/translations/locales/en-US/translations.json b/translations/locales/en-US/translations.json
index 376c18471c..84922fc914 100644
--- a/translations/locales/en-US/translations.json
+++ b/translations/locales/en-US/translations.json
@@ -249,7 +249,8 @@
"FindPreviousTextMatch": "Find Previous Text Match",
"CodeEditing": "Code Editing",
"ColorPicker": "Show Inline Color Picker",
- "CreateNewFile": "Create New File"
+ "CreateNewFile": "Create New File",
+ "CreateNewFolder": "Create New Folder"
},
"General": "General",
"GeneralSelection": {