Commit graph

339 commits

Author SHA1 Message Date
Ben Gotow 7533dc0ac6 fix(lint): Various linter issues 2016-05-06 16:06:16 -07:00
Ben Gotow 0e2b5501e3 fix(lint): Correct more linter errors 2016-05-06 14:10:28 -07:00
Evan Morikawa d9be81b7f5 feat(babel6): fix es6 importing from coffee 2016-05-06 12:00:45 -07:00
Evan Morikawa 2e2f877ddb feat(babel6): 1,774 linter errors 2016-05-06 11:55:46 -07:00
Evan Morikawa 57a3e140f4 feat(babel6): Fix autlinker spec 2016-05-06 11:55:32 -07:00
Evan Morikawa 92d5369f21 feat(babel6): Fix errors in es6 compilation and extending from coffeescript 2016-05-06 11:55:31 -07:00
Evan Morikawa 92199587b3 feat(babel6): Convert message.coffee to message.es6 2016-05-06 11:55:27 -07:00
Evan Morikawa 409704fe8f feat(babel6): Convert account.coffee to account.es6 2016-05-06 11:55:25 -07:00
Evan Morikawa 390007cac9 feat(babel6): fix es6 describe function syntax 2016-05-06 11:55:20 -07:00
Evan Morikawa 18df77c3c0 feat(babel6): fix participant field spec 2016-05-06 11:55:16 -07:00
Evan Morikawa 2692fce522 feat(babel6): Fix destructuring default from exports and update linter 2016-05-06 11:55:14 -07:00
Evan Morikawa 50c1fded14 feat(babel6): Fix FixedPopover spec 2016-05-06 11:55:12 -07:00
Evan Morikawa 4e754c660c feat(babel6): Fix ModelWithMetadata spec 2016-05-06 11:55:10 -07:00
Evan Morikawa 2d55322705 feat(babel6): Detect when packages don't have a default export 2016-05-06 11:54:57 -07:00
Evan Morikawa 21419b9df0 feat(babel6): Convert to use new es6 require syntax 2016-05-06 11:54:55 -07:00
Ben Gotow bbdfa85547 feat(keymaps): Edit your keymaps from preferences 2016-05-05 17:05:51 -07:00
Ben Gotow cb2913871e es6(*): AutoUpdateManager, ProtocolHandler, more. 2016-05-04 19:34:41 -07:00
Ben Gotow 66cb0a6a77 rm(*): deprecated/unused Atom code, user stylesheet support 2016-05-04 14:27:46 -07:00
Ben Gotow cde329168d fix(specs) 2016-05-04 11:50:54 -07:00
Ben Gotow 7a15e369a7 Revert "feat(mailto): Allow N1 to be default client on windows"
This reverts commit a08eb3e175.
2016-05-03 19:04:04 -07:00
Ben Gotow c811cc5ce6 fix(model): add specs around serializing bad API data 2016-05-03 15:58:14 -07:00
Ben Gotow a08eb3e175 feat(mailto): Allow N1 to be default client on windows 2016-05-03 14:47:21 -07:00
Evan Morikawa 7024dadb66 fix(spec): fix cache in spec 2016-05-02 18:58:31 -07:00
Juan Tejada 71353cdaf1 feat(mail-merge): Add CSV imports, styling, and several fixes
Summary: Adds CSV imports, proper styles to mail merge plugin and fixes a handful of bugs

Test Plan: TODO

