Commit graph

69 commits

Author SHA1 Message Date
Ben Gotow 7ce646a1d3 fix(keymaps): Restore missing bindings, handle single keys inside of email frames 2016-04-27 15:20:06 -07:00
Ben Gotow ac66570b1b fix(keymaps): function kys to lowercase, - to + 2016-04-27 13:33:26 -07:00
Ben Gotow a46bad4eb7 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 78b19a4d42 fix(win): load config earlier 2016-04-22 14:57:33 -07:00
Ben Gotow 93131a11c7 fix(Inbox): Allow shift-J, shift-K to select threads 2016-04-14 17:36:51 -04:00
Ben Gotow 9b34ce73ec fix(Gmail): Allow shift-J, shift-K to select threads 2016-04-14 17:08:46 -04:00
Ben Gotow f1c0a1615d 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 070d09c233 Changed GoogleInbox to InboxByGoogle (TEMPORARY PATCH) 2016-03-21 20:09:31 -05:00
Ben Gotow 0393ab38da Merge pull request #1506 from nylas/osx-shortcuts-improvement
Add Mail.app keybinds
2016-03-08 14:14:02 -08:00
sdewith cd715359f5 Some fixes
Fixed based on Ben’s feedback, should be good to go now.
2016-03-08 13:23:18 -08:00
Juan Tejada 37af2ba42c 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 800f3a041b 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 759b613f62 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 752e0bb25a More closely match Apple mail shortcuts 2016-02-15 18:14:05 -05:00
Evan Morikawa 14edd8a7c7 fix(keymap): don't use alt key in Windows keymaps 2016-01-28 14:26:56 -08:00
Evan Morikawa bca538bb28 fix(keymap): change win32 keymaps to use ctrl-alt instead of cmd-alt 2016-01-28 14:18:44 -08:00
Evan Morikawa c2ceb6fd6c 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 e0339e9e18 fix(keymaps): Display composer keymaps, fix Apple Mail 2016-01-06 11:44:20 -08:00
GMPolyakov 96b68c0aa7 fix
removed shortcuts not shown on Inbox shortcuts page
2015-12-31 14:30:16 -08:00
GMPolyakov ca48d3c216 Add Inbox Shortcuts
Added keyboard shortcuts for Google Inbox (different from Gmail).
2015-12-31 14:09:18 -08:00
Ben Gotow a1bb98ebf4 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 bdfd96fed2 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 ceb9e2cdb1 feat(keybindings): Show all keybindings in prefs 2015-12-01 18:31:19 -08:00
Ben Gotow 2e618d40a6 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 119da453e1 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 d9ef4c51e1 fix(menu): Allow fast-switch between accounts 2015-11-06 18:19:49 -08:00
Evan Morikawa 9ca4e42b68 fix(keymap): use atom-keymap 5.1.11 2015-11-06 15:16:57 -08:00
Evan Morikawa 55d3e92f50 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 37e3fe0f45 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 6bee127134 feat(shortcuts): Pageup/dn in message list, shift+pageup/dn in thread list 2015-10-29 20:34:43 -07:00
Evan Morikawa 45466a18b0 fix(archive): can archive and trash from focused message 2015-10-23 14:49:29 -07:00
Ben Gotow 1d9a34f5ea rename(Nylas Mail): Replace Nylas Mail > N1 2015-09-29 09:44:30 -07:00
Ben Gotow ffb33f3c93 tweak(menus): Move Reload, Show Activity Window to Developer menu 2015-09-09 14:05:03 -07:00
Evan Morikawa e639afae1e 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 1a576d92dc 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 e018d6a8ec 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 fd08bf87b0 fix(keymaps): JSON => CSON during cibuild final phase 2015-08-18 14:50:53 -07:00
Ben Gotow e7fce1f120 fix(preferences): Display multiple keybindings when available 2015-08-14 16:41:52 -07:00
Ben Gotow ed2a5c90d9 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 3b0bc63846 fix(search): Command-alt-f to highlight search
Fixes T3011
2015-08-10 12:02:44 -07:00
Ben Gotow 1dc7c03ebd 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 5b7ca072cd 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
Evan Morikawa f22d154486 feat(picker): new folder and label picker
Summary:
The new, styled folder and label picker!

