Commit graph

77 commits

Author SHA1 Message Date
Jackie Luo 96b947b8d9 feat(snooze): Add command for keyboard shortcut
Test Plan: Tested locally.

Reviewers: bengotow, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3008
2016-06-07 10:29:52 -07:00
Ben Gotow 182b8fe37e fix(shortcuts): Add Cmd+[, Cmd+] to Apple Mail preset #1332 2016-05-09 17:34:59 -07:00
Ben Gotow 18262d043b fix(menus): Always show main win in menu, move Activity #1314 2016-05-09 17:28:52 -07:00
Ben Gotow c4b5b4b779 fix(prefs): ? shortcut for "Show Keybindings" #1144 2016-05-09 17:28:52 -07:00
Ben Gotow 8d9d979abc feat(keymaps): Edit your keymaps from preferences 2016-05-05 17:05:51 -07:00
Ben Gotow 2bd2965acf fix(keymaps): "Delete" => "Del" to fix keycode 46 2016-05-04 09:29:42 -07:00
Ben Gotow e9a898c869 fix(undo): Don't create separate commands, since they bubble separately 2016-04-29 17:10:17 -07:00
Ben Gotow 097aa979be fix(keymaps): Use correct combo for paste+match style #2088 2016-04-28 12:45:29 -07:00
Ben Gotow a270234f6d fix(keymaps): Restore missing bindings, handle single keys inside of email frames 2016-04-27 15:20:06 -07:00
Ben Gotow 01fb81ff4e fix(keymaps): function kys to lowercase, - to + 2016-04-27 13:33:26 -07:00
Ben Gotow a48ddd51f8 refactor(menus): Major prune of keymaps/commands, real conditional menus
Summary:
Keymaps & menus CSON => JSON, remove AtomKeymaps, CommandRegistry use of CSS selectors, use Mousetrap instead

Important Notes:

- The `application:` prefix is reserved for commands which are handled in the application process. Don't use it for other things. You will not receive the events in the window.

- Maintaining dynamic menus seems to come with quite an overhead, because Electron updates the entire menu every time. In the future, we'll need https://github.com/electron/electron/issues/528 to really make things nice. I will be tracking this upstream.

- The format for keyboard shortcuts has changed. `cmd-X` is now `command+shift+x`

Test Plan: Run tests

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2917
2016-04-24 12:16:25 -05:00
Evan Morikawa f1d3638bc2 fix(win): load config earlier 2016-04-22 14:57:33 -07:00
Ben Gotow 880dada861 fix(Inbox): Allow shift-J, shift-K to select threads 2016-04-14 17:36:51 -04:00
Ben Gotow 7dee437e61 fix(Gmail): Allow shift-J, shift-K to select threads 2016-04-14 17:08:46 -04:00
Ben Gotow b4434f6617 fix(focus): Remove focusedField in favor of imperative focus, break apart ComposerView
Summary:
- Removes controlled focus in the composer!
  - No React components ever perfom focus in lifecycle methods. Never again.
  - A new `Utils.schedule({action, after, timeout})` helper makes it easy to say "setState or load draft, etc. and then focus"
  - The DraftStore issues a focusDraft action after creating a draft, which causes the MessageList to focus and scroll to the desired composer, which itself decides which field to focus.
  - The MessageList never focuses anything automatically.
- Refactors ComposerView apart — ComposerHeader handles all top fields, DraftSessionContainer handles draft session initialization and exposes props to ComposerView
  - ComposerHeader now uses a KeyCommandRegion (with focusIn and focusOut) to do the expanding and collapsing of the participants fields. May rename that container very soon.
- Removes all CommandRegistry handling of tab and shift-tab. Unless you preventDefault, the browser does it's thing.
- Removes all tabIndexes greater than 1. This is an anti-pattern—assigning everything a tabIndex of 0 tells the browser to move between them based on their order in the DOM, and is almost always what you want.
- Adds "TabGroupRegion" which allows you to create a tab/shift-tabbing group, (so tabbing does not leave the active composer). Can't believe this isn't a browser feature.

