Skip to content

Commit c08181d

Browse files
committed
Added ctrl-shift-a
1 parent 87742de commit c08181d

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
lines changed

client/modules/IDE/components/Header/Nav.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ const ProjectMenu = () => {
211211
<NavDropdownMenu id="sketch" title={t('Nav.Sketch.Title')}>
212212
<NavMenuItem onClick={() => dispatch(newFile(rootFile.id))}>
213213
{t('Nav.Sketch.AddFile')}
214+
<span className="nav__keyboard-shortcut">
215+
{metaKey}+{'\u21E7'}+A
216+
</span>
214217
</NavMenuItem>
215218
<NavMenuItem onClick={() => dispatch(newFolder(rootFile.id))}>
216219
{t('Nav.Sketch.AddFolder')}

client/modules/IDE/components/Header/__snapshots__/Nav.unit.test.jsx.snap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,11 @@ exports[`Nav renders editor version for desktop 1`] = `
367367
>
368368
<button>
369369
Add File
370+
<span
371+
class="nav__keyboard-shortcut"
372+
>
373+
^+⇧+A
374+
</span>
370375
</button>
371376
</li>
372377
<li

client/modules/IDE/components/IDEKeyHandlers.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import {
88
expandSidebar,
99
showErrorModal,
1010
startSketch,
11-
stopSketch
11+
stopSketch,
12+
newFile
1213
} from '../actions/ide';
1314
import { setAllAccessibleOutput } from '../actions/preferences';
1415
import { cloneProject, saveProject } from '../actions/project';
@@ -66,6 +67,7 @@ export const useIDEKeyHandlers = ({ getContent }) => {
6667
dispatch(setAllAccessibleOutput(false));
6768
},
6869
'ctrl-b': (e) => {
70+
console.log('Ctrl-B Pressed');
6971
e.preventDefault();
7072
dispatch(
7173
// TODO: create actions 'toggleConsole', 'toggleSidebar', etc.
@@ -75,6 +77,11 @@ export const useIDEKeyHandlers = ({ getContent }) => {
7577
'ctrl-`': (e) => {
7678
e.preventDefault();
7779
dispatch(consoleIsExpanded ? collapseConsole() : expandConsole());
80+
},
81+
'ctrl-shift-a': (e) => {
82+
e.preventDefault();
83+
e.stopPropagation();
84+
dispatch(newFile());
7885
}
7986
});
8087
};

client/modules/IDE/components/KeyboardShortcutModal.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ function KeyboardShortcutModal() {
6969
<span className="keyboard-shortcut__command">{metaKeyName} + K</span>
7070
<span>{t('KeyboardShortcuts.CodeEditing.ColorPicker')}</span>
7171
</li>
72+
<li className="keyboard-shortcut-item">
73+
<span className="keyboard-shortcut__command">
74+
{metaKeyName} + {`\u21E7`} + A
75+
</span>
76+
<span>{t('KeyboardShortcuts.CodeEditing.CreateNewFile')}</span>
77+
</li>
7278
</ul>
7379
<h3 className="keyboard-shortcuts__title">General</h3>
7480
<ul className="keyboard-shortcuts__list">

translations/locales/en-US/translations.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@
192192
"FindNextTextMatch": "Find Next Text Match",
193193
"FindPreviousTextMatch": "Find Previous Text Match",
194194
"CodeEditing": "Code Editing",
195-
"ColorPicker": "Show Inline Color Picker"
195+
"ColorPicker": "Show Inline Color Picker",
196+
"CreateNewFile": "Create New File"
196197
},
197198
"General": {
198199
"StartSketch": "Start Sketch",

0 commit comments

Comments
 (0)