Commit graph

315 commits

Author SHA1 Message Date
Halla Moore 1c675935a7 feat(popout-threads) Add functionality to open threads in popout windows
Summary:
Threads can now be opened in separate windows. This can be done via the popout
icon next to the print icon, or by double-clicking the thread when in double-
pane mode. Note that the single-click action is still fired, which is why
double-clicking does not work in single-pane mode. The popout icon changes to a
pop-in icon while in the popout window, to allow users to collapse it back into
the main window.

Test Plan: Tested locally

Reviewers: evan, juan

Reviewed By: juan

Subscribers: sdw

Differential Revision: https://phab.nylas.com/D3332
2016-10-12 13:55:11 -07:00
Ben Gotow aa7ef91b0b fix(files): When download mode is “manual” prompt about inline attachments
Summary:
When you have your "Download attachments for new mail" setting set
to "manually", inline images always appear broken with no explanation.

This patch listens for the image load to fail and displays a button which
queues the fetchFile task on click. This seemed like the best approach because
it doesn't slow down the loading of the message with more fstats / lookups.
(Seeing if the file has already been downloaded is an async operation)

Test Plan: No specs atm

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3313
2016-10-03 11:22:44 -07:00
Ben Gotow 2dc779c5be fix(participants): When copying, include space #2871 2016-09-30 10:48:34 -07:00
Juan Tejada fc87ae5ef1 fix(lint) 2016-09-26 17:22:08 -07:00
Ben Gotow 039d9bea61 feat(inline-images): Drag & drop or paste inline images
Summary: Initial support for inline images. Tests still forthcoming!

Test Plan: WIP

Reviewers: mark, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3295
2016-09-26 17:01:19 -07:00
Juan Tejada 6051512276 fix(contact-sidebar): Correctly update selected contact
Sometimes, when selecting a contact (with name, email) inside a thread,
the dropdown (`<select>`) did not correctly reflect the selected
contact.

This was because when focusing a contact, the FocusedContactStore
queried that contact from the database just by email, and the contact
retured from the database became the focused one. However, sometimes the
returned contact might have the same email but different email, and
given that the `<select>` component is keyed by both name,email, it
couldn't find the appropriate <option> to render, so it could not update
to reflect the newly selected contact

Now, the FocusedContactStore queries by email and name to prevent this
2016-09-26 16:34:29 -07:00
Ben Gotow e533d063d0 fix(specs): Fix tests that were console.logging, bump coffee-react 2016-09-20 15:17:48 -07:00
Juan Tejada 5fc1b7de40 feat(msg-list): Don't make participants mailto links, add context menu 2016-09-19 19:33:52 -07:00
Juan Tejada ca54227f06 Add thread-sharing plugin
Summary:
Add thread-sharing plugin:

- Add popover to enable sharing
- Register custom nylas:// protocol to open a thread via protocol is thread exists

Test Plan: Manual

Reviewers: jackie, bengotow

Reviewed By: jackie, bengotow

Subscribers: jackie, halla

Differential Revision: https://phab.nylas.com/D3265
2016-09-14 00:04:20 -07:00
Juan Tejada 6c00098861 fix(msg-timestamp): Fix incorrect date var / convert to es6
- Typo in cjsx code broke the message timestamp
- Converted to es6 so this doesn't happen again!
2016-08-18 18:11:52 -07:00
Annie d57cca64d0 add(composer): Turn emails into mailto for debugging purposes
Summary:
fix(subject-field): Fix subject text field focus
Before, if you clicked a mailto link, once the composer loaded, the subject field (which was focused in composer-preload) blurred. This was not ideal as users would want to type once the popout loaded and instead they would have to click first. We identified that this was coming from the composer header _renderSubject injected component. We fixed the focus within mail merge subject text field and additionally added the onComponentDidChange method to injected component. This allowed us to only update the component when the header field changed.

Test Plan: tested on my machine for mailto links

Reviewers: juan

Reviewed By: juan

Subscribers: juan