Todos:
- Occasionally, clicking out of the composer contenteditable requires two clicks. This is because atomicEdit is restoring selection within the contenteditable and breaking blur.
- Because the ComposerView does not render until it has a draft, we're back to it being white in popout composers for a brief moment. We will fix this another way - all the "return unless draft" statements were untenable.
- Clicking a row in the thread list no longer shifts focus to the message list and focuses the last draft. This will be restored soon.

Test Plan: Broken

Reviewers: juan, evan

Reviewed By: juan, evan

Differential Revision: https://phab.nylas.com/D2814
2016-04-04 15:22:01 -07:00
rittbys 24fb85b266 Changed GoogleInbox to InboxByGoogle (TEMPORARY PATCH) 2016-03-21 20:09:31 -05:00
Ben Gotow 8e6d4d9a8f Merge pull request #1506 from nylas/osx-shortcuts-improvement
Add Mail.app keybinds
2016-03-08 14:14:02 -08:00
sdewith 0359b4f342 Some fixes
Fixed based on Ben’s feedback, should be good to go now.
2016-03-08 13:23:18 -08:00
Juan Tejada 0d15c6cea6 fix(remove-from-view): Fix logic for delete/remove-from-view behavior:
Summary:
- Separate gmail's remove-from-view and delete behaviors and write logic
  for each of those
  - Remove MailboxPerspective::{canArchiveThreads, canTrashThreads,
    removeThreads} and some unecessary code in TaskFactory
  - Instead, add MailboxPerspective::tasksForRemovingFromPerspective (I
    know its a bit of a mouthful)
  - I initially tried to put all of the logic for each execution path
    inside the TaskFactory by checking perspective types, but it made
    more sense to use the polymorphism already in place for the different
    perspective types.
  - There is a default delete/remove-from-view behavior which is
    configurable via simple ruleset objects. The gmail behavior is
    configured in this way.
- Update swipe css classes based on destination of threads
- Fixes #1460:
  - Update logic to display archive/trash buttons and context menu options correctly
    when selected threads can be archived/trashed (not based on
    perspective)
  - Same for swiping
- Add a bunch of specs
- Convert some code to ES6
- TODO write some docs for new functions

Test Plan: Unit tests

Reviewers: drew, evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2682
2016-03-07 18:16:37 -08:00
Evan Morikawa 10e0fcc965 feat(find-in-thread): add the ability to find in a thread
Summary: Find in thread

Test Plan: todo

Reviewers: bengotow, juan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2660
2016-03-02 14:46:27 -08:00
sdewith c5a46e5e3f Add Mail.app keybinds
Added jumping, search focus, select, star and archive keybinds to Apple
Mail keymap
2016-02-29 12:17:14 -08:00
Seth Vargo 0a08be3c6c More closely match Apple mail shortcuts 2016-02-15 18:14:05 -05:00
Evan Morikawa 9faedb8b31 fix(keymap): don't use alt key in Windows keymaps 2016-01-28 14:26:56 -08:00
Evan Morikawa bc9ff12819 fix(keymap): change win32 keymaps to use ctrl-alt instead of cmd-alt 2016-01-28 14:18:44 -08:00
Evan Morikawa c7a685630d refactor(toolbar): allow toolbar extensions in contenteditable
Summary:
This is a refactor of the toolbar in the contenteditable. Goals of this
are:

1. Allow developers to add new buttons to the toolbar
2. Allow developers to add other component types to the floating toolbar (like the LinkEditor)
3. Make the toolbar declaratively defined instead of imperatively set
4. Separate out logical units of the toolbar into individual sections
5. Clean up `innerState` of the Contenteditable

The Floating Toolbar used to be an imperative mess. Doing simple
functionality additions required re-understanding a very complex set of
logic to hide and show the toolbar and delecately manage focus states.
There also was no real capacity for any developer to extend the toolbar.

It also used to be completely outside of our `atomicEdit` system and was a
legacy of having raw access to contenteditable controls (since it all used
to be directly inside of the contenteditable)

Finally it was difficult to declaratively define things because the
`innerState` of the Contenteditable was inconsistently used and its
lifecycle not properly thought through. This fixed several lifecycle bugs
with that.

Along the way several of the DOMUtils methods were also subtly not
functional and fixed.

The Toolbar is now broken apart into separate logical units.

There are now `ContentedtiableExtension`s that declare what should be
displayed in the toolbar at any given moment.

