Commit graph

1215 commits

Author SHA1 Message Date
Juan Tejada 2eefbc28d3 fix(snooze): Close popover when opening a new one 2016-02-24 15:08:53 -08:00
Juan Tejada bae079dcc6 fix(snooze): Only allow snooze from inbox 2016-02-24 15:06:06 -08:00
Juan Tejada f7b1209b5c fix(fixed-popover): Reposition when overflowing on left direction
- This is a temporary solution
2016-02-24 15:02:42 -08:00
Evan Morikawa 1c5869c867 feat(tracking): sticky tracking state and consolidate component 2016-02-24 14:46:09 -08:00
Ben Gotow bb824f36fa fix(feedback): Remove feedback btn, update "N1 Help" in menu bar 2016-02-24 13:49:15 -08:00
Ben Gotow 5e34c889c6 💄(send-later): Minor draft list styling changes 2016-02-24 13:44:56 -08:00
Ben Gotow 030d86e3bd fix(snooze/send-later): Change chrono config to always prefer dates in future 2016-02-24 13:16:53 -08:00
Evan Morikawa ecf3909f7d fix(read-receipts): fix padding and styles under selection 2016-02-24 13:16:35 -08:00
Drew Regitsky 29785c209e fix(read-receipts): threadlist icon vert align and placeholder when missing 2016-02-24 13:02:18 -08:00
Evan Morikawa 4158e598e0 fix(tracking): tracking pixel won't register if it's from you 2016-02-24 12:55:00 -08:00
Evan Morikawa ada4256dc8 fix(lint): fix less and js linter issues 2016-02-24 12:31:56 -08:00
Evan Morikawa 9dd7a9600a fix(tracking): fix link tracking and read receipt plugins
Fix broken links in link tracking and read receipts

Fix bug in email frame where it wouldn't adjust the height even when
content changed

MessageItem bodies automatically clear the MessageBodyProcessor cache when
the message contents (including metadata) change.

Remove unused Account stuff from nylas-observables

Plugins appIds properly read if there's an environment set
2016-02-24 12:30:12 -08:00
Ben Gotow 90b9570f91 fix(send-later): Resolves a variety of small bugs from QA 2016-02-24 12:26:56 -08:00
Drew Regitsky f88445af15 fix(plugins): more fixes to open/link tracking urls 2016-02-24 12:17:39 -08:00
Drew Regitsky 0550b092b7 fix(plugins): fix open tracking and link tracking URLs 2016-02-24 12:00:40 -08:00
Juan Tejada e02b924efb 💄 (send-later): Update placeholder copy, again 2016-02-24 11:50:43 -08:00
Juan Tejada 300d5dbc7f fix(sidebar): Prevent error in snooze item when category doesnt exist
- Add Snooze category to locked and hidden categories to prevent from
  directly moving stuff to it and showing up in the user categories
  section
2016-02-24 11:45:47 -08:00
Jackie Luo 630448634c 🎨(composer-emojis): Remove pointer and adjust styling
Summary: The floating toolbar now takes an optional boolean to decide whether it shows the pointer.

Test Plan: Tested locally.

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2628
2016-02-24 11:31:32 -08:00
Juan Tejada 3f59176380 💄 (popover): Properly apply styles to input inside popover
- Fix tabindex in send later popover
- Update placeholder copy
2016-02-24 11:22:54 -08:00
Juan Tejada ce17d8ab1e feat(snooze): Add snooze item to sidebar 2016-02-24 10:50:21 -08:00
Juan Tejada 3125d4d2ff 💄 (snooze): Add quotes to popover placeholder 2016-02-24 10:28:08 -08:00
Juan Tejada c0da487e02 fix(snooze): Close all popover types when submitting date with enter 2016-02-24 10:27:16 -08:00
Jackie Luo ef0cf7e3dd 🎨(composer-emojis): Fix styles in emoji picker
Summary: Adjust sizing, padding, etc., to fit better with overall app design.

Test Plan: Tested locally.

Differential Revision: https://phab.nylas.com/D2627
2016-02-24 10:12:38 -08:00
Ben Gotow b106bed2a4 fix(*): misc fixes for warnings, appearance of PL indicators 2016-02-24 01:04:57 -08:00
Juan Tejada 9f87ab25dd fix(signature): Update signature when account is changed in composer
Summary:
- Fixes #1239
- Adds action in composer view to indicate when draft partcipants have
  changed. This seemed like the simplest way to listen for this change without
  adding another extension point
- Updates signature plugin to listen to this action and update signature
  accordingly
