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-04 08:24:31 +08:00
|
|
|
{
|
2017-09-06 04:37:40 +08:00
|
|
|
"name": "mailspring",
|
|
|
|
"productName": "Mailspring",
|
2023-12-11 02:24:04 +08:00
|
|
|
"version": "1.13.2",
|
2019-06-11 08:15:07 +08:00
|
|
|
"repository": {
|
|
|
|
"type": "git",
|
|
|
|
"url": "git://github.com/foundry376/mailspring.git"
|
|
|
|
},
|
2017-08-23 12:49:45 +08:00
|
|
|
"commitHash": "COMMIT_INSERTED_DURING_PACKAGING",
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
"description": "The best email app for people and teams at work",
|
2016-10-27 21:36:10 +08:00
|
|
|
"license": "GPL-3.0",
|
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-04 08:24:31 +08:00
|
|
|
"main": "./src/browser/main.js",
|
|
|
|
"dependencies": {
|
2022-04-18 10:20:33 +08:00
|
|
|
"app-module-path": "^2.2.0",
|
2019-06-11 14:48:25 +08:00
|
|
|
"@bengotow/slate-edit-list": "github:bengotow/slate-edit-list#b868e108",
|
2023-10-10 03:20:19 +08:00
|
|
|
"@electron/remote": "^2.0.9",
|
2023-11-15 04:40:51 +08:00
|
|
|
"better-sqlite3": "^8.0.1",
|
2021-12-02 01:01:15 +08:00
|
|
|
"cheerio": "^1.0.0-rc.6",
|
2016-05-28 05:05:27 +08:00
|
|
|
"chromium-net-errors": "1.0.3",
|
2021-12-02 01:01:15 +08:00
|
|
|
"chrono-node": "^1.1.2",
|
|
|
|
"classnames": "1.2.1",
|
2021-11-25 01:02:40 +08:00
|
|
|
"cld": "2.7.1",
|
2021-12-02 01:01:15 +08:00
|
|
|
"collapse-whitespace": "^1.1.6",
|
2017-03-31 08:26:33 +08:00
|
|
|
"debug": "github:emorikawa/debug#nylas",
|
2019-02-09 18:29:23 +08:00
|
|
|
"deep-extend": "0.6.0",
|
2016-04-13 01:27:24 +08:00
|
|
|
"emoji-data": "^0.2.0",
|
2019-02-05 13:54:38 +08:00
|
|
|
"enzyme": "^3.8.0",
|
2021-12-02 01:01:15 +08:00
|
|
|
"enzyme-adapter-react-16": "^1.9.0",
|
|
|
|
"event-kit": "^1.0.2",
|
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-04 08:24:31 +08:00
|
|
|
"fs-plus": "^2.3.2",
|
2017-08-01 11:20:01 +08:00
|
|
|
"getmac": "^1.2.1",
|
2021-12-02 01:01:15 +08:00
|
|
|
"graceful-fs": "^4.1.11",
|
2019-02-10 09:53:56 +08:00
|
|
|
"ical-expander": "^2.0.0",
|
2019-02-10 03:52:39 +08:00
|
|
|
"ical.js": "^1.3.0",
|
Totally overhauled composer based on Slate (#524)
* Remove the composer contenteditable, replace with basic <textarea>
* Beginning broader cleanup of draft session
* DraftJS composer with color, style support
* Serialization/unserialization of basic styles, toolbar working
* WIP
* Switch to draft-js-plugins approach, need to revisit HTML
* Move HTML conversion functionality into plugins
* Add spellcheck context menu to editor
* Initial work on quoted text
* Further work on quoted text
* BLOCK approach
* Entity approach - better, does not bump out to top level
* Hiding and showing quoted text via CSS
* Get rid of ability to inject another subject line component
* Clean up specs, DraftFactory to ES6
* Remove old initial focus hack
* Fix focusing, initial text selection
* Remove participant “collapsing” support, it can be confusing
* Correctly terminate links on carriage returns
* Initial signature support, allow removal of uneditable blocks
* Sync body string with body editorstate
* Simplify draft editor session, finish signatures
* Templates
* Minor fixes
* Simplify link/open tracking, ensure it works
* Reorg composer, rework template editor
* Omg the slowness is all the stupid emoji button
* Polish and small fixes
* Performance improvements, new templates UI
* Don’t assume nodes are elements
* Fix for sending drafts twice due to back-to-back saves
* Fix order of operations on app quit to save drafts reliably
* Improve DraftJS-Convert whitespace handling
* Use contentID throughout attachment lifecycle
* Try to fix images
* Switch to Slate instead of DraftJS… much better
* Fix newline handling
* Bug fixes
* Cleanup
* Finish templates plugin
* Clean up text editing / support for Gmail email styles
* Support for color + size on the same node, clean trailing whitespace
* Restore emoji typeahead / emoji picker
* Fix scrolling in template editor
* Fix specs
* Fix newlines
* Re-implement spellcheck to be faster
* Make spellcheck decorator changes invisible to the undo/redo stack
* Remove comment
* Polish themplates panel
* Fix #521
2018-01-12 07:55:56 +08:00
|
|
|
"immutable": "^3.8.2",
|
2021-12-02 01:01:15 +08:00
|
|
|
"ini": "^1.3.5",
|
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-04 08:24:31 +08:00
|
|
|
"jasmine-json": "~0.0",
|
2015-11-18 08:25:58 +08:00
|
|
|
"jasmine-react-helpers": "^0.2",
|
2017-02-11 07:33:42 +08:00
|
|
|
"jasmine-reporters": "1.x.x",
|
2021-04-11 12:36:21 +08:00
|
|
|
"juice": "^7.0.0",
|
2021-12-02 01:01:15 +08:00
|
|
|
"less-cache": "1.1.0",
|
|
|
|
"lru-cache": "^4.0.1",
|
2021-12-01 04:14:55 +08:00
|
|
|
"mammoth": "1.4.19",
|
2015-02-10 02:29:58 +08:00
|
|
|
"mkdirp": "^0.5",
|
2019-02-05 13:54:38 +08:00
|
|
|
"moment": "^2.24.0",
|
2016-04-11 07:37:33 +08:00
|
|
|
"moment-round": "^1.0.1",
|
2021-12-02 01:01:15 +08:00
|
|
|
"moment-timezone": "^0.5.32",
|
2016-04-25 01:16:25 +08:00
|
|
|
"mousetrap": "^1.5.3",
|
2016-11-10 06:24:10 +08:00
|
|
|
"node-emoji": "^1.2.1",
|
2022-08-09 06:34:18 +08:00
|
|
|
"node-fetch": "^2.6.0",
|
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-04 08:24:31 +08:00
|
|
|
"optimist": "0.4.0",
|
2016-09-25 03:27:49 +08:00
|
|
|
"pick-react-known-prop": "0.x.x",
|
2021-12-02 01:01:15 +08:00
|
|
|
"proxyquire": "1.3.1",
|
2017-09-02 14:22:35 +08:00
|
|
|
"raven": "2.1.2",
|
2021-12-02 01:01:15 +08:00
|
|
|
"react": "16.6.0",
|
|
|
|
"react-color": "^2.17.0",
|
|
|
|
"react-dom": "16.6.0",
|
|
|
|
"react-test-renderer": "16.6.0",
|
2018-01-24 09:35:09 +08:00
|
|
|
"react-transition-group": "1.2.1",
|
2021-12-02 01:01:15 +08:00
|
|
|
"reflux": "0.1.13",
|
|
|
|
"rimraf": "2.5.2",
|
|
|
|
"rtlcss": "2.4.0",
|
2017-02-18 04:11:14 +08:00
|
|
|
"rx-lite": "4.0.8",
|
2020-04-22 13:12:49 +08:00
|
|
|
"slate": "github:bengotow/slate#cd6f40e8",
|
2019-06-11 14:07:46 +08:00
|
|
|
"slate-auto-replace": "0.12.1",
|
2021-12-02 01:01:15 +08:00
|
|
|
"slate-base64-serializer": "0.2.100",
|
2019-06-11 14:07:46 +08:00
|
|
|
"slate-html-serializer": "0.7.39",
|
|
|
|
"slate-plain-serializer": "0.6.39",
|
2021-12-02 01:01:15 +08:00
|
|
|
"slate-prop-types": "0.5.30",
|
2019-07-27 01:15:08 +08:00
|
|
|
"slate-react": "github:bengotow/slate#0.45.1-react",
|
2019-06-11 08:15:07 +08:00
|
|
|
"slate-soft-break": "^0.9.0",
|
|
|
|
"slate-when": "^0.2.0",
|
2019-01-01 08:43:09 +08:00
|
|
|
"snarkdown": "1.2.2",
|
2021-12-02 01:01:15 +08:00
|
|
|
"source-map-support": "^0.3.2",
|
2015-02-11 03:10:14 +08:00
|
|
|
"temp": "^0.8",
|
2016-11-10 06:24:10 +08:00
|
|
|
"tld": "^0.0.2",
|
2021-12-01 04:11:12 +08:00
|
|
|
"underscore": "^1.13.1",
|
2019-02-05 13:54:38 +08:00
|
|
|
"underscore.string": "^3.3.5",
|
2017-10-04 05:12:49 +08:00
|
|
|
"utf7": "^1.0.2",
|
2019-03-05 03:03:12 +08:00
|
|
|
"uuid": "^3.0.0",
|
2021-12-02 01:01:15 +08:00
|
|
|
"vcf": "^2.0.5",
|
2021-01-19 14:17:28 +08:00
|
|
|
"windows-iana": "^4.2.1",
|
2019-01-01 08:43:09 +08:00
|
|
|
"windows-shortcuts": "emorikawa/windows-shortcuts#b0a0fc7",
|
2021-12-02 01:01:15 +08:00
|
|
|
"xlsx": "0.14.1"
|
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-04 08:24:31 +08:00
|
|
|
},
|
2016-10-28 05:44:33 +08:00
|
|
|
"optionalDependencies": {
|
2021-11-29 06:09:33 +08:00
|
|
|
"macos-notification-state": "^1.3.6",
|
2022-04-06 23:36:05 +08:00
|
|
|
"windows-quiet-hours": "^2.0.0"
|
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-04 08:24:31 +08:00
|
|
|
}
|
|
|
|
}
|