Commit graph

1460 commits

Author SHA1 Message Date
Ben Gotow 4d38ac6310 cson(cleanup): Remove imports, only used for config.cson now 2016-04-24 20:33:34 -05:00
Jackie Luo 4f31785a16 🎨(plugins): Fix line breaks 2016-04-24 18:32:53 -07:00
Ben Gotow ba16a71777 fix(build): CSON => JSON no longer necessary for /keymaps, /menus 2016-04-24 20:27:29 -05:00
Ben Gotow aab39a12da mv(packages): move plugins that are incompatible with open source sync engine 2016-04-24 14:53:12 -05: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
Juan Tejada 021eac7679 feat(mail-merge): Add mail merge plugin
Summary:
Adds Mail Merge Plugin
- Adds new table components to component kit
- Adds new extension points to allow dragging and dropping into composer contenteditable and participant fields and customizing participant fields
- Adds new decorators and other misc updates
- #1608

Test Plan: TODO

Reviewers: bengotow, evan

Reviewed By: bengotow, evan

Differential Revision: https://phab.nylas.com/D2895
2016-04-22 18:29:07 -07:00
Evan Morikawa a8413c8e2f fix(win): speed up composer launching 2016-04-22 17:41:22 -07:00
Jackie Luo fd61995b92 fix(draft-list): Revert regression for sheet selection 2016-04-22 17:30:14 -07:00
Jackie Luo ff4cbc8d13 feat(activity-list): View message opens and link clicks
Summary:
Adds an activity list view that shows message opens and link clicks in a
chronological feed.

TODO: Add badge for unread notifications and different styling for read/unread
notifications. Click item to jump to corresponding thread.

