Commit graph

110 commits

Author SHA1 Message Date
Ben Gotow 5b014c3fda bump(version): 0.3.8 2015-09-22 14:43:59 -07:00
Ben Gotow ae9a804614 bump(version): 0.3.7 2015-09-20 10:34:27 -07:00
Ben Gotow 2ff8fdc30c bump(version): 0.3.6
Lots of bug fixes! See the commit history for more details. Many fixes in this release were reported from Sentry / user testing on Sept 8.
2015-09-10 19:01:15 -07:00
Ben Gotow 3a24c13d2c bump(version): 0.3.5
- Important flag for Gmail
- Fixes for drafts not disappearing
- Subject line display
2015-09-08 17:16:51 -07:00
Evan Morikawa 582da68fff bump(version): 0.3.4
Critical fix to popout drafts
2015-09-06 14:58:35 -07:00
Ben Gotow f685505fe7 bump(version): 0.3.3
- Critical fix for broken search drill-down
2015-09-04 15:45:46 -07:00
Ben Gotow a067d734e7 bump(version) 0.3.2
+ Starred view
+ All new spellcheck!
+ Loading screen
+ Lots of bug fixes!

Fixes:
- Forwarding messages with files
- Mode toggle now opens/closes sidebar
- Min-width is more appropriate
- Mixpanel analytics fixes
- Better draft sending errors, timeout errors
- Improvements to quoted text display, more edge cases handled
- Mailto: links that launch the app work properly
- Fix for database busy errors
- Message items resize when their container is resized
- Message items now populate HTML doctype, fixing some rendering issues
- We now sanitize HTML in replies and forwards to avoid potential issues
- Valid email addresses can now contain `=`
- Folder and label names in the sidebar wrap nicely
- Undo/redo in the composer no longer triggers task undo/redo
- EdgeForce is now in it's own repository
- Worker process moves expensive syncing out of hte main window
- 404s from the server correctly purge items from the database
- Lots more minor changes!
2015-09-04 13:43:18 -07:00
Ben Gotow cfbbf717fa fix(mixpanel): Critical fix for mixpanel users all having the same distinct_id alias
Summary: Mixpanel API misuse makes me sad.

Test Plan: No tests, but easy to check with Mixpanel.com

Reviewers: dillon, evan

Reviewed By: dillon, evan

Differential Revision: https://phab.nylas.com/D1978
2015-09-03 19:30:08 -07:00
Evan Morikawa ba76663f5e feat(composer): sanitizes and inlines CSS styles for replies and fwd 2015-09-01 11:53:38 -07:00
Evan Morikawa 7ebf9afac0 bump(version): 0.3.1 2015-08-25 14:03:27 -04:00
Ben Gotow 58572ad416 downgrade(electron): Also fix less issue on Linux 2015-08-24 18:55:40 -07:00
Ben Gotow 8be765d9b7 bump(version): 0.3.0
- Multiple account support!
   + Known issue: Unread badge shows only currnetly selected account
   + Known issue: Canceling add account flow quits the app

- You can now create bullets and lists in the composer

- Fix for mail sent yesterday appearing to be sent "now"

- Third-party plugins can now define tasks and database models
2015-08-24 18:14:00 -07:00
Ben Gotow 607ca3bf10 feat(accounts): Kill namespaces, long live accounts
Summary:
This diff replaces the Namespace object with the Account object, and changes all references to namespace_id => account_id, etc. The endpoints are now `/threads` instead of `/n/<id>/threads`.

This diff also adds preliminary support for multiple accounts. When you log in, we now log you in to all the attached accounts on edgehill server. From the preferences panel, you can auth with / unlink additional accounts. Shockingly, this all seems to pretty much work.

When replying to a thread, you cannot switch from addresses. However, when creating a new message in a popout composer, you can change the from address and the SaveDraftTask will delete/re-root the draft on the new account.

Search bar doesn't need to do full refresh on clear if it never committed

Allow drafts to be switched to a different account when not in reply to an existing thread

Fix edge case where ChangeMailTask throws exception if no models are modified during performLocal

Show many dots for many accounts in long polling status bar

add/remove accounts from prefs

Spec fixes!

Test Plan: Run tests, none broken!

Reviewers: evan, dillon

Reviewed By: evan, dillon

