Summary: This is still a work in progress and needs more specs
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1808
Summary:
We need to remove quoted text completely from bodies in a composer.
Unfortunately, that makes it very difficult to determine how to put it
back in.
For now the scheme is to append the quoted text at the end. However, that
means that we need to only pull out quoted text at the end of a message.
Unfortunately there are lots of places that quoted text appears inline
with regular text.
Determining whether or not some content is at the "end" of a message
turned out to be non-trivial.
We now have a new `DOMUtils` that looks for empty areas at the end.
We also have a new quoted HTML parser that finds trailing quotes.
Fixes T2335
Test Plan: lots of new quoted text tests
Reviewers: bengotow
Reviewed By: bengotow
Maniphest Tasks: T2335
Differential Revision: https://phab.nylas.com/D1773
Summary:
The issue was that on every key stroke the whole composer, participants
and all, were getting re-rendered. According to React.perf, the
`TokenizingTextField`s were taking a very long time to render and never
changing. This was fixed by adding a simple `shouldComponentUpdate` check.
The composer also has several regions that only change when the `props`
do. These are now cached. The cache reset when the `props` do.
After all of that, rendering the whole composer still takes 20-40ms. If
you're tying in the composer very quickly, text entry can approach that
render time. This starts to stack multiple React rendering passes up and
bogs the whole system down.
Luckily, we can simply render the composer less frequently. Now, after
changes are persisted to the `DraftStoreProxy`, we simply debounce the
proxy `trigger`. The users don't see this because the native
`contenteditable` field will update immediately. When the debounced proxy
trigger fires, it will transparently update the view to the latest state.
Test Plan: edgehill --test
Reviewers: bengotow
Reviewed By: bengotow
Subscribers: mg
Differential Revision: https://phab.nylas.com/D1749
Summary:
Fixes T1990
Change the ScrollRegion component so that you can optionally provide a getScrollbar prop that resolves to a ScrollRegion.Scrollbar component. This allows you to easily put the Scrollbar outside of the ScrollRegion if necessary.
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Maniphest Tasks: T1990
Differential Revision: https://phab.nylas.com/D1665
Summary:
Silence buffered process spec
Clean up error reporter and spec bootup
fix errors in draft store spec
package manager spec and theme spec fixes
Fix memory leak in draft store
Test Plan: mmmmmm tests. Run all those green passing tests :)
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D1628
Summary: You can now add file attachments by pasting them.
Test Plan: Run 3 new specs! We only had specs for sanitization so I added some for the paste event handler as well.
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1604
Summary:
Fix T1822 - saving templates not working, not showing template
Fix T1800 - give composers a minimum size
Fix the bottom bar of the composer so the gray bar goes all the way across in popout mode.
Fix T1825 - switch to a more attractive "June 4, 2015 at 3:10 PM" styling for expanded dates
Remove, rather than hide, react components for text fields in composer. Fixes T1147
Fix specs
Switch to 999+ instead of infinity. Fixes T1768
Fix broken TemplateStore specs
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Maniphest Tasks: T1147, T1768, T1822, T1800, T1825
Differential Revision: https://phab.nylas.com/D1601
Summary:
Fixes T1327
Fixes T1294
Fixes T1307
Fixes T1207
- More robus Undo Manager
- Scrolls to the most recent undo location
- Fixes a variety of bugs when the composer's cursor ends up in an unsupported
location
- Fixes auto-scroll detection at end of content
Test Plan: edgehill --test
Reviewers: bengotow
Reviewed By: bengotow
Maniphest Tasks: T1207, T1294, T1307, T1327
Differential Revision: https://phab.nylas.com/D1529
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
Summary: This resolves T1187 — pasting plain text and html now work pretty well
Test Plan: Run new test case
Reviewers: evan
Reviewed By: evan
Maniphest Tasks: T1187
Differential Revision: https://review.inboxapp.com/D1511
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
Summary:
When you're typing at the end of the composer, then the composer should
look like it's scrolling along with you.
When you're typing in the middle of the composer, if the footer
inforamtion scrolls past the end of the page, then that's fine.
When the selection changes, the contenteditable component now caches
whether or not the selection is at the end of the content. It has to do it
at this point, otherwise the cloned, cached DOM nodes of the saved
selection are not the same nodes that will show up in the future.
Whether the cursor is at the end is queried by the composer on a body
change. If it is, then the composer expects a callback from its parent
(the message list), to call to update the scroll position.
The message list immediately updates the scroll position to move the
bottom of the composer to the bottom of the message-wrap window.
Test Plan: edgehill --test
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://review.inboxapp.com/D1366
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
Summary:
quoted text add and remove at filter level
fix double space quoted text issue when replying to message
Test Plan: edgehill --test
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://review.inboxapp.com/D1341
Summary:
fix(keymappings): Enter to focus item, logout works now
Minor fix for some problems with activity bar
Fix tabindex = 1 where tabindex should be =-1
Remove idgen that was causing footers to be replaced
WIP
Draft store extension hooks
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1320
Summary:
toolbar popup displays
restore caret protection on contenteditable
BAD - can't use cursor saving and restoring with react :(
_findNode works
saves and restores cursor state
contenteditable fixes to support cursor
comments on cursor
initial undo manager
extract undo manager and move up in stack
make undo manager a mixin
adding selection snapshots in composer
fixes in undo manager
selection saves selection states properly
move UndoManager and fix draft
selection state can now select backwards
selection works backwards and click not overridden
change bold class to allow for bolding and unbolding
styling of hover component
can set links in composer
bold and italic clicking works. text seleciton works
show link modal on hover
selection fixes
Test Plan: TODO
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://review.inboxapp.com/D1249
Summary:
Use blockquote, apply gmail's styling
Fix in popout composer so the ... button rests at the bottom
Test Plan: Need to figure out the best strategy for tests here - will write tomorrow
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1197
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
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