Reviewers: bengotow, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2925
2016-04-27 18:22:32 -07:00
John McNair f818a134dd Parse Office 365 names (#2016)
Office 365 likes to format email addresses as follows:
Last Name, First Name (Some Description) <email@address.org>

This causes Contact.firstName() (and hence sometimes displayName()) to return
"Last Name," which looks a bit odd in the message/thread views.

The intent of the commit is to correctly parse these names so that (using the
above example):
- firstName = "First Name"
- lastName = "Last Name (Some Description)"
- fullName = "First Name Last Name (Some Description)"

These behavioral changes only impact names containing a ','.

I don't know that this really provides exhaustive coverage of Office 365, and
keeping the description as part of the last name is not completely guilt free,
but it's not any worse than the previous state of affairs which also has
the description in the same field but combined instead with (misplaced)
first name data.
2016-04-27 10:26:23 -07:00
Ben Gotow b23af144e1 fix(accounts): show messages and coerce config when invalid 2016-04-26 15:34:17 -07:00
Ben Gotow c543de9e81 cleanup(specs): Remove space-pen. Goodbye, jQuery! 2016-04-26 13:14:07 -07:00
Ben Gotow 6b12f833d7 fix(compose): "compose in trash", additional specs #2026 2016-04-26 13:14:06 -07:00
Evan Morikawa e42f501780 fix(frame): fix link clicking in iframes 2016-04-25 17:30:30 -07:00
Ben Gotow 4d38ac6310 cson(cleanup): Remove imports, only used for config.cson now 2016-04-24 20:33:34 -05:00
Ben Gotow b7da2c7b86 cson(packages): Remove from specs, deprecate use for for menus, package.json files 2016-04-24 20:31:53 -05:00
Ben Gotow 3bfad0c9e1 fix(*): spec failures related to moment-round again 2016-04-24 15:21:29 -05:00
Juan Tejada e710a83e10 fix(specs): Fix broken popover specs
- Remove composition with decorator for now
- Fix other specs
2016-04-24 11:08:33 -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 e90735ed6e feat(win): faster popout windows
Summary:
This diff is designed to dramatically speed up new window load time for
all window types and reduce memory consumption of our hot windows.

Before this diff, windows loaded in ~3 seconds. They now boot in a couple
hundred milliseconds without requiring to keep hot windows around for
each and every type of popout window we want to load quickly.

One of the largest bottlenecks was the `require`ing and initializing of
everything in `NylasExports`.

I changed `NylasExports` to be entirely lazily-loaded. Drafts and tasks
now register their constructors with a `StoreRegistry` and the
`TaskRegistry`. This lets us explicitly choose a time to activate these
stores in the window initalization instead of whenever nylas-exports
happens to be required first.

Before, NylasExports was required first when components were first
rendering. This made initial render extremely slow and made the proposed
time picker popout slow.

By moving require into the very initial window boot, we can create a new
scheme of hot windows that are "half loaded". All of the expensive
require-ing and store initialization is done. All we need to do is
activate the packages for just the one window.

This means that the hot window scheme needs to fundamentally change from
have fully pre-loaded windows, to having half-loaded empty hot windows
that can get their window props overridden again.

This led to a major refactor of the WindowManager to support this new
window scheme.

Along the way the API of WindowManager was significantly simplifed.
Instead of a bunch of special-cased windows, there are now consistent
interfaces to get and `ensure` windows are created and displayed. This
DRYed up a lot of repeated logic around showing or creating core windows.

This also allowed the consolidation of the core window configurations into
one place for much easier reasoning about what's getting booted up.

When a hot window goes "live" and gets populated, we simply change the
`windowType`. This now re-triggers the loading of all of the packages for
the window. All of the loading time is now just for the packages that
window requires since core Nylas is there thanks to the hot window
mechanism.

Unfortunately loading all of the packages for the composer was still
unnaceptably slow. The major issue was that all of the composer plugins
were taking a long time to process and initialize. The solution was to
have the main composer load first, then trigger another window load
settings change to change the `windowType` that loads in all of the
plugins.

Another major bottleneck was the `RetinaImg` name lookup on disk. This
requires traversing the entire static folder synchronously on boot. This
is now done once when the main window loads and saved in a cache in the
browser process. Any secondary windows simply ask the backend for this
cache and save the filesystem access time.

The Paper Doc below is the current set of manual tests I'm doing to make
sure no window interactions (there are a lot of them!) regressed.

Test Plan: https://paper.dropbox.com/doc/Window-Refactor-UYsgvjgdXgVlTw8nXTr9h

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2916
2016-04-22 13:30:42 -07:00
Ben Gotow 297e93dc8a rm(package): Remove unused grammars, settings, scopedProperties 2016-04-20 18:46:58 -07:00
Ben Gotow ca24fc31e9 rename(drafts) DraftStoreProxy => DraftEditingSession 2016-04-19 16:08:58 -07:00
Ben Gotow 585dab7cdf refactor(composer): Make session, draft available everywhere
Summary:
Up until now, we've been requiring that every plugin control in the composer take the draftClientId, retreive the session, listen to it, build state from the draft, etc. This is a huge pain and is hard to explain to newcomers becaus it frankly makes no sense.

In 0.3.45 we made it so that the ComposerView always has a non-null draft and session. (It isn't rendered until they're available). In this diff, I just pass those through to all the plugins and remove all the session retrieval cruft.

Almost none of the buttons have state of their own, which I think is appropriate.

They do render on every keystroke, but they were already running code (to recompute their state) on each keystroke and profiling suggests this has no impact.

Prepare for immutable

In preparation for Immutable models, make the draft store proxy returns a !== draft if any changes have been made. This means you can safely know that a draft has changed if `props.draft !== nextProps.draft`

Test Plan: Run tests

Reviewers: juan, evan

Reviewed By: juan, evan

Differential Revision: https://phab.nylas.com/D2902
2016-04-19 16:05:15 -07:00
Evan Morikawa 7e3e3a6015 tests(calendar): adding calendar and scheduler tests
Summary: Adding tests

Test Plan: Tests

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2892
2016-04-19 11:54:15 -07:00
Ben Gotow 237bad59d8 feat(unread/spam): New items in the sidebar for unread and spam
Summary:
Adds a new unified "Spam" folder and a unified "Unread" view,
which shows all the messages in your inbox which are unread.

Test Plan: Run tests

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2901
2016-04-19 11:32:33 -07:00
Dakota Nelson 0e2a875f4d Expose ParticipantsTextField through component kit (#1994) 2016-04-18 16:39:08 -07:00
Matt Bilker fbc8a66b03 fix(specs): handle Electron 0.37 remote method calls (#1943) 2016-04-13 10:29:13 -07:00
Ben Gotow f396d9eddb bump(react) 0.14.7 => 15.0.1 2016-04-12 16:58:45 -07:00
Ben Gotow 25349295dc fix(schedule): Use draft session to udpate metadata, always save in syncback 2016-04-11 14:32:54 -07:00
Ben Gotow b75ed6f920 perf(db): Use subselect to improve thread list query perf (53%!)
Summary:
- Use a sub-select query with much better performance to display the thread list
- Perform analyze on tables after launch

The new query is:

```
SELECT `Thread`.`data` FROM `Thread` WHERE `Thread`.`id` IN (SELECT `id` FROM `ThreadCategory` AS `M26` WHERE `M26`.`value` IN ('9m9ks71k06n5rmx82kgues09p','9s9k25q6j1krjgpkovbcjm7d','13b7ufruoymvih07ki0uahlto','dtmhlzz6phr47zp512knhjgf8','16dvjb84bszfh15kgfrjj37i3','aclwmgncdqjfibp51bvgbeik','17qad7jhbp6tozog3klm5zagt','4x4bkbawiq825u4eu3aus8tll','7axr9f5f1lzpwm2rw2ghkirhq','dsnn660af0pmou2gg3nstga8a','361qr5rva1ieby2r0ec3sn0bm','10fyvba7pjyjgeyr5i65i1zri') AND `M26`.`in_all_mail` = 1  ORDER BY `M26`.`last_message_received_timestamp` DESC LIMIT 200 OFFSET 0) ORDER BY `Thread`.`last_message_received_timestamp` DESC;
`
0|0|0|SEARCH TABLE Thread USING INDEX Thread_id (id=?)
0|0|0|EXECUTE LIST SUBQUERY 1
1|0|0|SCAN TABLE Thread-Category AS M26 USING COVERING INDEX ThreadFancyIndex
1|0|0|EXECUTE LIST SUBQUERY 2
0|0|0|USE TEMP B-TREE FOR (only on 200 result items)
```

Which is twice as performant as:
```
SELECT `Thread`.`data` FROM `Thread` INNER JOIN `ThreadCategory` AS `M26` ON `M26`.`id` = `Thread`.`id` WHERE `M26`.`value` IN ('9m9ks71k06n5rmx82kgues09p','9s9k25q6j1krjgpkovbcjm7d','13b7ufruoymvih07ki0uahlto','dtmhlzz6phr47zp512knhjgf8','16dvjb84bszfh15kgfrjj37i3','aclwmgncdqjfibp51bvgbeik','17qad7jhbp6tozog3klm5zagt','4x4bkbawiq825u4eu3aus8tll','7axr9f5f1lzpwm2rw2ghkirhq','361qr5rva1ieby2r0ec3sn0bm','10fyvba7pjyjgeyr5i65i1zri') AND `M26`.`in_all_mail` = 1  ORDER BY `M26`.`last_message_received_timestamp` DESC LIMIT 200 OFFSET 0;

0|0|1|SCAN TABLE Thread-Category AS M26 USING COVERING INDEX ThreadFancyIndex
0|0|0|EXECUTE LIST SUBQUERY 1
0|1|0|SEARCH TABLE Thread USING INDEX Thread_id (id=?)
```

Test Plan: Broken!

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2869
2016-04-11 13:29:05 -07:00
Juan Tejada d9517101d5 fix(perspective): Fix specs for FocusedPerspectiveStore 2016-04-11 07:59:40 -07:00
Juan Tejada aef785eb12 feat(thread-search): Add spinner to indicate search in progress
Summary:
- This diff also restructures the search package in a few ways:
  - Rename package to `thread-search` instead of `search-bar`
  - Move SearchQuerySubscription and SearchMailboxPerspective inside
  package. This allows SearchQuerySubscription to have access to
  SearchActions in a clean way and keeps all of the search related code
  in 1 package
  - Remove SearchMailboxPerspetcive from mailbox-perspective.coffee
- Adds temporary spinner while we get a new design for it

Test Plan: - TODO

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2868
2016-04-10 16:20:26 -07:00
Evan Morikawa 0cc3f32d8e fix(spec): fix bad ref 2016-04-09 22:07:50 -04:00
Evan Morikawa a1b5a23273 refactor(scheduler): move all event data into metadata
Summary: Moved events into metadata. Removed a lot of code

Test Plan: todo

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2866
2016-04-09 21:19:01 -04:00
Ben Gotow f316c06f7a fix(specs): * 2016-04-08 16:03:21 -07:00