Differential Revision: https://phab.nylas.com/D1928
2015-08-21 15:29:58 -07:00
Ben Gotow 9811b2646c bump(version): 0.2.5
Features:
- Preferences! You can now change all kinds of things from Menu > Preferences, including:
  + Key binding sets (Gmail, Outlook, Mail.app)
  + Theme (light or dark)
  + Mark-as-read delay
  + Attachment downloading policy
  + Sounds and notifications
  + Default reply behavior
- Layout and theme are now remembered when you re-launch Nylas Mail
- You can now star the message under the keyboard cursor by pressing 'S'

Performance:
- Creating drafts is now much faster on long threads

Fixes:
- "Hover and Archive" is now displayed correctly
- Signing in with an email with capitalization ("BEN@Nylas.com") no longer breaks subtle things
- Messages sent yesterday are now shown with relative time (2:31PM, 12 hours ago)
- NylasSyncWorker now backs off when it encounters network failure
- On Windows, the database is deleted properly when you log out
- Archiving now properly sends mail to All Mail in Gmail
- Images inside some emails now render without becoming distorted
- Mailto link handling is now case-insensitive
2015-08-18 10:57:37 -07:00
Ben Gotow ceaaac962f bump(version): 0.2.4
- Perf:
    + Mail actions like starring and changing folders are significantly faster
    + Messages and drafts load faster in large mailboxes thanks to better indexing and query management
    + Ingesting changes from the Nylas API no longer floods the database with queries

- Features:
    + Emails with forms and other interactive elements are now supported
    + Drafts now have a blue focus ring, which makes it easier to see keyboard focus
    + Contact search now matches email domains
    + Command-option-F now highlights the search bar

- Bug fixes:
    + Downloading large attachments will no longer crash the app
    + Window focus / blur state is now correctly reflected in the toolbar
    + Emails with some specific image tags now render with the correct height
    + Undoing star/unstar changes to a group of threads now restores previous state correctly
    + The 'send' animation in the message list is now glitch-free
    + Thread participant parsing handles more edge cases
    + Loading "dots" no longer cover the thread list in some scenarios
    + Rapidly creating and destroying drafts no longer causes React errors
2015-08-10 18:09:03 -07:00
Ben Gotow 3228b0df7e bump(version): 0.2.3
- Threads sort the same way they do in Gmail, by "last message received"
- We now use native SQLite bindings, and SQLite 3.8.11.1, which is 22% faster
- We now display an affordance for undoing changes to threads
- Scroll handling in the message list is much better
- Contact chips have been overhauled in the composer, and are now editable
- Contact autocompletions are better, and based on frequency of use
- Messages wrap better in many scenarios
- More than 20 bug fixes!

We now have more than 1,000 specs for Nylas Mail.
2015-08-03 19:46:38 -07:00
Ben Gotow a4d7c737c7 bump(version): 0.2.2
- Fix script/bootstrap error
2015-07-26 13:54:17 -07:00
Ben Gotow 27637325fa bump(version) 0.2.1
Bug fix for broken dependency building
2015-07-24 19:18:30 -07:00
Ben Gotow 55161e90f7 bump(version) 0.2.0 - see release notes!
- Labels and folders!
    + Multicolor labels for Gmail users, folders for everyone else
    + View and remove labels in message view
    + Move mail into labels or folders using the new picker
    + Move mail into labels or folders in the sidebar via drag and drop
    + "Folder" in expanded message headers
- New icons and style tweaks
- Tracking pixel detection
    + We no longer "view" tracking pixels in your sent mail
- React Component hot-loading
- Hide Sidebar button (design is temporary)
- Draft syncback to the Nylas API
- Today view has been sunset for now
- Quoted text stripping has been rebuilt
    + No longer removes quoted text between inline responses
    + Now supports more quoted text formats
- Lots of bug fixes!
2015-07-24 17:09:00 -07:00
Ben Gotow b6dc7f0c9b feat(hotloading): CJSX hotloading when running in dev mode
Summary:
# Conflicts:
#	static/components/tokenizing-text-field.less

Wat no

Test Plan: Tested with ci build

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T1216

Differential Revision: https://phab.nylas.com/D1804
2015-07-24 14:10:48 -07:00
Ben Gotow 4be05ff754 feat(tracking-pixels): New MessageStore extension cuts out tracking pixels you've *sent* so you don't trigger them
Summary:
- Remove thread_participants prop, we don't use them anywhere and the underscore-case is ugly.

