diff --git a/internal_packages/preferences/lib/tabs/keymaps/displayed-keybindings.js b/internal_packages/preferences/lib/tabs/keymaps/displayed-keybindings.js index d34fabfd6..967565d3c 100644 --- a/internal_packages/preferences/lib/tabs/keymaps/displayed-keybindings.js +++ b/internal_packages/preferences/lib/tabs/keymaps/displayed-keybindings.js @@ -17,6 +17,7 @@ module.exports = [ ['core:remove-from-view', 'Remove from view'], ['core:gmail-remove-from-view', 'Gmail Remove from view'], ['core:star-item', 'Star'], + ['core:snooze-item', 'Snooze'], ['core:change-category', 'Change Folder / Labels'], ['core:mark-as-read', 'Mark as read'], ['core:mark-as-unread', 'Mark as unread'], diff --git a/internal_packages/thread-list/lib/thread-list.cjsx b/internal_packages/thread-list/lib/thread-list.cjsx index f1b89b754..69ddd0e7b 100644 --- a/internal_packages/thread-list/lib/thread-list.cjsx +++ b/internal_packages/thread-list/lib/thread-list.cjsx @@ -65,6 +65,7 @@ class ThreadList extends React.Component 'core:archive-item': @_onArchiveItem 'core:delete-item': @_onDeleteItem 'core:star-item': @_onStarItem + 'core:snooze-item': @_onSnoozeItem 'core:mark-important': => @_onSetImportant(true) 'core:mark-unimportant': => @_onSetImportant(false) 'core:mark-as-unread': => @_onSetUnread(true) @@ -223,6 +224,21 @@ class ThreadList extends React.Component task = TaskFactory.taskForInvertingStarred({threads}) Actions.queueTask(task) + _onSnoozeItem: => + threads = @_threadsForKeyboardAction() + return unless threads + # TODO this should be grabbed from elsewhere + SnoozePopover = require('../../thread-snooze/lib/snooze-popover').default + + element = document.querySelector(".snooze-button.btn.btn-toolbar") + return unless element + originRect = element.getBoundingClientRect() + Actions.openPopover( + , + {originRect, direction: 'down'} + ) + _onSetImportant: (important) => threads = @_threadsForKeyboardAction() return unless threads diff --git a/keymaps/base.json b/keymaps/base.json index e7ce9a675..1763af7d2 100644 --- a/keymaps/base.json +++ b/keymaps/base.json @@ -20,6 +20,7 @@ "window:close": "mod+w", + "core:snooze-item": "z", "core:print-thread": "mod+p", "core:focus-item": "enter", "core:remove-from-view": ["backspace", "del"],