Differential Revision: https://phab.nylas.com/D3150
2016-08-12 16:06:22 -07:00
Juan Tejada 8851df50fb fix(utils): Properly export DateUtils.timeZone, fix specs 2016-08-01 12:41:05 -07:00
jathpala b1e5066110 Better support 24-hour time (#2622)
* Added support for 24-hour time to the thread list view (Issue #682)

* Add 24-hour time support to the thread list scroll tooltip (Issue #682)

* Fix for 24-hour time in the thread list scroll tooltip (#682)

Correctly imports the DateUtils module

* Add support for 24-hour time to the draft threads list (Issue #682)

* Add 24-hour time to the message sidebar

* Fix for 24-hour time in the message view so the rollover tooltip is 24hour also (#682)

* Removed unused date functions from utils

fullTimeString and shortTimeString from src/flux/models/utils.coffee were not
compatible with 24-hour time. These functions were modified and moved to
DateUtils in src/date-utils.

* Fix for display of 24-hour time in the message view (Issue #682)

* Removed unused import of Utils in a couple of files

Prompted by Travis build errors.

* Updates to handling of date/time display

Incorporates changes suggested by @bengotow.
Re-enables support for the isDetailed property in message-timestamp (if this is set
to true, a medium length date/time string will be used for display).
Re-enables additional display varieties based on when the email was received. Note
that this is implemented slightly different to the orinal version - time is now given
as an absolute time rather than "... days ago" format.
TZ guessing moved to the global scope of date-utils for performance reasons.

* Minor de-linting

* Re-enable all tests by unfocusing the test suite

A previous commit (ad04775) added an fdescribe() to one of the tests in
draft-helpers-spec. This changes that to a regular describe() so that
all tests will be run when running ./N1 --test.

* Added tests for the new DateUtils functions

Added tests for getTimeFormat, mediumTimeString and fullTimeString.
Removed no longer relevant tests from message-timestamp-spec as _formattedDate
has been removed in favour of the functions in date-utils.

To test shortTimeString, we need to be able to set a fake current time which is
possible in jasmine 2.0+ but not in 1.3 which is currently in use.

As a possible bug, when running more than 10 tests the following warning is raised:
"(node:25025) Warning: Possible EventEmitter memory leak detected.
11 on-config-reloaded listeners added. Use emitter.setMaxListeners() to increase limit",
source: internal/process/warning.js (24)

* Minor de-linting
2016-07-28 17:42:14 -07:00
Annie 36771f4b92 fix(image): Prepend file:// to image paths to solve #621
Summary:
refactor(test): Fix file paths in message item body tests to be prepended with file://

Some inline images were not rendering as seen on (#621). The images were being correctly added to the
downloads folder, however, their path was being prepended with an unrelated base url. I hardcoded
file:// into the image paths so that they would always point to the local downloads folder.

Test Plan: Ran the specific tests for message item body and message item. Also checked in my email.

Reviewers: juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3105
2016-07-19 16:48:24 -07:00
Annie 8a0345152c fix(email): Fix email body height bug #1280
Summary: Some emails were having their body height set to 0 if their height was dependent upon the iframe height -- e.g. body.height equals 100% or inherit. Added a check to see if height computed to 0px and if so, set the height to auto.

Test Plan: Tested with emails on my computer

Reviewers: juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3100
2016-07-19 16:38:59 -07:00
Ben Gotow 11fb1aefdc fix(sending): Minor changes to cleanup phase of sending 2016-06-10 12:35:56 -07:00
Friedrich von Never 32efb09825 Settings: add 24-hour clock support 2016-06-06 14:31:57 -07:00
Jackie Luo 6713827e65 fix(email-frame): Allow events to bubble correctly and pass iframe 2016-05-27 15:18:12 -07:00
Juan Tejada a4ee61eadc fix(mail-merge): Refactor mass sending procedure
Summary:
This diff introduces several updates to mail merge to improve the procedure for sending a list of drafts.
Specifically, sending mass email will now:

- Clear mail merge metadata on the drafts that will actually be sent
- Upload attached files only /once/, and reuse those files on the drafts that will actually be sent
- Minimize database writes for new drafts being created
- Will queue a SendManyDraftsTask that will subsequently queue the necessary SendDraftTasks and keep track of them, and notify of any failed tasks

TODO:
- Add state to MailMerge plugin for failed sends and ability to attempt to re send them

Test Plan: - TODO

Reviewers: evan, bengotow, jackie

Reviewed By: bengotow, jackie

Subscribers: jackie

Differential Revision: https://phab.nylas.com/D2973
2016-05-24 17:22:09 -07:00
Ben Gotow 26d4361bfb bump(electron): Fix remaining deprecated requires, move to 1.0.1 2016-05-12 13:59:23 -07:00
Robert Stanfield be48fc4305 The horizontal scrollbar was not showing up when viewing an email (#2028) 2016-05-06 16:44:30 -07:00
Evan Morikawa 1498bcfac6 fix(lint): final linter fixes
fix(lint): final set of linter fixes
2016-05-06 16:32:34 -07:00
Ben Gotow 41ae914b9d fix(lint): Various linter fixes 2016-05-06 16:23:48 -07:00
Ben Gotow 42ef0e98a4 fix(lint): Various linter issues 2016-05-06 16:06:16 -07:00
Evan Morikawa 837627aa39 feat(babel6): 1,774 linter errors 2016-05-06 11:55:46 -07:00
Evan Morikawa 7f50074c0d feat(babel6): Convert to use new es6 require syntax 2016-05-06 11:54:55 -07:00
Evan Morikawa e2f9104766 feat(babel6): Initial babel conversion 2016-05-06 11:54:38 -07:00
Ben Gotow 74232d5b7e fix(tracking): Use colors for link/read receipts, fix parsing 2016-05-02 15:59:17 -07:00
Ben Gotow 4c537cbf8e fix(emoji): Replace message emoji in DOM, not in html string 2016-05-02 12:33:08 -07:00
Ben Gotow 05be74ec04 fix(read-receipts): Remove tracking pixels when composing drafts 2016-04-28 17:08:54 -07:00
John McNair dccf4f3ad3 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 8944e10ae9 fix(autolinker): Don't match emails that are also URLs #2071 2016-04-26 19:03:43 -07:00
Ben Gotow c5a77fa854 fix(autolinker): Use getAttribute('href') because href is magic 2016-04-26 17:01:15 -07:00
Ben Gotow aa42040813 fix(autolinker): Always override title attribute #2056 2016-04-26 16:49:33 -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
Ben Gotow bb71529322 fix(attachments): Don't show the paperclip for inline attachments < 3k (signatures, etc.) 2016-04-20 10:44:32 -07:00
Ben Gotow 36ab9d593b 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
Ben Gotow 0b4527bb03 fix(autoscale): Apply vw when width and height are not present 2016-04-07 18:02:04 -07:00
Juan Tejada cb46f8a9d8 fix(contact-sidebar): Don't render <select> when no contacts available 2016-04-07 09:57:53 -07:00
Juan Tejada 4c250640fe fix(react): Fix several warnings in missing imports 2016-04-05 14:53:37 -07:00
Ben Gotow d1b1c5bea2 fix(quoted-text): Correctly update container height 2016-04-05 14:27:54 -07: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
Ben Gotow 3d8133ff8d fix(inline): Use vw for max-width, use DOM rather than regex 2016-03-31 15:16:22 -07:00
Ben Gotow 78681f6ed1 fix(inline): radial progress, merge body with download data on render 2016-03-31 15:16:21 -07:00
Ben Gotow 39768fd9d4 bump(react): 0.13.2 => 0.14.7
Great breakdown of React changes here:
https://github.com/facebook/react/blob/master/CHANGELOG.md#0140-october-7-2015

Due to deprecation warnings, I don't think this will break third-party extensions unless they were doing really bad things.
2016-03-29 01:43:12 -07:00
Ben Gotow 75ff8282a8 perf(autolinker): Use requestIdleCallback to fix hanging on large bodies 2016-03-23 19:03:21 -07:00
Juan Tejada 9413459311 fix(styles): Fix styles for attachment and upload items 2016-03-23 17:16:25 -07:00
Ben Gotow 92bff6ca5a fix(drafts): Formalize draft factory, add reply "behaviors" #1722
Summary:
This diff implements a behavior change described in https://github.com/nylas/N1/issues/1722.

Reply buttons should prefer to focus an existing draft in reply to the same message, if one is pristine, altering it as necessary to switch between reply / reply-all. If no pristine reply is already there, it creates one.

Reply keyboard shortcuts should do the same, but more strictly - the shortcuts should switch between reply / reply-all for an existing draft regardless of whether it's pristine.

This diff also cleans up the DraftStore and moves all the draft creation itself to a new DraftFactory object. This makes it much easier to see what's going on in the DraftStore, and I also refactored away the "newMessageWithContext" method, which was breaking the logic for Reply vs Forward between a bunch of different helper methods and was hard to follow.

Test Plan: They're all wrecked. Will fix after concept is greenlighted

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2776
2016-03-22 15:47:51 -07:00
Juan Tejada 96846d4052 feat(download-all): Adds download-all button + style updates, more ES6
Summary:
- Adds initial version of download all button
- Converts attachments plugin to ES6 and adds updated styling
- Updates quoted text button
- #905, #1712

Test Plan: - Unit + manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2769
2016-03-21 18:23:26 -07:00
Juan Tejada e83bf2bbec feat(selection): Add new display for selection count + update toolbar
Summary:
- New behavior is that the in split mode, you will perform actions on
  the selection via the MessageListToolbar (the toolbar positioned above
  the message list)
- Refactored and moved around a bunch of code to achieve this:
  - Mostly renaming stuff and moving stuff around and removing some
    duplication
  - Update naming of toolbar role to a single role, and update relevant code
  - Converted and refactored a bunch of code into ES6, specifically to reuse the code for the ThreadActionsToolbar at the 2 locations
  - Deprecated MultiselectActionBar in favor of MultiselectToolbar
  - Deprecated old roles
- Punted the animation for the stackable cards in the selection display for now.
- #370

Test Plan: - Manual and unit tests

Reviewers: evan, drew, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2756
2016-03-21 12:20:11 -07:00