Test Plan: TODO.

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2915
2016-04-22 17:27:30 -07: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
Jackie Luo 534eec2d93 fix(draft-list): Select proper sheet when launching in drafts perspective 2016-04-21 16:00:06 -07:00
Evan Morikawa 1f267d8bec fix(spec): fix to run in utc travis 2016-04-20 14:39:15 -07:00
Ben Gotow 38804cb816 fix(attachments): Don't show the paperclip for inline attachments < 3k (signatures, etc.) 2016-04-20 10:44:32 -07:00
Kevin Jose Martin 0ebdd2046b Doing write on a GET is invalid. (#2004)
* Doing write on a GET is invalid

* Doing write on a GET is invalid
2016-04-20 10:07:12 -07:00
Ben Gotow 5829e2691f perf(db): Use partial indexes added in sqlite 3.8 2016-04-19 17:42:02 -07:00
Jackie Luo 665f9c654c lint(github-card): Change duplicated variable name 2016-04-19 17:34:19 -07:00
Jackie Luo bfa1ef0d40 feat(preferences): Add theme picker button to Appearances 2016-04-19 17:14:25 -07:00
Tim Hitchins 4c749426ad Added link to all plugins section (#2002)
* Added link to all plugins section

* Added correct link - to the nylas repro ;-)
2016-04-19 16:14:06 -07:00
Max Stoiber c0c39e69b9 Fix Github Sidebar Plugin (#2003)
Hopefully fixes #1991

I don't have N1 setup locally, so this is a blind shot–would appreciate somebody who has it set up to pull this and verify this fixes the issue, but as far as I can tell it should.

The gist is:

> Looking at the code, what you do is use the `search/users` endpoint to find users by email and taking the repos from there. You then load the repositories of the username, but we can't sort those by most-starred: "sort string Can be one of `created`, `updated`, `pushed`, `full_name`. Default: `full_name`" *([src](https://developer.github.com/v3/repos/#list-user-repositories))*
> What we could instead do is use the search API, which **allows us to search for repositories by a specific user and sort by most starred**. This is a tiny bit hacky, but works perfectly fine. E.g. this is the URL for my most starred repos: `https://api.github.com/search/repositories?q=user:mxstbr&sort=stars&order=desc`
2016-04-19 16:13:30 -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
Ben Gotow ea22bde230 fix(default-alias): Show primary email instead of "None", clarify only for new messages currently 2016-04-15 19:05:54 -04:00
Ben Gotow 40ca758766 fix(default-client): Set initial state to fix React warning 2016-04-15 14:30:13 -04:00
Ben Gotow 244a28dffa fix(related-threads): Show snippet in addition to subject #1683 2016-04-14 17:33:43 -04:00
Ben Gotow 6f2329a169 fix(view-on-github): Add readme and fix bug 2016-04-14 17:03:57 -04:00
Ben Gotow 46cc73816e fix(star): Change action from Star All => Star #1927 2016-04-14 16:34:46 -04:00
Ben Gotow a6abf801d5 💄(scheduler): Would you like => I'd like 2016-04-13 17:48:27 -07:00
Drew Regitsky b0fbdf7469 fix(onboarding): Add missing return statement when changing endpoints 2016-04-13 17:41:31 -07:00
Drew Regitsky d098c96653 fix(onboarding): Change error notification for endpoint changes 2016-04-13 16:13:25 -07:00
Ben Gotow 5c48464691 fix(search-bar): Apparently we were not providing keys 2016-04-13 16:08:24 -07:00
Ben Gotow fe171a0c8c fix(require): Move more requires to new electron format 2016-04-13 15:35:01 -07:00
Ben Gotow bdfa426ecf fix(search): Cannot remove items from search (Sentry 30318) 2016-04-13 14:22:43 -07:00
Ben Gotow 217af8d77c bump(electron): 0.36.7 => 0.37.5 2016-04-12 18:42:57 -07:00
Matt Bilker 8e5f75d8e0 fix(imports): switch to Electron's require('electron') (#1907)
* fix(imports): switch to Electron's require('electron')

Electron in 0.37.5 phases out the usage of `require('built-in-module')`
in favor of `require('electron').builtInModule`. This commit corrects usage in
some cases that cause N1 to not start under Electron 0.37.5.

* fix(specs): use new Electron remote import
2016-04-12 18:09:13 -07:00
Jackie Luo 4cabab5d2a fix(composer-emoji): Fix calculation for category positioning 2016-04-12 14:51:56 -07:00
Ben Gotow d159e1037d fix(emoji): Improve variable names / diff feedback 2016-04-12 14:46:03 -07:00
Ben Gotow 8613921a55 fix(emoji): Re-use img tag to avoid running out of file descriptors
Summary:
On my machine the new emoji picker was causing "too many open file descriptor"
errors. I think that this was because it was creating 1300 image tags in 50msec.

I refactored this code so that it uses a single image tag and only loads one image
at a time. This could make it slower on some people's machines, but eliminates the
possibility of it breaking the app!

Test Plan: Run tests

Reviewers: jackie

Differential Revision: https://phab.nylas.com/D2878
2016-04-12 14:29:59 -07:00
Jackie Luo 1039ad2c34 fix(composer-emoji): Switch to characters to PNGs (#1898)
* Add PNGs and JSON file

* Add Apple and Twitter emoji

* Fix linter issues and tests

* Get correct path from EmojiStore

* Add emoji regex and update extensions

* Remove the scary regex
2016-04-12 10:27:24 -07:00
Evan Morikawa 7b03a80d02 feat(scheduler): add an event preview when sending a meeting request
Summary: add event preview

Test Plan: manual

Reviewers: bengotow, juan

Differential Revision: https://phab.nylas.com/D2874
2016-04-11 22:45:36 -04:00
Ben Gotow c69b192881 fix(scheduler): Don't cast durations to integers, fix 1.5, 2.5 hour blocks 2016-04-11 18:52:49 -07:00
Ben Gotow 5f75cccc0f fix(scheduler): End should work even if the mouse isn't over a time 2016-04-11 18:42:17 -07:00
Ben Gotow 938e9b8093 fix(scheduler): Make popover width even so it's not blurry 2016-04-11 18:33:53 -07:00
Ben Gotow 63343adeac fix(sync): Handle "Invalid cursor" scenario by 💣🔥 away the cache 2016-04-11 17:34:52 -07:00
Evan Morikawa 2855c3695f fix(scheduler): minor style tweaks to scheduler popover 2016-04-11 19:33:27 -04:00
Evan Morikawa 3658f0e0da fix(scheduler): fix jumping calendar and add popover
fix(scheduler): fix jumping calendar and add popover

Summary: feat(scheduler): improved calendar picker

Test Plan: manual

Reviewers: bengotow, juan

Differential Revision: https://phab.nylas.com/D2873
2016-04-11 18:23:06 -04:00
Ben Gotow cec811ae36 fix(schedule): Move z-indexes to prevent dropdown layering issue 2016-04-11 14:58:58 -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