Mailspring/static
Ben Gotow b4434f6617 fix(focus): Remove focusedField in favor of imperative focus, break apart ComposerView
Summary:
- Removes controlled focus in the composer!
  - No React components ever perfom focus in lifecycle methods. Never again.
  - A new `Utils.schedule({action, after, timeout})` helper makes it easy to say "setState or load draft, etc. and then focus"
  - The DraftStore issues a focusDraft action after creating a draft, which causes the MessageList to focus and scroll to the desired composer, which itself decides which field to focus.
  - The MessageList never focuses anything automatically.
- Refactors ComposerView apart — ComposerHeader handles all top fields, DraftSessionContainer handles draft session initialization and exposes props to ComposerView
  - ComposerHeader now uses a KeyCommandRegion (with focusIn and focusOut) to do the expanding and collapsing of the participants fields. May rename that container very soon.
- Removes all CommandRegistry handling of tab and shift-tab. Unless you preventDefault, the browser does it's thing.
- Removes all tabIndexes greater than 1. This is an anti-pattern—assigning everything a tabIndex of 0 tells the browser to move between them based on their order in the DOM, and is almost always what you want.
- Adds "TabGroupRegion" which allows you to create a tab/shift-tabbing group, (so tabbing does not leave the active composer). Can't believe this isn't a browser feature.

Todos:
- Occasionally, clicking out of the composer contenteditable requires two clicks. This is because atomicEdit is restoring selection within the contenteditable and breaking blur.
- Because the ComposerView does not render until it has a draft, we're back to it being white in popout composers for a brief moment. We will fix this another way - all the "return unless draft" statements were untenable.
- Clicking a row in the thread list no longer shifts focus to the message list and focuses the last draft. This will be restored soon.

Test Plan: Broken

Reviewers: juan, evan

Reviewed By: juan, evan

Differential Revision: https://phab.nylas.com/D2814
2016-04-04 15:22:01 -07:00
..
animations/inbox-zero fix(animations): Rename animations to use always lower case 2016-03-28 10:49:13 -07:00
components fix(focus): Remove focusedField in favor of imperative focus, break apart ComposerView 2016-04-04 15:22:01 -07:00
fonts/FontAwesome
images feat(calendar): add week view for quick scheduler 2016-04-04 15:05:48 -07:00
mixins 💄(sidebar): 1px fix for @drew ;-) 2016-02-24 21:06:06 -08:00
package-template fix(focus): Remove focusedField in favor of imperative focus, break apart ComposerView 2016-04-04 15:22:01 -07:00
sounds
variables fix(themes): Re-add disclosure triangles to Taiga 2016-03-24 16:19:41 -07:00
babelrc.json
buttons.less 🎨(preferences): Updates preferences to look prettier 2016-04-01 14:01:26 -07:00
dropdowns.less
email-frame.less feat(find-in-thread): add the ability to find in a thread 2016-03-02 14:46:27 -08:00
font-awesome.min.css
index.html fix(focus): Remove focusedField in favor of imperative focus, break apart ComposerView 2016-04-04 15:22:01 -07:00
index.js feat(dock-icon): Drop files to attach them to new msg 2016-03-17 13:14:55 -07:00
index.less feat(calendar): add week view for quick scheduler 2016-04-04 15:05:48 -07:00
inputs.less refactor(ui-variables): Clean UI variables for consistency/usage 2016-03-15 11:18:50 -07:00
jasmine.less Make test output selectable 2015-12-31 04:06:18 -08:00
linux.less
normalize.less
react-remote-child.html fix(themes): Add classes for toolbar elements 2016-03-11 16:55:28 -08:00
resizable.less
selection.less fix(sidebar): ui tweaks to narrow sidebar 2016-03-09 15:46:10 -05:00
type.less refactor(ui-variables): Clean UI variables for consistency/usage 2016-03-15 11:18:50 -07:00
utilities.less
workspace.less 🎨(themes): Fixes Windows button UI issues in #1649 2016-03-12 11:43:49 -08:00