They define a method called `toolbarComponentData`. This is a pure
function of the state of the `Contenteditable`. If selection and content
conditions look correct, then that method will return a component to
render. This is how we declaratively define whether a toolbar should be
visible or not instead of manually setting `hide` & `show` bits.

There is also a `toolbarButtons` method that declaratively defines buttons
that can go in the new `<ToolbarButtons>` component.

The `ToolbarButtonManager` takes care of extracting these and binding the
correct editorAPI context.

Now the `<LinkEditor>` is a separate component from the `<ToolbarButtons>`
instead of being smashed together.

The `LinkManager` takes care of declaring when the `LinkEditor` should be
displayed and has properly bound methods to update the `contenteditable`
through the standard `atomicEdit` interface.

If users have additional contenteditable popup plugins (like displaying
extra info on a name or some content in the composer), they can now
implement the `toolbarComponentData` api and declaratively define that
information based on the state of the contenteditable.

Test Plan: TODO

Reviewers: bengotow, juan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2442
2016-01-20 14:35:20 -08:00
Ben Gotow cca6b70223 fix(keymaps): Display composer keymaps, fix Apple Mail 2016-01-06 11:44:20 -08:00
GMPolyakov 3eca5faebd fix
removed shortcuts not shown on Inbox shortcuts page
2015-12-31 14:30:16 -08:00
GMPolyakov 28f0ebdd65 Add Inbox Shortcuts
Added keyboard shortcuts for Google Inbox (different from Gmail).
2015-12-31 14:09:18 -08:00
Ben Gotow b00e5439e5 feat(paste): Paste accepts more HTML, paste and match style now available
Summary:
Related to #320, #494, #515, #553

Ignore newlines and returns in HTML, they can be inside tags

Allow all attributes so that paste from excel looks nice

Never let someone paste a `contenteditable` attribute

Update specs

Test Plan: Run new specs

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2309
2015-12-07 15:34:03 -08:00
Juan Tejada 931a93af4e feat(print): Add functionality to print currently focused thread
Summary:
- Adds button inside the message list to print the thread
- Adds cmdctrl-p binding to print thread
- Adds new action and new internal_package to listen to this action.
- Creates a standalone browser window with current thread html, and removes all
collapsed messsages from the print view

Test Plan: - Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2310
2015-12-04 18:12:06 -08:00
Ben Gotow 092956b379 feat(keybindings): Show all keybindings in prefs 2015-12-01 18:31:19 -08:00
Ben Gotow 6ef0a49c26 fix(keymaps): Small tweaks to fix broken key behaviors
- Reload the menu after changing keymap sets
- Do not allow accelerators in the menu like "z", because they do not go through selector-based command matching and always fire into the window.
- Do not match `cmdctrl` to both `cmd` and `ctrl` on the Mac. Just `cmd`
- Re-order `shift-delete` mapping to `core:cut`, because it causes the menu to have no binding on Mac OS X
2015-11-13 16:05:40 -08:00
Evan Morikawa 069b1835cd feat(selection): add selection of read, unread, starred, etc
Summary:
Can select all, deselect-all, read, unread, starred, unstarred.

Yes, it's not REALLY select "all", but it uses the items in the current
`retainedRange`. This is actually similar to what gmail does (only selects
on the first page of a 100).

Test Plan: new test

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2241
2015-11-09 10:03:55 -05:00
Ben Gotow e87b5700e2 fix(menu): Allow fast-switch between accounts 2015-11-06 18:19:49 -08:00
Evan Morikawa d54b1929e9 fix(keymap): use atom-keymap 5.1.11 2015-11-06 15:16:57 -08:00
Evan Morikawa 13c0ffa989 feat(keymap): add cmd+1, cmd+2, etc to quick-select accounts
Fix "unique key" for react props

Fix composer styling bug in popout composer
2015-11-06 14:38:50 -08:00
Evan Morikawa 455b418d6f feat(keymap): add new <KeymapHandlers />
Summary:
Refactor keymaps to wrap components with a <KeymapHandlers /> component.
This more Reactful way of declaring keyback handlers prevents us from
needing to subscribe to `atom.commands`

Test Plan: new tests

