Summary:
We weren't properly keeping track of the focus state in the ComposerView which
would cause us to lose track of what was focused when plugins were eventually
loaded.
Test Plan: Run locally, verify that we don't lose focus
Reviewers: evan, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3801
Summary:
Occasionally, if the composer plugins took too long to load, the user would
start typing only to have their text blown away when the plugins finally came in.
This was caused by carelessly overwriting the TokenizingTextField's stored
inputValue state in componentWillReceiveProps. Now we don't do that!
Test Plan: Run locally, make sure things don't get blown away
Reviewers: evan, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3806
Summary:
This animation was changing the width of the after pseudoelement, which was
causing a lot of repainting and layout to occur in the very bottom corner of
the screen. This in turn caused an idle window to use 50-70% CPU all the
time during initial sync. The fix is to change the after element to three
spans and modify the animation to alter their opacity which avoids having to
do style and layout reflows due to width changes. It also looks slightly cooler
IMHO :-) An idle main window now sits around 8% CPU on my laptop.
Test Plan: Run locally, verify that CPU is lower.
Reviewers: evan, juan
Reviewed By: juan
Subscribers: halla
Differential Revision: https://phab.nylas.com/D3810
It looks like the location of the Flux architecture diagrams got moved around on the Flux docs; this change updates the link here to the new location of the diagram.
Summary:
Previously we were only debouncing one function in onContentChanged. This would
cause us to do very expensive things on every keypress in the things that
weren't debounced. This diff changes things so that we debounce the entire
process of running the spellchecker.
Test Plan:
Run locally, make sure spellchecker doesn't run on every keypress.
Misspell lots of things, type really quickly, paste large chunks of text
into the composer.
Reviewers: evan, spang, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3791
Summary: It is better to notify that a task failed rather than having a thread or group of threads randomly bounce back.
Test Plan: manual
Reviewers: evan, spang, mark, halla
Reviewed By: mark, halla
Subscribers: mark
Differential Revision: https://phab.nylas.com/D3790
Summary:
Users who only had a custom imap account could not open the window to
add a custom imap account the first time the auth was opened, rendering
the app useless for them.
Github issue #3185 and T7691
Test Plan: manual
Reviewers: halla, spang, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D3783
Summary:
These windows don't need to receive IPC until they're being used for something
(i.e. after transitioning from hot window to composer, popout, etc)
Test Plan:
Run locally w/ hot windows shown, make sure that hot window doesn't
receive IPC
Reviewers: evan, spang, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3780
Summary: See diff title
Test Plan: Run locally, check in htop for new titles
Reviewers: evan, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3778
Summary:
Adds a new `npm run test-window` that will launch specs in a window so you
can use the debugger
The spec window wouldn't close because `onbeforeunload` was unnecessarily
preventing close. This circumvents this in spec mode.
Most significantly I discovered we can't use the synchronous timer for the
promise scheduler anymore. Suppose you do:
```
it('should error', async () => {
try {
await doSomething()
throw new Error("doSomething should have thrown!")
} catch (err) {
expect(err.message).toMatch(/my message/)
}
})
```
The way async/await is transpiled, when `doSomething` throws, the error
will propagate all the way back up to the uncaughtPromiseException handler
before the `catch` gets called and registered. The transpilation method
assumes that when the function gets executed it can synchrously advance
beyond the call before the `then` or `catch` resolve. When the promise
scheduler is synchronous this doesn't happen.
I chose to use `setTimeout` instead of `process.nextTick` or
`setImmediate` as the promise scheduler. `setTimeout` seems to work better
with Chrome's async function call stacks. `nextTick` and `setImmediate`,
being Node methods, skip Chrome's async watchers.
Test Plan:
I talked with Juan about these changes, in an upcoming diff he will be
testing these in the context of our broader test suite.
Reviewers: mark, khamidou, halla, spang, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3779
Summary: This bumps the spellcheck and restores the specs
Test Plan:
Manually open a composer, type some text and ensure it underlines them as
misspelled. Also restore test coverage
Reviewers: mark, halla, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3776