- Adds test

Test Plan: - Unit tests

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2614
2016-02-24 00:19:55 -08:00
Juan Tejada 7ec30d0c7b fix(system-tray): Move Tray to main process
Summary:
- Fixes #1223
- Still uses a package in the renderer process to listen to changes in
  the unread count and have access to the canvas api.
- Renderer process will write icon to disk and inform main process that
  it should update the icon

Test Plan: - Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2613
2016-02-23 23:26:06 -08:00
Juan Tejada d34f30cc3e 💄 (plugins): Clean up constants in plugins
- Fix some eslint issues
2016-02-23 22:55:47 -08:00
Juan Tejada 3a55a126b6 fix(snooze): Fix react component warnings 2016-02-23 22:39:18 -08:00
Ben Gotow 9315ee3385 fix(metadata-plugins): Add production app ids 2016-02-23 22:29:49 -08:00
Juan Tejada a5ee197660 feat(snooze): Adds initial design pass and update snooze popover
Summary:
- Add FixedPopover, an absolutely positioned popover component to use for swipe snoozing:
  - This component needs to be finished, as its current behavior is primarily for the snooze plugin
- Updates popover.cjsx to properly render pointer for thesnooze popover for the `down` direction
- Adds new design assets
- Adds date input to snooze popover

Test Plan: - TODO

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2624
2016-02-23 20:03:42 -08:00
Drew Regitsky 0237b8cfd2 fix(metadata-plugins): update all appIds and URLs for staging 2016-02-23 19:19:43 -08:00
Evan Morikawa 50a104c1fd fix(link-tracking): fixes in link-tracking 2016-02-23 18:58:07 -08:00
Evan Morikawa dd6cefc3f8 fix(read-receipts): Style fixes to link tracking and read receipts 2016-02-23 18:58:07 -08:00
Evan Morikawa 9d11da4a5e feat(read-receipts): show status on MessageItem 2016-02-23 18:58:07 -08:00
Ben Gotow 9ef84e476a fix(auth-failure): Warn of disconnect on 403s, fix logic 2016-02-23 18:35:24 -08:00
Ben Gotow 7e96a169a2 💄(plugins): Updated assets and a bit of error handling 2016-02-23 17:51:10 -08:00
Ben Gotow 6eed3ce054 fix(composer): Redo toolbar styling with theme variables + minor fixes 2016-02-23 15:40:44 -08:00
Ben Gotow 686a3f4fda 💄(snooze): Quick action styling, draft pencil alignment 2016-02-23 14:37:10 -08:00
Ben Gotow d674a665fe fix(send-later): Re-order so send later always appears beside send 2016-02-23 14:37:10 -08:00
Evan Morikawa ac5266a1a5 fix(linter): fix less linter error 2016-02-23 14:18:49 -08:00
Evan Morikawa f76acfa441 fix(inbox-zero): don't show inbox zero when syncing 2016-02-23 14:17:11 -08:00
Evan Morikawa a1a126893c fix(img): png-crush images 2016-02-23 14:12:02 -08:00
Evan Morikawa eb09929ae7 fix(composer): fix styles in popout composer 2016-02-23 13:55:31 -08:00
Ben Gotow 9541343835 💄(send-later): Lots of styling of send-later 2016-02-23 13:52:18 -08:00
Evan Morikawa 6349a1ff0c feat(composer): new composer footer and icon design 2016-02-23 13:42:10 -08:00
Evan Morikawa cdd015cfab feat(inbox-zero): add minimal graphic to inbox when no threads 2016-02-23 10:50:08 -08:00
Ben Gotow c0123e2b70 💄(onboarding): Incorrect button padding during onboarding 2016-02-23 10:48:36 -08:00
Ben Gotow 8ed28f76d1 💄(icon): A delightful seafoam green icon 2016-02-23 10:35:08 -08:00
Ben Gotow 549ae38b6c fix(swipe): Better animation, callback for action completion 2016-02-22 16:08:10 -08:00
Ben Gotow 42793e6b0c 💄 Minor visual tweaks to win32 + dark mode 2016-02-22 13:30:12 -08:00
Ben Gotow b923086c2a fix(drag): Patch for crash on dragging threads 2016-02-22 10:57:22 -08:00
Ben Gotow 54ecb2bd58 💄(search): Fix clear button positioning 2016-02-22 10:14:34 -08:00
Ben Gotow b6ebefe1ca fix(compose): More defensive check when switching from address, see description
This fixes #1341, but is more restrictive:

- You cannot switch From: accounts if the draft was retrieved from the sync engine (authored via Gmail or via another copy of N1. The sync-engine gives drafts a non-null threadId)

- You cannot switch From: accounts if the draft is a forward from an existing thread.

These two restrictions are unfortunately necessary to ensure that we don't have to download attachments we don't have to re-upload them to another account on the sync-engine. We could write code for this in the future but it's going to be gross.
2016-02-19 19:19:43 -08:00
Ben Gotow 5c8c139965 fix(print): Add print button to preview, don't print immediately (Fixes #1352) 2016-02-19 19:07:22 -08:00
Ben Gotow 9f8f1750cc fix(compose): Enable esc-to-cancel from Cannot Send dialog (Fixes #1383) 2016-02-19 18:59:17 -08:00
Ben Gotow 840b48c2df 💄: Experimental app icon, fix for merge conflict 2016-02-19 18:52:49 -08:00
Ben Gotow 592374c0dc feat(swipe-to-*): Gesture support and animation in thread list
Summary:
This diff does two things:
- It adds a new SwipeContainer that makes it easy to implement swipe gestures. This is built into listTabular, so you can create a list and define onSwipeLeft/Right to enable gestures.

- It adds support for basic add/remove animations to the thread list. This works by adding a CSS transition to `top` and also leaving removed rows around for a specified time. (these times need to match.) Pretty much just cloned the core idea from TimeoutTransitionGroup.

Test Plan: No tests yet

Reviewers: evan, juan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2581
2016-02-19 18:22:28 -08:00
Evan Morikawa fb4e806afe feat(menu): add right click menu
Summary:
Adds a right click menu to the thread list
Moving to folders and labels #TODO

Test Plan: TODO

Reviewers: bengotow, juan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2609
2016-02-19 18:35:48 -05:00
Ben Gotow 95aba56979 fix(sending): Tiny fix for strange vertical space when sending 2016-02-19 15:31:51 -08:00
Drew Regitsky 199a62d70e feat(new-plugins): add open tracking and link tracking plugins
Summary:
Adds two (very similar) plugins - Open Tracking and Link Tracking.
Both can be enabled via a button in the composer. Open tracking
inserts a tracking pixel right before send, and link tracking replaces
all links with tracked redirects. Both plugins use the new Metadata
service to store their open/click counts, and have backend servers to
respectively serve the pixel image or handle the redirects. Requests
also trigger a metadata update to increment the open/click counters.

Test Plan: Manual for now

Reviewers: evan, bengotow, drew

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2583
2016-02-19 12:42:56 -08:00
Ben Gotow b65c4104b4 lint(emoji): Fix lint failure from spacing 2016-02-19 11:29:31 -08:00
Karim Hamidou 97f968a808 [auth] Change a Google OAuth parameter
Summary:
Some of our users who reauth are getting weird errors from Google — it seems that in some cases Google OAuth doesn’t pass us a `refresh_token`, even though we ask for one by passing `approval_prompt=force` (I’ve landed a commit to log more details about this in edgehill-server —- 6e984ffa26 — but this won’t fix the problem).

Apparently, Google recently « soft-deprecated » `approval_prompt` in favor of a new parameter called `prompt`, which does mostly the same thing (https://developers.google.com/identity/protocols/OAuth2WebServer#formingtheurl)

This diff replaces `approval_prompt` by `prompt`.

Test Plan: Tested by authing a Gmail account and checking that it worked.

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: emfree

Differential Revision: https://phab.nylas.com/D2557
2016-02-19 11:20:36 -08:00
Ben Gotow 98529dc7a8 fix(participants): Update specs to reflect that spacing is now in CSS 2016-02-19 10:28:02 -08:00
Ben Gotow b6a1674173 💄: White buttons, dropdown / popover cleanup, hairline dividers 2016-02-18 15:21:42 -08:00
Juan Tejada 74bb98b337 fix(draft-list): Display , separated participants list 2016-02-18 12:14:18 -08:00
Juan Tejada d0bdeb3a02 🎨(composer): Fix show-more token style in collapsed participants 2016-02-18 12:06:29 -08:00
Juan Tejada bb52510c87 fix(snooze): Check if snooze category is defined when creating 2016-02-18 10:44:03 -08:00
Juan Tejada a841417011 feat(snooze/send-later): Add snooze and send later plugins
Summary:
- Add initial version of snooze and send later plugins
- Tests are missing since this will probably heavily change before we are done with them

Test Plan: - TODO

Reviewers: drew, bengotow, evan

Reviewed By: bengotow, evan

Differential Revision: https://phab.nylas.com/D2578
2016-02-18 10:06:21 -08:00
Ben Gotow 7ca844bd75 fix(onboarding): Missing require for Actions, bad CSS 2016-02-17 22:21:23 -08:00
Juan Tejada 0217e5a509 feat(metadata): Switch to storing metadata on models
Summary:
 - Adds a class ModelWithMetadata which models can now extend from
 - Instances of this class can query metadata for a plugin via
   `obj.metadataForPluginId(pluginId)`
 - To observe changes on metadata it is sufficient to observe database changes on
   the model. e.g.:
   `DatabaseStore.findAll(Thread,
   [Thread.attributes.pluginMetadata.contains(pluginId)])`
 - To set metadata a new action has been created: Actions.setMetadata
 - Adds a helper observable in nylas-observables to query for models with
   metadata
 - Merges CreateModelTask and UpdateModelTask into SyncbackModelTask
 - Update SendDraftTask ans SynbackDraftTask to handle metadata changes

Test Plan: - Unit tests

Reviewers: drew, evan, bengotow

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2575
2016-02-17 15:00:33 -08:00
Juan Tejada 7ca04c579e fix(account-prefs): Update account save logic to prevent incorrect saves
- This fixes #1354 and #1235
- This issue was caused because the account details preferences
  component was keeping as state all of the account object fields. `setState` works
  like `extend`, so when the account changed, state was set to the new set of account fields,
  but the old values were only removed if they were overriden, and remained the
  same if the field did not exist in the new state object.
  Specifically, when a new account was added, setState was called with
  `{..., defaultAlias: undefined}` which did /not/ remove the  the defaultAlias
  from the previous state.
- Switched to managing state with a top level key `account`
2016-02-16 18:03:22 -08:00
Ben Gotow 8f6dff7da8 fix(important): Remove todo, reference to usesImportantFlag. Fixes #1331 2016-02-16 11:41:15 -08:00
Evan Morikawa 3298a38d6a fix(composer): fix dissapearing participant bug w/ multiple composers
If you had multiple composers on a single thread, all but the last
composer would lose its participants. This was because once it loaded the
participants would blur and trigger a request to set the participants to
blank. That request was async so by the time it was resolved the draft was
loaded and the request erroneously went through
2016-02-15 18:12:41 -05:00
Evan Morikawa 58d3c1d7cf fix(onboarding): remove ssl-enabled checkbox
Until it's implemented in the backend
2016-02-15 16:51:02 -05:00
Evan Morikawa 60f7290564 fix(messages): fix jumping message list on draft focus
We were erroneously jumping to an individual message when you focused on
it.
2016-02-15 16:34:23 -05:00
Evan Morikawa d80edbf7f3 fix(message): fix collapse unset when new thread delta
The minification bit was erroneously getting reset when a new thread
update delta came in due to an object equality check instead of an id
check.
2016-02-15 15:46:33 -05:00
Jackie Luo 7bbd41bea4 fix(composer-emojis): Add spec, allow adjacent emojis, fix toolbar positioning bug
Summary:
Adds tests to the emoji picker.

The emoji picker should also now be able to add emojis consecutively (without spaces).

Finally, the toolbar positioning bug (emoji picker appearing in front of typed text, the toolbar manager appearing in the upper left corner when empty lines are selected) should be fixed so that the toolbar appears directly above/below the selection area.

Test Plan: Tests included in diff.

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2551
2016-02-12 11:42:11 -08:00
Evan Morikawa 5f1b8633c7 fix(analytics): delay closing of onboarding window 2016-02-12 10:56:36 -08:00
Evan Morikawa ac52589de5 fix(analytics): add onboarding welcome event 2016-02-12 10:25:28 -08:00
Ben Gotow 226cf4ce64 fix(search): Compile immediately to avoid truncating. Fixes #1307 2016-02-11 17:18:24 -08:00
Ben Gotow 03a33e5270 🎨: Fixes, labels in narrow thread view, better label wrap 2016-02-11 15:25:24 -08:00
Juan Tejada c4135ee23c 🎨(popover): Remove hardcoded width from code -> move to stylesheet 2016-02-11 13:15:59 -08:00
Ben Gotow 793fc5ef2c fix(min-height): Reduce minimum window size to 250px. Fixes #1293 2016-02-10 12:39:13 -08:00
Ben Gotow b21bb4bc9b fix(build): LESS lint issue 2016-02-10 09:38:10 -08:00
Ben Gotow 71a5662553 🎨: Smaller buttons, smaller toolbar, smaller text
This should not be considered final, but we do plan to shrink the size of the entire UI slightly to match platform conventions.
2016-02-09 19:45:24 -08:00
Ben Gotow 6e49dbd2c3 bump(*): Electron 0.36.7, version to 0.4.6 2016-02-08 18:35:23 -08:00
Ben Gotow d4e7b7e712 fix(readme): Force github to refresh cache of screenshot 2016-02-08 14:52:07 -08:00
Ben Gotow 9bed0e6380 fix(tray): Do not show count on Mac OS X when 0. Fixes #1233 2016-02-08 10:31:13 -08:00
Ben Gotow fcc8ca8b07 fix(system-start): Do not continue when checkAvailability returns false 2016-02-06 11:35:01 -08:00
Ben Gotow 0e661ec996 fix(undo): Ensure undo bar dismisses after re-appearing 2016-02-05 19:11:27 -08:00
Ben Gotow a6d8783dae fix(messages): Field label was always "To" 2016-02-05 18:42:29 -08:00
Ben Gotow ca31ee10bd feat(perspective): Restore through NylasEnv.savedState 2016-02-05 18:36:48 -08:00
Ben Gotow 1cd49d952d fix(message): Allow height to be 0, remove 150px min height 2016-02-05 15:33:07 -08:00
Ben Gotow 50bd559623 fix(tray): Fix accidental conversion to NaN 2016-02-05 14:37:55 -08:00
Juan Tejada 199150188d fix(sidebar): Handle edge cases for sidebar shortcuts
Summary:
- Update menus and shortcuts correclt when accounts change or focused
  accounts change
- Move menu logic into SidebarCommands to remove duplicated logic
- Make `Window` menu also contain checkboxes

Test Plan: - Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2534
2016-02-05 14:25:07 -08:00
Juan Tejada 2b6ed11828 fix(sidebar): Display correct keyboard shortcuts in account switcher
- Fixes #1203
2016-02-05 09:55:27 -08:00
Ben Gotow 835e7fe9c8 perf(outbox): Only trigger when send draft tasks are present 2016-02-04 20:15:15 -08:00
Juan Tejada c0e8dc7ccb fix(styles): Fix less lint error 2016-02-04 18:19:26 -08:00
Juan Tejada 774957a5ff update(sidebar): Update sidebar design + context menus
Summary:
- Removes account switcher almost entirely
- Update context menu to edit and delete sidebar items
- Gross hardcoded position and size for the switcher icon -- will likely update with later redesign

Test Plan: - Visual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2527
2016-02-04 14:58:47 -08:00
Ben Gotow 91240f8979 feat(outbox): Sending status now appears beside drafts
Summary:
This diff adds an "OutboxStore" which reflects the TaskQueue and
adds a progress bar / cancel button to drafts which are currently sending.

- Sending state is different from things like Send later because drafts
  which are sending shouldn't be editable. You should have to stop them
  from sending before editing. I think we can implement "Send Later"
  indicators, etc. with a simple InjectedComponentSet on the draft list
  rows, but the OutboxStore is woven into the DraftList query subscription
  so every draft has a `uploadTaskId`.

- The TaskQueue now saves periodically (every one second) when there are
  "Processing" tasks. This is not really necessary, but makes it super
  easy for tasks to expose "progress", because they're essentially
  serialized and propagated to all windows every one second with the
  current progress value. Kind of questionable, but super convenient.

- I also cleaned up ListTabular and MultiselectList a bit because they
  applied the className prop to an inner element and not the top one.

- If a DestroyDraft task is created for a draft without a server id, it
  ends with Task.Status.Continue and not Failed.

- The SendDraftTask doesn't delete uploads until the send actually goes
  through, in case the app crashes and it forgets the file IDs it created.

Test Plan: Tests coming soon

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2524
2016-02-04 14:14:24 -08:00
Dakota Nelson 2a692456b3 Disallow Gmail accounts from entering IMAP flow
Summary:
The error message from D2515 is being upgraded to also disable the
continue button so that a user is unable to sync an @gmail.com account
using the IMAP flow.

Test Plan: Tested locally.

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2516
2016-02-04 09:54:01 -08:00
Bernd Verst 21201d7d16 Removes the MessageListNotificationBar editable component in favor of the existing MessageListHeaders
Summary: Removes the MessageListNotificationBar editable component in favor of the existing MessageListHeaders

Test Plan: Manually built N1 and verified the MessageListNotificationBar no longer appears as editable component.

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2523
2016-02-03 18:11:23 -08:00
Jackie Luo 3202a57d00 fix(composer-emojis): Fix bugs around null nodes and whitespace
Summary: Corrected the linting errors and changed some of the logic around tracking typed text and triggering properly.

Test Plan: Tested locally.

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2522
2016-02-03 18:10:56 -08:00
Ben Gotow 8b7c1aaa01 fix(send-action): Make dropdown trigger secondary send actions
We can come up with a new UX for this later, but for now this is important for consistency with the Reply/Reply-All/Forward picker and others in the app that perform actions rather than changing selection. Also makes it possible to choose to "Send and Archive" /without/ making it the future default, which will be nice when there are many you may want infrequently.
2016-02-03 16:27:11 -08:00
Ben Gotow b29b087a9f 💄(emoji): Add an icon / description to emoji package 2016-02-03 15:43:22 -08:00
Dakota Nelson 21ba15c5a5 Warn when entering Gmail address in imap settings
Summary:
Users have been configuring their Gmail accounts using the IMAP
authentication method, which causes problems. Attempting to do so will
now create an error message.

Test Plan: Tested locally.

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: mg, emfree

Maniphest Tasks: T6621

Differential Revision: https://phab.nylas.com/D2515
2016-02-03 15:14:02 -08:00
Evan Morikawa 918090a4e1 feat(error): improve error reporting. Now NylasEnv.reportError
Summary:
The goal is to let us see what plugins are throwing errors on Sentry.

We are using a Sentry `tag` to identify and group plugins and their
errors.

Along the way, I cleaned up the error catching and reporting system. There
was a lot of duplicate error logic (that wasn't always right) and some
legacy Atom error handling.

Now, if you catch an error that we should report (like when handling
extensions), call `NylasEnv.reportError`. This used to be called
`emitError` but I changed it to `reportError` to be consistent with the
ErrorReporter and be a bit more indicative of what it does.

In the production version, the `ErrorLogger` will forward the request to
the `nylas-private-error-reporter` which will report to Sentry.

The `reportError` function also now inspects the stack to determine which
plugin(s) it came from. These are passed along to Sentry.

I also cleaned up the `console.log` and `console.error` code. We were
logging errors multiple times making the console confusing to read. Worse
is that we were logging the `error` object, which would print not the
stack of the actual error, but rather the stack of where the console.error
was logged from. Printing `error.stack` instead shows much more accurate
stack traces.

See changes in the Edgehill repo here: 8c4a86eb7e

Test Plan: Manual

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2509
2016-02-03 18:06:52 -05:00
Jackie Luo 74db6eb90f feat(composer-emojis): Add emojis to composer
Summary:
Emojis can now be added in the composer window with colons and the emoji names (referenced by the same names used on Slack/GitHub/etc.).

When using the correct syntax, if there are emojis that match the text typed, they appear in a dropdown floating toolbar.

Selection works with either mouse clicks or arrow keys (plus `Enter`).

Currently, the toolbar won't trigger if the colon is adjacent to a non-whitespace character.

Test Plan: TODO: Will write tests soon!

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2505
2016-02-03 15:05:36 -08:00
Bernd Verst 6e35ce7dd7 Use vertical layout for MessageListHeaders, MessageListNotificationBar, Draft:Footer
Test Plan: No new tests. Visual verification.

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2514
2016-02-03 14:51:46 -08:00
Juan Tejada 1e02d8c9c0 fix(message): Limit number of collapsed recipients in message
Summary:
- `from` participants now have their own line
- `to` participants in collapsed mode merge `to`, `cc`, `bcc` as in
  gmail, and start in separate line from `from`
- number of `to` participants in collapsed mode is limited, and also overflows
  with an ellipsis with css in case its too long
- /some/ cleanup
- Unsuccessfully tried to update the css for the message item header to convert to a flexbox. Wrapping the `from` address when the text is too long is still a TODO
- Fixes #1113

Test Plan: - Manual

Reviewers: bengotow, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2507
2016-02-03 11:24:29 -08:00
Ben Gotow a038b23cab lint(tray): Fix "new Number" not allowed 2016-02-03 09:20:40 -08:00
Evan Morikawa 8b895068e2 feat(metadata): add cloudState that sync with Metadata service
Summary:
Now all plugins get passed a `cloudState` object to their `activate`
method.

The `cloudState` object is an instance of `CloudState` and acts like a
key-value store backed by the yet-to-be-implemented Metadata service.

It has a `get`, `getAll`, and `observe` method. The `observe` method
returns a new `Rx.Observable` for the given key.

It has a `set`, and `unset` method that doesn't actually mutate state, but
rather dispatches new `Task`s to Create, Update, and Delete `Metadata`
objects.

The whole object is backed by `Metadata` objects. Since these are standard
Database Objects that will appear on the delta sync streaming API, any
updates from the server will automatically propagate down to listening
views via the `Rx.Observable`s.

Additionally, there is a new `N1-Send-Later` stub plugin that demonstrates
how to use the `cloudState`.

There are few other minor refactors included in this diff:

**Generic CUD Tasks**: There is now a generic `CreateModelTask`,
`UpdateModelTask`, and `DestroyModelTask`. These can either be used as-is
or trivially overridden to easily update simple objects. Hopefully all of
the boilerplate rollback, error handling, and undo logic won't have to be
re-duplicated on every task. There are also tests for these tasks. We use
them to perform mutating actions on `Metadata` objects.

**New `boundProps` for `InjectedComponents`**: When making the
`N1-Send_later` plugin, I realized that the injected component needed to
get the `cloudState` somehow. Traditionally components would require
Stores and load data that way, but these are setup at `require`-time. Now
that `cloudState` only is available on `activate` we needed a way to get
the data to the components. There's now the concept of `boundProps` which
will be props added to the Component when it gets injected. This required
changing the return signature of `findComponentMatching`, which got
renamed to `findComponentDataMatching`.

**Failing on Promise Rejects**: Turns out that if a Promise rejected
due to an error or `Promise.reject` we were ignoring it and letting tests
pass. Now, tests will Fail if any unhandled promise rejects. This
uncovered a variety of errors throughout the test suite that had to be
fixed. The most significant one was during the `theme-manager` tests when
all packages (and their stores with async DB requests) was loaded. Long
after the `theme-manager` specs finished, those DB requests were
(somtimes) silently failing.

**Globally stub `DatabaseStore._query`**: All tests shouldn't actually
make queries on the database. Furthremore, the `inTransaction` block
doesn't resolve at all unless `_query` is stubbed. Instead of manually
remembering to do this in every test that touches the DB, it's now mocked
in `spec_helper`. This broke a handful of tests that needed to be manually
fixed.

**ESLint Fixes**: Some minor fixes to the linter config to prevent
yelling about minor ES6 things and ensuring we have the correct parser.

Test Plan: new tests

Reviewers: drew, bengotow, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2419
2016-02-02 15:28:06 -05:00
Ben Gotow 5051bdbd61 fix(tray): Order of operations causing exception 2016-02-02 12:24:59 -08:00
Ben Gotow 180294e70c 💄(tray): Use locale string so unread count uses comma notation 2016-02-02 12:18:37 -08:00
Ben Gotow 277bdc4e10 💄(composer): Account dropdown aliases styling 2016-02-02 11:33:08 -08:00
Ben Gotow fd9850b74d 💄(thread-list): Correct top border on selected threads. Fixes #1189 2016-02-02 11:12:28 -08:00
Juan Tejada 460956bc37 fix(sidebar):Correctly update sidebar by listening to FocusedPerspective
-  Clean up AccountSwitcher a bit
2016-02-02 10:59:44 -08:00
Juan Tejada bdabd1de62 Revert "fix(sidebar): Correctly update sidebar when a notif is selected"
This reverts commit 0828badb921c81a9779b2e52ab4829bf0db07410.
2016-02-02 10:58:24 -08:00
Juan Tejada 236c5ddc53 fix(sidebar): Correctly update sidebar when a notif is selected
- Clean up AccountSwitcher a bit
2016-02-02 10:44:18 -08:00
Ben Gotow 11429727f9 fix(composer): Attachment check ignores uploads. Fixes #1190 2016-02-02 10:15:20 -08:00
Juan Tejada 6a14d5b561 fix(lint): Fix new eslint rule introduced with babel-eslint upgrade.
See https://phabricator.babeljs.io/T6925
2016-02-01 20:07:36 -08:00
Ben Gotow d9c4739f78 fix(contact): Converge on displayName(), don't show account label in ThreadList. Fixes #1157 2016-02-01 19:12:06 -08:00
Ben Gotow aade6a6579 rm(Nilas-contact-elements): Remove unused package 2016-02-01 19:12:06 -08:00
Juan Tejada c67bab052a fix(prefs): Fix selector for default account for send 2016-02-01 18:34:42 -08:00
Juan Tejada 9408feb7aa fix(default-alias):Show correct list of accounts and aliases in composer 2016-02-01 18:34:42 -08:00
Juan Tejada 617e2aed09 fix(remove-from-view): Update remove from view (shortcut) behavior
Summary:
- Now behaves exactly like in Gmail:
  - If viewing inbox, it will archive or trash, depending on setting
  - If viewing starred, will unstar
  - If viewing trash, will move to inbox
  - If viewing label, will remove label (no folder support)
  - No op otherwise
- Updates TaskFactory helpers and adds some helper methods
- Updates specs

Test Plan: - Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2492
2016-02-01 17:40:42 -08:00
Ben Gotow 648bf1b309 fix(send-and-archive): Was disabling signatures due to name collision 2016-02-01 17:33:18 -08:00
Ben Gotow 809f51f960 feat(reorder): Re-order mail rules (#1074) and accounts (#631)
Summary:
This implements EditableList re-ordering via a new prop callback.
You can drag and drop items in the mail rules list and the accounts list.
Note that you can't drag between lists - right now this is just to enable
re-ordering.

Test Plan: No new specs yet

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2495
2016-02-01 14:06:54 -08:00
Juan Tejada 46f331c0b1 fix(alias-list): Editable list wont create empty items
- Update alias coercion to include name by default
2016-02-01 12:45:52 -08:00
Juan Tejada a00adca3e5 fix(shortcuts): Add shortcut to mark as spam, fixes #765
- Minor cleanup + docs
2016-02-01 12:21:42 -08:00
Ben Gotow bf0f3828dc fix(thread-list): Remove dup accountIds to avoid extra work 2016-01-30 15:00:20 -08:00
Ben Gotow e37c95bb4d fix(send+archive): Update to use focused perspective 2016-01-29 19:01:47 -08:00
Ben Gotow c8d8bd0aee fix(thread-list): AccountId resolution for items outside loaded range 2016-01-29 17:56:57 -08:00
Evan Morikawa ec553b0c3d fix(pref): check for mounting on async launch service 2016-01-29 17:11:54 -08:00
Ben Gotow e6360cf18b feat(screenshot-mode): Minor fix to unmount method 2016-01-29 16:59:51 -08:00
Ben Gotow d61becc549 feat(screenshot-mode): Tiny feature for removing PII when taking debug screenshots 2016-01-29 16:39:07 -08:00
Ben Gotow 3c9db9bd85 fix(activity): "Long Polling" => "Delta Streaming" because we don't really poll. 2016-01-29 16:06:33 -08:00
Ben Gotow eec7c829ce fix(dropdown): Open up or down depending on position 2016-01-29 15:52:40 -08:00
Ben Gotow 2027901deb fix(uploads): Consolidate logic, use Promisify, path.join 2016-01-29 14:45:53 -08:00
Juan Tejada a3b686e546 fix(electron): Update api usage to require('electron') 2016-01-29 14:24:33 -08:00
Ben Gotow 48a64e7fef fix(focus): Don't clear when item is scrolled out of retained range 2016-01-29 12:34:58 -08:00
Juan Tejada 5c6a40ae96 fix(styles): Actually fix styles for faded recipient list 2016-01-29 11:18:28 -08:00
Juan Tejada f4f9db9310 fix(styles): Fix styles for faded recipient list 2016-01-29 11:13:25 -08:00
Juan Tejada 6c8a8bca8c fix(styles): Cleanup less files for account sidebar and switcher 2016-01-29 11:03:52 -08:00
Ben Gotow 180da72b77 fix(notifs): Categories inside Threads need accountId. Fixes #1155 2016-01-29 10:49:45 -08:00
Juan Tejada 21ebd82ece fix(sidebar): Update sidebar correctly when an account added or removed 2016-01-29 10:21:49 -08:00
Ben Gotow 183cbaff17 fix(config): observe fires immediately, causing re-renders 2016-01-29 00:31:10 -08:00
Juan Tejada be73b8bea8 fix(account-switcher): Don't display "All Accounts" when only 1 account 2016-01-28 19:53:12 -08:00
Evan Morikawa 6620779ee2 fix(message): fix truncation of messages
It would seem the document.documentElement.scrollHeight can return 0 when
the document.body.scrollHeight reliably returns the correct height.
Changed to fallback to various height checking mechanisms.

Fixes #425
Fixes #1102
Fixes #1153
2016-01-28 18:07:43 -08:00
Ben Gotow 25db6c696d fix(labels): Never show labels UX for threads split across folders 2016-01-28 16:57:24 -08:00