Skip to content

Commit

Permalink
Improve keyboard shortcuts order (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhabib committed Feb 29, 2024
1 parent 3890607 commit cb3c427
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-pears-deny.md
@@ -0,0 +1,5 @@
---
'playroom': patch
---

In the Settings Panel, sort keyboard shortcuts order by most frequently and widely used. Related shortcuts are grouped together.
17 changes: 7 additions & 10 deletions src/Playroom/SettingsPanel/SettingsPanel.tsx
Expand Up @@ -24,21 +24,18 @@ const getKeyBindings = () => {
const metaKeySymbol = isMac() ? '⌘' : 'Ctrl';
const altKeySymbol = isMac() ? '⌥' : 'Alt';

// Sort shortcuts alphabetically
/* eslint sort-keys: "error" */
return {
'Add cursor to next line': [metaKeySymbol, altKeySymbol, '↓'],
'Add cursor to prev line': [metaKeySymbol, altKeySymbol, '↑'],
'Duplicate line down': ['⇧', altKeySymbol, '↓'],
'Duplicate line up': ['⇧', altKeySymbol, '↑'],
'Toggle comment': [metaKeySymbol, '/'],
'Wrap selection in tag': [metaKeySymbol, '⇧', ','],
'Format code': [metaKeySymbol, 'S'],
'Select next occurrence': [metaKeySymbol, 'D'],
'Swap line down': [altKeySymbol, '↓'],
'Swap line up': [altKeySymbol, '↑'],
'Toggle comment': [metaKeySymbol, '/'],
'Wrap selection in tag': [metaKeySymbol, '⇧', ','],
'Swap line down': [altKeySymbol, '↓'],
'Duplicate line up': ['⇧', altKeySymbol, '↑'],
'Duplicate line down': ['⇧', altKeySymbol, '↓'],
'Add cursor to prev line': [metaKeySymbol, altKeySymbol, '↑'],
'Add cursor to next line': [metaKeySymbol, altKeySymbol, '↓'],
};
/* eslint-disable sort-keys */
};

const positionIcon: Record<EditorPosition, ReactChild> = {
Expand Down

0 comments on commit cb3c427

Please sign in to comment.