From 092956b3791d37a9a8d8dd941bb329fa248a9f7e Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Tue, 1 Dec 2015 18:31:12 -0800 Subject: [PATCH] feat(keybindings): Show all keybindings in prefs --- .../lib/tabs/preferences-keymaps.cjsx | 128 ++++++++++++++---- .../preferences/stylesheets/preferences.less | 55 ++++++-- keymaps/templates/Gmail.cson | 4 - static/type.less | 5 +- static/variables/ui-variables.less | 2 +- 5 files changed, 149 insertions(+), 45 deletions(-) diff --git a/internal_packages/preferences/lib/tabs/preferences-keymaps.cjsx b/internal_packages/preferences/lib/tabs/preferences-keymaps.cjsx index 85fbd8545..aeb960241 100644 --- a/internal_packages/preferences/lib/tabs/preferences-keymaps.cjsx +++ b/internal_packages/preferences/lib/tabs/preferences-keymaps.cjsx @@ -5,14 +5,63 @@ fs = require 'fs' {RetinaImg, Flexbox} = require 'nylas-component-kit' DisplayedKeybindings = [ - ['application:new-message', 'New Message'], - ['application:reply', 'Reply'], - ['application:reply-all', 'Reply All'], - ['application:forward', 'Forward'], - ['application:focus-search', 'Search'], - ['application:change-category', 'Change Folder / Labels'], - ['core:select-item', 'Select Focused Item'], - ['application:star-item', 'Star Focused Item'], + { + title: 'Application', + items: [ + ['application:new-message', 'New Message'], + ['application:focus-search', 'Search'], + ] + }, + { + title: 'Actions', + items: [ + ['application:reply', 'Reply'], + ['application:reply-all', 'Reply All'], + ['application:forward', 'Forward'], + ['application:archive-item', 'Archive'], + ['application:delete-item', 'Trash'], + ['core:remove-from-view', 'Remove from view'], + ['application:star-item', 'Star'], + ['application:change-category', 'Change Folder / Labels'], + ['application:mark-as-read', 'Mark as read'], + ['application:mark-as-unread', 'Mark as unread'], + ['application:mark-important', 'Mark as important (Gmail)'], + ['application:mark-unimportant', 'Mark as unimportant (Gmail)'], + ['application:remove-and-previous', 'Remove from view and previous'], + ['application:remove-and-next', 'Remove from view and next'], + ] + }, + { + title: 'Navigation', + items: [ + ['application:pop-sheet', 'Return to conversation list'], + ['core:focus-item', 'Open selected conversation'], + ['core:previous-item', 'Move to newer conversation'], + ['core:next-item', 'Move to older conversation'], + ] + }, + { + title: 'Selection', + items: [ + ['core:select-item', 'Select conversation'], + ['multiselect-list:select-all', 'Select all conversations'], + ['multiselect-list:deselect-all', 'Deselect all conversations'], + ['thread-list:select-read', 'Select all read conversations'], + ['thread-list:select-unread', 'Select all unread conversations'], + ['thread-list:select-starred', 'Select all starred conversations'], + ['thread-list:select-unstarred', 'Select all unstarred conversations'], + ] + }, + { + title: 'Jumping', + items: [ + ['navigation:go-to-inbox', 'Go to "Inbox"'], + ['navigation:go-to-starred', 'Go to "Starred"'], + ['navigation:go-to-sent', 'Go to "Sent Mail"'], + ['navigation:go-to-drafts', 'Go to "Drafts"'], + ['navigation:go-to-all', 'Go to "All Mail"'], + ] + } ] class PreferencesKeymaps extends React.Component @@ -43,17 +92,18 @@ class PreferencesKeymaps extends React.Component _getStateFromKeymaps: => bindings = {} - for [command, label] in DisplayedKeybindings - bindings[command] = NylasEnv.keymaps.findKeyBindings(command: command, target: document.body) || [] + for section in DisplayedKeybindings + for [command, label] in section.items + bindings[command] = NylasEnv.keymaps.findKeyBindings(command: command, target: document.body) || [] bindings render: =>

Shortcuts

- -
Keyboard shortcut set:
-
+ +
Keyboard shortcut set:
+