Some highlights:
- Folder picker has custom icons and a divider
- Label picker has checkboxes with off, checked, and intermediate state
- Extracted LabelColorizer out of mail-label
- Search will bold the results it found
- Fixes to Tooltip to prevent it displaying at invalid moments
- Keyboard UX improvements to Menu

Test Plan: coming soon

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1790
2015-07-23 11:47:46 -07:00
Evan Morikawa b89fea38c0 feat(labels): add a new label/folder picker
Summary:
This is the initial diff for the label picker UI. This is all of the
functionality and none of the CSS.

Test Plan: todo

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: sdw

Differential Revision: https://phab.nylas.com/D1761
2015-07-21 14:20:15 -07:00
Robert McQueen f043d0e506 Add (s) hotkey for starring in both thread-list and message-list views
Summary:
Adding spec for message list star. Fixing multi-select in 3-pane starring

I didn't write a spec for thread-list because the thread-list-spec appears to be broken (returns immedietly at the top). I spent ~15 minutes attempting to fix but didn't make much progress

Test Plan: Added spec to message list

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T1957

Differential Revision: https://phab.nylas.com/D1697
2015-06-26 14:06:31 -07:00
Ben Gotow 8599bc0397 feat(logging): Developer bar, verbose logging to logstash, Electron 0.26.0
Summary:
- We now make verbose log files continuously as you use the app
- We ship the logs to LogStash via S3 when an exception occurs
- We log the DatabaseStore, ActionBridge and Analytics packages

- We are now on the latest version of Electron 0.26.0
- We are now on Chrome 42 and io.js 1.4.3
- We should be setup to use ASAR soon.

Update atom.sh to reflect that we're now electron

oniguruma was unnecessary

correctly find log files that haven't been shipped yet

Fix a small issue with nodeIsVisible after upgrade to Chrome 42

Delete old logs, better logging from database store, don't ship empty logs

Test Plan: Run existing tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1531
2015-05-19 17:02:46 -07:00
Ben Gotow 8c08e61d6f fix(naming): Mac menus and Info.plist should say Nylas Mail 2015-05-16 11:12:43 -07:00
Ben Gotow ba00372645 feat(tags): Tags dropdown and new features for Menu and Popover
Summary:
Focused Content Store should notify observers when focused items change, not just when they're reassigned

Popovers should have a `direction` and optional event onOpened

Menu divider documentation was wrong, menus should support checked items by default

Pressing escape in a popover's input should dismiss the popover

Other changes

Remove specs that make no sense anymore

Small tweak to report build breaking. Shouldn't happen often ;)

Test Plan: Run tests, which will now phone home if they break

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1493
2015-05-13 12:01:41 -07:00
Evan Morikawa 365fe400f7 feat(salesforce): add Salesforce creator
Summary:
tests on the schemas

build input elements

form builder pulls data

grouping by row

salesforce object store

salesforce api logic

successfully pulling salesforce objects into db

object store saving to db

refactoring tokenizing text field

full documented tokenizing text field with specs

linking in object picker component

converting generated form to a controlled input

form change handlers for controlled inputs

Salesforce object creator store

new way of opening windows

removed atom.state.mode

create new salesforce object creator in new window

form creator loading in popup with generated form

generated form renders select and multiselcet and textarea

add checkbox

creating related objects

windnows know when others close

remove debugger statements

form submission

converting data for salesforce posting

hot window loading

new hot window registration

hot loading windows

actions for listening to salesforce objects created

generated form errors

error handling for salesforce object creator

rename saleforce object form store

display errors to form

submitting state passed through

properly posts objects to Salesforce

change name to salesforce object form

add deep clone

use formItemEach

styling for Salesforce form creator

salesforce required fields come back and populate form

generated form loads related objects into fields

remove console logs and fix sales schema adapter test

fix task queue and formbuilder specs

fix action bridge spec

fix tokenizing text field spec

fix draft store and tokenizing proptypes

fix linter issues

fix tokenizing text field bug

rename to refresh window props

remove console.log

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1425
2015-04-24 12:36:19 -04:00
Ben Gotow 86f7d65034 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-08 19:25:00 -07:00