- Move autolinker into extension, update autolinker to 0.18.1 for phone number support

- document message.coffee, add isFromMe()

- Add tracking pixel extension that removes pixels from mail you *send*. Maybe more features later.

Test Plan: Run 1 new test! (woo...)

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1787
2015-07-23 10:57:13 -07:00
Ben Gotow 17fcdc4eaf bump(version): 0.1.11 2015-07-20 10:39:03 -07:00
Evan Morikawa 00c74cd1a9 WIP: This is the initial diff for new folders & labels.
Summary:
There are now two objects, Folders & Labels. These inherit from `Category`
(that's what Eben said they were using on the backend).

There are two separate tasks.

1. MoveToFolderTask
2. ApplyLabelsTask

It turns out that the semantics between the two are quite different.
The reverse operation for moving to a folder is a bit tricky.

As of 7-8-15, the Tasks are pretty much complete. I need to write tests
for them still and do some manual testing in the client.

Test Plan: Writing specs

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1724
2015-07-16 11:54:20 -04:00
Ben Gotow aeb83c3c50 bump(version): 0.1.10 2015-07-15 20:08:19 -07:00
Ben Gotow b0f93dc52c fix(drag-n-drop): Remove react-dnd, display dropzone, allow tokens to be dragged out of app as plaintext
React-dnd is a nice library but it assumes it's going to be the only thing managing your drag and drop in the entire app. It also hides the underlying dataTransfer object so it's difficult to implement native drag and drop behaviors other than for Files and Urls, which they special-case.

Implementing it manually really isn't hard, and we can do things like attach a text/plain version of contact data to the contact drag.

Fixes T2054
2015-07-15 20:06:11 -07:00
Ben Gotow 162aab8d37 bump(version): 0.1.9
New In This Release:
- Reply/Reply-All keyboard shortcuts now update existing draft rather than creating another new one.
- Extensions can adjust new drafts before they're displayed
- Signatures extension! (signatures still need to be setup manually)
- Pristine drafts are discarded correctly when you leave a thread in two-pane mode
- Fix for "destroy draft" task failing
- Fix for "double sending" issue
- Upgrade to Electron 0.29.2
- New "Show / hide quoted text" control
- Bug fixes
2015-07-14 12:27:17 -07:00
Ben Gotow 1794111041 bump(electron): 0.29.2 and a few minor bug fixes
Summary:
Saving only 50 models at a time instead of 100 fixes a reproducible issue with database errors during initial sync on my machine. With 100, it reports "unexpected ; on line 2123..." during the query.

Only the main window should update the unread badge count.

Test Plan: Tests still pass and it seems like everything is still functional.

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1736
2015-07-13 16:28:06 -07:00
Evan Morikawa de110d4556 bump(version): 0.1.8 2015-07-09 14:32:14 -07:00
Ben Gotow 069c145442 bump(version): 0.1.7 2015-07-06 16:02:20 -04:00
Ben Gotow 398771674c bump(version): 0.1.6 2015-06-26 17:58:14 -07:00
Ben Gotow 4d4b942c94 bump(version): 0.1.5 2015-06-26 13:26:45 -07:00
Evan Morikawa cd9ccd85e2 refactor(DB): promisify database
Summary:
WIP. The app launches and works for me. I still need to fix the tests
just the DB ones though :D

I changed the `DatabaseProxy` into a `DatabaseConnection` object. It will
request a fully instantiated databse from the backend Browser.

If we're already setup, it'll connect straight to the existing DB.

If we're not setup, then it'll create a new database and run the inital
schema migration on it. The `_createNewDatabase` promise won't resolve
until the migration has run.

Until we add in a more sophisticated migration system and get rid of the
stupid `modelClassMap` that's shoved in `Utils`, I'm passing in a series
of `_setupQueries()` to get everything started.

The `DatabaseConnection` is also the one responsible for queuing up
queries until the DB is fully populated and ready to go.

We actually get a lot of queries before we're setup because a lot of
Stores will make DB requests on `require` in their `constructor` or `init`
methods. (remember all the times we call `_populateStore` in `init`).

Now those queries are aggregated by the `DatabaseConnection` and then
executed sequentially.

Our methods like `persistModel` now resolve only after both the queries
have completed AND their corresponding `triggerLater` has completed as
well.

Test Plan: in progress

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1688
2015-06-26 07:42:41 -07:00
Evan Morikawa 2e9a2ac167 feat(salesforce): new UI for Salesforce
Summary:
style opportunity picker and placeholder on tokenizing text fields

UI for synced opportunities

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1655
2015-06-17 20:40:08 -07:00
Evan Morikawa c9029b0b89 v0.1.2 2015-06-15 18:48:42 -07:00
Ben Gotow 9e38e104bd upgrade(electron): 0.28.1. Improvements to webview, clipboard on linux 2015-06-15 11:22:42 -07:00
Evan Morikawa 5c988377eb fix(thread-list): narrow mode isn't hidden 2015-06-12 13:31:30 -07:00
Evan Morikawa 48f1cc80d6 feat(update): autoupdater adds an updateLevel param
Summary:
There's now an `updateLevel` that can be set in the config file.

It has the valid values of "major", "minor", "patch", and "commit". By
default it upgrades on the "patch" level.

If you want to be on the bleeding edge, manually change the config file to
add `updateLevel: 'commit'`

Test Plan: A new `auto-update-manager-spec` :)

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1567
2015-06-11 12:23:31 -07:00
Ben Gotow bb2c1e30a7 bump(electron): Electron 0.27.1, Chromium 43
Summary:
0.27.1? Nope webview still broken

