Mailspring/spec-nylas/stores
Ben Gotow ded4da1505 fix(draft-speed): Optimize draft creation and reduce scroll / focus delays
Summary:
This diff attempts to improve the responsiveness of the app when you hit "Reply". This is achieved by being smarter about creating the draft and loading it into the draft store, and also by allowing the compose* actions to take objects instead of just IDs (resulting in a fetch of the object).

Allow Actions.composeReply,etc. to optionally be called with thread and message objects instead of IDs. This prevents a database lookup and the data is "right there."

Create DraftStoreProxy for new drafts optimistically—this allows us to hand it the draft model we just created and it doesn't have to go query for it

When we create a new Draft, immediately bind it to a LocalId. This means that when the MessageStore receives the trigger() event from the Database, it doesn't have to wait while a localId is created

When MessageStore sees a new Message come in which is on the current thread, a draft, and not in the localIds map, assume it's a new draft and shortcut fetchFromCaceh to manually add it to the items array and display. This means the user sees the...

...draft instantly.

Remove delays from focusing draft, scrolling to draft after content is ready. I actually removed these thinking it would break something, and it didn't break anything.... Maybe new Chromium handles better?

Fix specs

Test Plan: Run specs - more in progress right now

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1598
2015-06-05 11:38:30 -07:00
..
contact-store-spec.coffee refactor(utils): switch to regular underscore 2015-05-19 16:06:59 -07:00
database-store-spec.coffee refactor(utils): switch to regular underscore 2015-05-19 16:06:59 -07:00
draft-store-spec.coffee fix(draft-speed): Optimize draft creation and reduce scroll / focus delays 2015-06-05 11:38:30 -07:00
focused-contacts-store-spec.coffee fix(naming): Move atom/inbox/nilas refs to Nylas 2015-05-15 11:07:28 -07:00
focused-content-store-spec.coffee refactor(utils): switch to regular underscore 2015-05-19 16:06:59 -07:00
focused-tag-store-spec.coffee refactor(utils): switch to regular underscore 2015-05-19 16:06:59 -07:00
metadata-store-spec.coffee fix(naming): Move atom/inbox/nilas refs to Nylas 2015-05-15 11:07:28 -07:00
namespace-store-spec.coffee fix(mailto): Handle mailto on application launch, populate NamespaceStore synchronously 2015-05-21 18:08:29 -07:00
task-queue-spec.coffee fix(asar): Support ASAR, and running of specs in prod builds 2015-05-21 14:41:30 -07:00