Mailspring/spec
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
..
components remove(popover): Remove Popover in favor of FixedPopover 2016-03-09 10:05:46 -08:00
extensions fix(quick-schedule): Update to use new APIs, remove leftover docs 2016-03-18 10:43:43 -07:00
fixtures es6(tasks): send, syncback and specs converted to ES6 2016-03-17 16:23:53 -07:00
models 🎨(query-subscription): Update query subscription 2016-03-18 14:33:18 -07:00
services feat(paste): Paste accepts more HTML, paste and match style now available 2015-12-07 15:34:03 -08:00
stores fix(drafts): Formalize draft factory, add reply "behaviors" #1722 2016-03-22 15:47:51 -07:00
tasks fix(tray): Use total count, not unread count, for tray icon 2016-03-21 17:36:18 -07:00
action-bridge-spec.coffee refactor(env): new NylasEnv global 2015-11-17 16:41:20 -08:00
auto-update-manager-spec.coffee bump(electron): 0.34.3 => 0.35.1 2015-11-23 22:09:17 -08:00
buffered-process-spec.coffee refactor(spec) move spec-nylas to spec 2015-10-01 21:39:44 -07:00
clipboard-spec.coffee refactor(env): new NylasEnv global 2015-11-17 16:41:20 -08:00
component-registry-spec.coffee refactor(spec) move spec-nylas to spec 2015-10-01 21:39:44 -07:00
database-object-registry-spec.coffee refactor(spec) move spec-nylas to spec 2015-10-01 21:39:44 -07:00
date-utils-spec.es6 fix(date-utils): Add localization to date formats 2016-03-07 16:44:54 -08:00
dom-utils-spec.coffee refactor(spec) move spec-nylas to spec 2015-10-01 21:39:44 -07:00
extension-registry-spec.coffee update(extensions): Rename DraftStoreExtension and MessageStoreExtension 2015-11-30 16:08:05 -08:00
jasmine-helper.coffee refactor(spec): remove spectron from main app 2015-12-02 13:42:09 -08:00
jasmine-jquery.js refactor(dir): move exports to src/global and consolidate tests 2015-10-02 09:19:37 -07:00
jasmine.js refactor(dir): move exports to src/global and consolidate tests 2015-10-02 09:19:37 -07:00
launch-services-spec.coffee refactor(spec) move spec-nylas to spec 2015-10-01 21:39:44 -07:00
list-selection-spec.coffee feat(outbox): Sending status now appears beside drafts 2016-02-04 14:14:24 -08:00
mail-rules-processor-spec.coffee fix(mail-rules): Catch and disable mail rules building bad actions 2015-12-28 18:39:06 -08:00
mailbox-perspective-spec.es6 fix(remove-from-view): Fix logic for delete/remove-from-view behavior: 2016-03-07 18:16:37 -08:00
menu-manager-spec.coffee refactor(env): new NylasEnv global 2015-11-17 16:41:20 -08:00
module-cache-spec.coffee fix(specs): Update specs following 0.29.2 > 0.34.3 move 2015-11-17 17:40:06 -08:00
n1-spec-reporter.coffee 🎨: Smaller buttons, smaller toolbar, smaller text 2016-02-09 19:45:24 -08:00
nylas-api-spec.coffee fix(syncback): Bidirectional transforms, ready-to-send saved state 2016-03-16 19:27:12 -07:00
nylas-env-spec.coffee refactor(env): new NylasEnv global 2015-11-17 16:41:20 -08:00
nylas-protocol-handler-spec.coffee fix(specs): Update specs following 0.29.2 > 0.34.3 move 2015-11-17 17:40:06 -08:00
nylas-test-utils.coffee Fix CategoryPicker specs 2016-01-11 13:23:59 -08:00
package-manager-spec.coffee refactor(env): new NylasEnv global 2015-11-17 16:41:20 -08:00
package-spec.coffee refactor(env): new NylasEnv global 2015-11-17 16:41:20 -08:00
quoted-html-transformer-spec.coffee feat(quote): add new quoted text detector for quote strings 2016-03-03 17:30:36 -08:00
quoted-plain-text-transformer-spec.coffee feat(paste): Paste accepts more HTML, paste and match style now available 2015-12-07 15:34:03 -08:00
spec-bootstrap.coffee bump(*): Electron 0.36.7, version to 0.4.6 2016-02-08 18:35:23 -08:00
spec-helper-platform.coffee fix(drafts): Various improvements and fixes to drafts, draft state management 2015-02-03 16:24:31 -08:00
spec-helper.coffee fix(tracking): fix link tracking and read receipt plugins 2016-02-24 12:30:12 -08:00
spec-suite.coffee refactor(env): new NylasEnv global 2015-11-17 16:41:20 -08:00
spellchecker-spec.coffee fix(spellcheck): let win < 8 fallback to hunspell 2015-12-11 16:41:41 -05:00
style-manager-spec.coffee refactor(spec) move spec-nylas to spec 2015-10-01 21:39:44 -07:00
styles-element-spec.coffee refactor(env): new NylasEnv global 2015-11-17 16:41:20 -08:00
task-factory-spec.es6 fix(remove-from-view): Fix logic for delete/remove-from-view behavior: 2016-03-07 18:16:37 -08:00
theme-manager-spec.coffee feat(tasks): add Create, Update, Destroy tasks plus spec & lint fixes 2016-01-15 15:16:21 -05:00
time-override.coffee feat(tests): add integration tests 2015-12-02 13:41:14 -08:00
time-reporter.coffee refactor(utils): switch to regular underscore 2015-05-19 16:06:59 -07:00
undo-manager-spec.coffee fix(composer): support Chinese & others - handle composition events 2015-10-30 20:03:33 -04:00
utils-spec.coffee fix(trash/spam): New inAllMail filter applied to all mailbox views except trash and spam 2016-03-10 12:41:32 -08:00