Update atom-keymap

As of Chromium 42, you cannot subclass CustomEvent or Event using Object.create(event). This caused the CommandRegistry to break. Creating a new object with the properties of the event seems to work fine.

Resolves "Deprecated attempt to access property 'target' on a non-Event object.
dispatchEvent
fireCustomEventevent-test.html:8
global codeevent-test.html:21
event-test.html:8" in Safari and "TypeError: Illegal Invocation" in Chromium

Test Plan: Tests still pass

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1584
2015-06-01 15:21:40 -07:00
Ben Gotow a2116f6c1a fix(linux): Closes T1392, updating spellchecker library to be ASAR-aware 2015-05-22 12:06:26 -07:00
Evan Morikawa 0588b0c7eb refactor(code): replace all instances of atom-shell and AtomShell and atomShell
Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1537
2015-05-20 10:20:10 -07:00
Ben Gotow 8133cc88d6 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
Evan Morikawa fc4b3b56d7 refactor(utils): switch to regular underscore
Summary:
Fixes: T1334

remove final InboxApp references

move out all underscore-plus methods

Mass find and replace of underscore-plus

sed -i '' -- 's/underscore-plus/underscore/g' **/*.coffee
sed -i '' -- 's/underscore-plus/underscore/g' **/*.cjsx

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1534
2015-05-19 16:06:59 -07:00
Evan Morikawa ae41c94e42 refactor(draft): clean up draft store session proxy logic
Summary:
This is an effort to make the logic around the process of sending a draft
cleaner and easier to understand.

Fixes T1253

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T1253

Differential Revision: https://phab.nylas.com/D1518
2015-05-19 12:07:08 -07:00
Ben Gotow 684a8ef4c0 [naming] Nylas Mail => Nylas, Nilas => Nylas 2015-05-18 19:21:54 -07:00
Ben Gotow 2464888d28 fix(naming): Mac menus and Info.plist should say Nylas Mail 2015-05-16 11:12:43 -07:00
Ben Gotow 68343ec472 feat(docs): New docs tasks and React 0.13.2
Summary:
This diff moves us up to React 0.13.2 and transitions some of the core React components to the new
syntax based on plain Javascript objects. `setInitialState` is now just code in the constructor,
`getDOMNode(@)` is now `React.findDOMNode(@)`, and `isMounted` is no longer necessary or available.

This diff also adds `RegisteredComponent` to match `RegisteredRegion`. In another diff,
I think we should change the names of these to be `DynamicComponent` and `DynamicComponentSet`.

This diff also includes preliminary API Reference docs for Menu.cjsx and Popover.cjsx. You can build the docs
using `grunt docs` from the build folder. It produces a simple html format now, but it's easy
to customize.