Reviewers: bengotow, juan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2226
2015-11-06 11:47:06 -08:00
Ben Gotow 0956c18cab feat(shortcuts): Pageup/dn in message list, shift+pageup/dn in thread list 2015-10-29 20:34:43 -07:00
Evan Morikawa 539e9b3799 fix(archive): can archive and trash from focused message 2015-10-23 14:49:29 -07:00
Ben Gotow 3ccc5e3d99 rename(Nylas Mail): Replace Nylas Mail > N1 2015-09-29 09:44:30 -07:00
Ben Gotow 34767e3914 tweak(menus): Move Reload, Show Activity Window to Developer menu 2015-09-09 14:05:03 -07:00
Evan Morikawa 6ee161eb72 fix(undo): properly scope composer keymappings for undo/redo
Summary: Properly scopes undo & redo key bindings to the composer

Test Plan: manual

Reviewers: dillon, bengotow

Reviewed By: bengotow

Maniphest Tasks: T3446

Differential Revision: https://phab.nylas.com/D1951
2015-08-28 18:59:00 -04:00
Ben Gotow 9d995ded67 feat(work): Create the "Work" window, move TaskQueue, Nylas sync workers
Summary:
Move sync workers and Edgehill token checks to work window

Move the task queue and database setup to the work window

Move ContactStore background refresh to work window

Store the task queue in the database

WIP

The TaskQueue now puts tasks in the database instead of in a file, which also means it can be observed

Move all delta sync and initial sync to a package, make NylasSyncStore which exposes read-only sync state

DraftStore no longer reads task status. Once you set the "sending" bit on a draft, it never gets unset. But that's fine actually.

If your package lists windowTypes, you *only* get loaded in those windowTypes. If you specify no windowTypes, you get loaded in the root window.

This means that onboarding, worker-ui, worker-sync, etc. no longer get loaded into the main window

ActivitySidebar has a special little store that observes the task queue since it's no longer in the window

Move "toggle component regions" / "toggle react remote" to the Developer menu

Move sync worker specs, update draft store specs to not rely on TaskQueue at all

Test Plan: Run existing tests, all pass

Reviewers: dillon, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1936
2015-08-27 16:39:40 -07:00
Evan Morikawa b5624687d3 feat(composer): add bullets, numbered lists, and tab controls
Summary: Adding bullets, numbered lists, and tabbing indenting and outdenting

Test Plan: manual

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1917
2015-08-19 13:26:11 -07:00
Ben Gotow 5b0c82abb1 fix(keymaps): JSON => CSON during cibuild final phase 2015-08-18 14:50:53 -07:00
Ben Gotow 5ea02ead4f fix(preferences): Display multiple keybindings when available 2015-08-14 16:41:52 -07:00
Ben Gotow 79b6c1d94a feat(preferences): WIP Preferences panel
Summary:
Things still to come:
- General tab
- Signatures tab (potentially remove and land)

Adding emacs things to gitignore

Adding progress. iterating on html/css is incredibly painful

Added layout for accounts page.

Adding layout for appearance page

layout for shortcuts preferences page

adding layount for notifications menu

Adding signatures layout

WIP

WIP - tab switching, accounts tab

WIP ALL THE THINGS

Keymap template support (Gmail / outlook, etc.)

Test Plan: No tests atm

Reviewers: evan

Differential Revision: https://phab.nylas.com/D1890
2015-08-14 15:40:11 -07:00
Ben Gotow 5ddbe34e58 fix(search): Command-alt-f to highlight search
Fixes T3011
2015-08-10 12:02:44 -07:00
Ben Gotow b7e314ac62 fix(contact-chips): Contact chips are editable and have much better style
Summary:
The TokenizingTextField has several new optional props, including onEdit, which enables
editing of the tokens and tokenIsInvalid, which allows you to make tokens red, while still
accepting them as tokens.

When you go to send a message with invalid recipients it won't let you until you remove/
edit them.

Hotloading

Edit chips, keymappings not through command registry, 7 new tests for editing chips

Test Plan: Run 7 new tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1825
2015-08-03 13:06:28 -07:00
Evan Morikawa 9eb36f5813 fix(popover): don't let popover overflow
Summary:
The popover class now will adjust itself until it fits within the window
frame. You don't see the intermediate state in the double render.

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1795
2015-07-23 19:42:16 -07:00