Mailspring/keymaps/base.cson

200 lines
4.3 KiB
Plaintext
Raw Normal View History

# Email-specific core key-mappings
#
# There are additional mappings in <platform>.cson files that bind
# menu items. In the future, we should break these into files like:
# darwin-gmail.cson, darwin-macmail.cson, win32-gmail.cson...
'body':
'escape' : 'application:pop-sheet'
'cmd-,' : 'application:open-preferences'
'up' : 'core:previous-item'
'down' : 'core:next-item'
'backspace': 'core:remove-item'
feat(thread-list): Multiple selection, bulk actions, refactoring Summary: This diff provides multi-selection in the thread list powered by a new ModelList component that implements selection on top of ListTabular (or soon another List component). It includes business logic for single selection, shift selection, command-click selection, etc. This diff also improves the performance of DatabaseView by assessing whether updates are required based on specific database changes and skipping queries in many scenarios. WIP WIP Move selection into modelView instead of store WIP Preparing to convert to ModelList mixin Make ThreadStore => ThreadListStore Break the DraftStore in two (new DraftListStore) to avoid keeping all drafts in all windows Get rid of unread instance variable in favor of getter that falls through to isUnread() Much smarter logic in DatabaseView to prevent needless queries (especially counts and full invalidation of retained range) Squashed commit of the following: commit 486516b540e659735675765ca8b20d8a107ee2a9 Author: Ben Gotow <bengotow@gmail.com> Date: Tue Apr 7 17:30:23 2015 -0700 Invalidate the retained range debounced commit 7ac80403f52d108696c555f79c4c687d969f0228 Author: Ben Gotow <bengotow@gmail.com> Date: Tue Apr 7 17:30:16 2015 -0700 Wait until after the view updates to move focus commit 88d66eb19a9710847ff98bea22045bb686f30cc6 Author: Ben Gotow <bengotow@gmail.com> Date: Tue Apr 7 17:28:01 2015 -0700 Bail out early when loading data if a reload has been requested commit a49bedc44687040f7c675ff298376917a0b5fdcb Author: Ben Gotow <bengotow@gmail.com> Date: Tue Apr 7 16:38:58 2015 -0700 Log query data when in a query is being logged commit c64a9e02f9072fd30edb98c45be581d6ac00c48a Author: Ben Gotow <bengotow@gmail.com> Date: Tue Apr 7 16:38:45 2015 -0700 Mark thread and messages as read in parallel instead of in sequence commit 4b227100a795e20257cda0d60b00cc75b0000b0f Author: Ben Gotow <bengotow@gmail.com> Date: Tue Apr 7 16:38:32 2015 -0700 Don't load tags with hardcoded IDs from the database, and load them in parallel instead of in sequence commit aeb7f1d646786cfa1c247fe78ce5467da07c4446 Author: Ben Gotow <bengotow@gmail.com> Date: Tue Apr 7 16:37:54 2015 -0700 Pass objects instead of ids to thread methods—since we always have the most current thread anyway, this makes things a bit faster commit e70889d1d05ece81a081b8b3f27b62491429b6f9 Author: Ben Gotow <bengotow@gmail.com> Date: Mon Apr 6 16:41:49 2015 -0700 [icon] Paper airplanes Restyle account sidebar, optimize tag count queries a bit more Fix initialization issue with webkit image mask Can't compare dates with is/isnt Assets for check boxes Bug fixes Wrap ModelList instead of providing props Verbose mode for database view Fix existing specs Six new specs covering invalidateIfItemsInconsistent Test Plan: Run 40+ new tests Reviewers: evan Reviewed By: evan Differential Revision: https://review.inboxapp.com/D1410
2015-04-09 10:25:00 +08:00
'enter' : 'core:focus-item'
# Default cross-platform core behaviors
'left': 'core:move-left'
'right': 'core:move-right'
'shift-up': 'core:select-up'
'shift-down': 'core:select-down'
'shift-left': 'core:select-left'
'shift-right': 'core:select-right'
'shift-pageup': 'core:select-page-up'
'shift-pagedown': 'core:select-page-down'
'delete': 'core:delete'
'shift-delete': 'core:cut'
# Inputs are native by default.
# Also make sure not to catch anything intended for a webview
'body input, body textarea, body *[contenteditable], body webview':
'up': 'native!'
'left': 'native!'
'down': 'native!'
'right': 'native!'
'cmd-up': 'native!'
'cmd-left': 'native!'
'cmd-down': 'native!'
'cmd-right': 'native!'
'ctrl-up': 'native!'
'ctrl-left': 'native!'
'ctrl-down': 'native!'
'ctrl-right': 'native!'
2015-02-07 07:57:03 +08:00
'shift-up': 'native!'
'shift-left': 'native!'
'shift-down': 'native!'
'shift-right': 'native!'
'escape': 'native!'
'pageup': 'native!'
'pagedown': 'native!'
'shift-pageup': 'native!'
'shift-pagedown': 'native!'
'enter': 'native!'
'cmd-enter': 'native!'
'ctrl-enter': 'native!'
'shift-enter': 'native!'
fix(drafts): Various improvements and fixes to drafts, draft state management Summary: This diff contains a few major changes: 1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario: - View thread with draft, edit draft - Move to another thread - Move back to thread with draft - Move to another thread. Notice that one or more messages from thread with draft are still there. There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great. 2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here: - In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI. - Previously, when you added a contact to To/CC/BCC, this happened: <input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state. To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source! This diff includes a few minor fixes as well: 1. Draft.state is gone—use Message.object = draft instead 2. String model attributes should never be null 3. Pre-send checks that can cancel draft send 4. Put the entire curl history and task queue into feedback reports 5. Cache localIds for extra speed 6. Move us up to latest React Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet Reviewers: evan Reviewed By: evan Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
'backspace': 'native!'
'shift-backspace': 'native!'
'delete': 'native!'
'shift-delete': 'native!'
'cmd-y': 'native!'
fix(drafts): Various improvements and fixes to drafts, draft state management Summary: This diff contains a few major changes: 1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario: - View thread with draft, edit draft - Move to another thread - Move back to thread with draft - Move to another thread. Notice that one or more messages from thread with draft are still there. There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great. 2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here: - In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI. - Previously, when you added a contact to To/CC/BCC, this happened: <input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state. To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source! This diff includes a few minor fixes as well: 1. Draft.state is gone—use Message.object = draft instead 2. String model attributes should never be null 3. Pre-send checks that can cancel draft send 4. Put the entire curl history and task queue into feedback reports 5. Cache localIds for extra speed 6. Move us up to latest React Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet Reviewers: evan Reviewed By: evan Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
'cmd-z': 'native!'
'cmd-Z': 'native!'
'cmd-x': 'native!'
'cmd-X': 'native!'
'cmd-c': 'native!'
'cmd-C': 'native!'
'cmd-v': 'native!'
'cmd-V': 'native!'
'cmd-a': 'native!'
'cmd-A': 'native!'
'cmd-b': 'native!'
'cmd-i': 'native!'
'cmd-u': 'native!'
'ctrl-y': 'native!'
fix(drafts): Various improvements and fixes to drafts, draft state management Summary: This diff contains a few major changes: 1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario: - View thread with draft, edit draft - Move to another thread - Move back to thread with draft - Move to another thread. Notice that one or more messages from thread with draft are still there. There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great. 2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here: - In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI. - Previously, when you added a contact to To/CC/BCC, this happened: <input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state. To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source! This diff includes a few minor fixes as well: 1. Draft.state is gone—use Message.object = draft instead 2. String model attributes should never be null 3. Pre-send checks that can cancel draft send 4. Put the entire curl history and task queue into feedback reports 5. Cache localIds for extra speed 6. Move us up to latest React Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet Reviewers: evan Reviewed By: evan Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
'ctrl-z': 'native!'
'ctrl-Z': 'native!'
'ctrl-x': 'native!'
'ctrl-X': 'native!'
'ctrl-c': 'native!'
'ctrl-C': 'native!'
'ctrl-v': 'native!'
'ctrl-V': 'native!'
'ctrl-a': 'native!'
'ctrl-A': 'native!'
'ctrl-b': 'native!'
'ctrl-i': 'native!'
'ctrl-u': 'native!'
'a': 'native!'
'b': 'native!'
'c': 'native!'
'd': 'native!'
'e': 'native!'
'f': 'native!'
'g': 'native!'
'h': 'native!'
'i': 'native!'
'j': 'native!'
'k': 'native!'
'l': 'native!'
'm': 'native!'
'n': 'native!'
'o': 'native!'
'p': 'native!'
'q': 'native!'
'r': 'native!'
's': 'native!'
't': 'native!'
'u': 'native!'
'v': 'native!'
'w': 'native!'
'x': 'native!'
'y': 'native!'
'z': 'native!'
'A': 'native!'
'B': 'native!'
'C': 'native!'
'D': 'native!'
'E': 'native!'
'F': 'native!'
'G': 'native!'
'H': 'native!'
'I': 'native!'
'J': 'native!'
'K': 'native!'
'L': 'native!'
'M': 'native!'
'N': 'native!'
'O': 'native!'
'P': 'native!'
'Q': 'native!'
'R': 'native!'
'S': 'native!'
'T': 'native!'
'U': 'native!'
'V': 'native!'
'W': 'native!'
'X': 'native!'
'Y': 'native!'
'Z': 'native!'
'1': 'native!'
'2': 'native!'
'3': 'native!'
'4': 'native!'
'5': 'native!'
'6': 'native!'
'7': 'native!'
'8': 'native!'
'9': 'native!'
'0': 'native!'
'~': 'native!'
'!': 'native!'
'@': 'native!'
'#': 'native!'
'$': 'native!'
'%': 'native!'
'^': 'native!'
'&': 'native!'
'*': 'native!'
'(': 'native!'
')': 'native!'
'-': 'native!'
'_': 'native!'
'=': 'native!'
'+': 'native!'
'[': 'native!'
'{': 'native!'
']': 'native!'
'}': 'native!'
'\\': 'native!'
'|': 'native!'
';': 'native!'
':': 'native!'
'\'': 'native!'
'"': 'native!'
'<': 'native!'
',': 'native!'
'>': 'native!'
'.': 'native!'
'?': 'native!'
'/': 'native!'
'body input, body textarea':
'tab': 'core:focus-next'
'shift-tab': 'core:focus-previous'
'body webview':
'tab': 'native!'
'shift-tab': 'native!'
# So our contenteditable control can do its own thing
'body *[contenteditable]':
'tab': 'native!'
'shift-tab': 'native!'
# For menus
'body .menu, body .menu, body .menu input':
# and by "native!" I actually mean for it to just let React deal with
# it.
'tab': 'native!'
'shift-tab': 'native!'