Mailspring/internal_packages
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
..
account-sidebar feat(unread/spam): New items in the sidebar for unread and spam 2016-04-19 11:32:33 -07:00
attachments
category-picker fix(focus): Remove focusedField in favor of imperative focus, break apart ComposerView 2016-04-04 15:22:01 -07:00
composer refactor(composer): Make session, draft available everywhere 2016-04-19 16:05:15 -07:00
composer-emoji fix(composer-emoji): Fix calculation for category positioning 2016-04-12 14:51:56 -07:00
composer-scheduler refactor(composer): Make session, draft available everywhere 2016-04-19 16:05:15 -07:00
composer-signature 🎨(preferences): Adjust textbox styles for signatures and templates 2016-04-07 14:12:35 -07:00
composer-spellcheck
composer-templates refactor(composer): Make session, draft available everywhere 2016-04-19 16:05:15 -07:00
composer-translate refactor(composer): Make session, draft available everywhere 2016-04-19 16:05:15 -07:00
draft-list feat(unread/spam): New items in the sidebar for unread and spam 2016-04-19 11:32:33 -07:00
events bump(electron): 0.36.7 => 0.37.5 2016-04-12 18:42:57 -07:00
github-contact-card
link-tracking refactor(composer): Make session, draft available everywhere 2016-04-19 16:05:15 -07:00
message-autoload-images
message-list feat(unread/spam): New items in the sidebar for unread and spam 2016-04-19 11:32:33 -07:00
message-view-on-github fix(view-on-github): Add readme and fix bug 2016-04-14 17:03:57 -04:00
mode-switch
notification-mailto
notification-update-available fix(require): Move more requires to new electron format 2016-04-13 15:35:01 -07:00
notifications fix(db): Counts no longer require Thread table join 2016-04-11 13:51:31 -07:00
onboarding fix(onboarding): Add missing return statement when changing endpoints 2016-04-13 17:41:31 -07:00
open-tracking refactor(composer): Make session, draft available everywhere 2016-04-19 16:05:15 -07:00
participant-profile fix(related-threads): Show snippet in addition to subject #1683 2016-04-14 17:33:43 -04:00
personal-level-indicators
phishing-detection
plugins 🎨(preferences): Change spacing and button sizes 2016-04-07 14:32:51 -07:00
preferences fix(default-alias): Show primary email instead of "None", clarify only for new messages currently 2016-04-15 19:05:54 -04:00
print
screenshot-mode
send-and-archive
send-later refactor(composer): Make session, draft available everywhere 2016-04-19 16:05:15 -07:00
sidebar-fullcontact
system-tray
theme-picker fix(theme-picker): Reformat invalid class names 2016-04-05 13:43:43 -07:00
thread-list feat(unread/spam): New items in the sidebar for unread and spam 2016-04-19 11:32:33 -07:00
thread-search feat(unread/spam): New items in the sidebar for unread and spam 2016-04-19 11:32:33 -07:00
thread-search-index feat(thread-search): Make thread search indexing smarter 2016-04-07 09:57:29 -07:00
thread-snooze fix(focus): Remove focusedField in favor of imperative focus, break apart ComposerView 2016-04-04 15:22:01 -07:00
ui-dark
ui-darkside
ui-light
ui-taiga
ui-ubuntu
undo-redo
unread-notifications
worker-sync fix(sync): Handle "Invalid cursor" scenario by 💣🔥 away the cache 2016-04-11 17:34:52 -07:00
worker-ui fix(require): Move more requires to new electron format 2016-04-13 15:35:01 -07:00