Also we now ignore "Unnecessary fat arrow"

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1437
2015-04-24 11:33:10 -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 a764c160d1 fix(dnd): Update react-dnd package 2015-03-27 16:57:27 -07:00
Ben Gotow a0d2cc1785 feat(spellcheck): Turn on atom spellchecker, new contextual menu
Summary:
Pending issues:
- As you're typing, Atom Shell says the word you're currently typing is misspelled until you finish it. I will need to patch Atom Shell to fix this.

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1358
2015-03-27 10:12:56 -07:00
Evan Morikawa 809033c601 feat(analytics) add Mixpanel
Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1299
2015-03-13 20:05:55 -04:00
Evan Morikawa b479e099c1 feat(messages): expandable message headers
Summary: feat(messages): expandable message headers

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1267
2015-03-09 11:17:22 -07:00
Ben Gotow d8dbe90c97 fix(windows): Windows build changes 2015-03-05 13:19:24 -08:00
Ben Gotow d6336dae08 Squashed commit of deeply broken branch
commit d1c455515e04424d429c87a07aff248a4a767f23
Merge: 72e5536 512f8db
Author: Ben Gotow <bengotow@gmail.com>
Date:   Thu Feb 19 18:42:29 2015 -0800

    Merge sheet and flexbox components, fonts, and more

    Conflicts:
    	static/workspace-view.less

commit 72e553652f5b26a96155c51e04db46baafb916be
Author: Ben Gotow <bengotow@gmail.com>
Date:   Wed Feb 18 12:33:08 2015 -0800

    Start transitioning to a better set of ui-variables (from bootstrap)

commit ed22fb7fe1c6544af44fae69b83e7e63965ddf4d
Author: Ben Gotow <bengotow@gmail.com>
Date:   Wed Feb 18 11:55:58 2015 -0800

    I hate CSS

commit 512f8db414ceef74712c9d63ba5a67b44cf778c4
Author: Ben Gotow <bengotow@gmail.com>
Date:   Mon Feb 16 10:10:44 2015 -0800

    Initial work on top toolbar

commit c2d7a0e0a2f6f6ebe254cca24ad0735336d57b70
Author: Ben Gotow <bengotow@gmail.com>
Date:   Thu Feb 12 18:47:26 2015 -0800

    New UI Prototype interaction / stores for sheets
2015-03-03 09:49:15 -08:00
Evan Morikawa e8533d8903 fix(composer): focus on creation and sanitize paste
Summary:
focuses on draft when replying

focus on to field on new composer

santize html on paste in contentedtiable

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1177
2015-02-16 17:09:28 -08:00
Evan Morikawa 637d5928e6 fix(ui): upgrade packages, minor ui/ux fixes
Summary:
fix keymaps and add archive-and-previous

test for star thread

focus bcc and cc

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1174
2015-02-10 11:10:14 -08:00
Evan Morikawa a48e5ac3ec fix(packages): upgrade package versions to fix io.js bug 2015-02-09 10:29:58 -08:00
Ben Gotow 73b99880fd refactor(*): Remove Atom package dependecies and Atom styles!
Test Plan: Run existing tests

Reviewers: evan

Differential Revision: https://review.inboxapp.com/D1160
2015-02-06 16:57:33 -08:00
Ben Gotow e4889b390f refactor(participants): Use DragDropMixin, Menu
Summary:
This diff replaces the participant text fields with ones based on TokenizingTextField, a new core
component that handles autocompletion, drag and drop of tokens, etc.

Fix large queries overloading SQLite size limits

New general purpose tokenized text field with token selection, copy paste, etc

Move pre-send logic to the view since DraftStore requests from db, which may not have settled

Tests - still a WIP

Support for contextual menus instead of X

Test Plan: Run new tests. Needs many more, but have higher priority things to fix

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1142
2015-02-06 14:46:30 -08:00
Ben Gotow b189afeeaf fix(drafts): Rename files inbox-composer =>composer 2015-02-03 17:16:25 -08:00
Ben Gotow 1e8fd46342 fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:

1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
   - View thread with draft, edit draft
   - Move to another thread
   - Move back to thread with draft
   - Move to another thread. Notice that one or more messages from thread with draft are still there.

There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.

2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:

   - In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.

   - Previously, when you added a contact to To/CC/BCC, this happened:

     <input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates

Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.

To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!

This diff includes a few minor fixes as well:

1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React

Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1125
2015-02-03 16:24:31 -08:00