Mailspring/static/components
Ben Gotow f1c0a1615d 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
..
button-dropdown.less refactor(ui-variables): Clean UI variables for consistency/usage 2016-03-15 11:18:50 -07:00
contenteditable.less 🎨(floating-toolbar): Fix height for floating toolbar pointer 2016-02-24 17:25:57 -08:00
date-input.less test(plugins): Add snooze and send later specs 2016-03-03 12:38:42 -08:00
disclosure-triangle.less fix(themes): Re-add disclosure triangles to Taiga 2016-03-24 16:19:41 -07:00
editable-list.less refactor(ui-variables): Clean UI variables for consistency/usage 2016-03-15 11:18:50 -07:00
empty-list-state.less fix(empty-states): Adjust margins for message correctly 2016-03-25 17:49:33 -07:00
extra.less feat(download-all): Adds download-all button + style updates, more ES6 2016-03-21 18:23:26 -07:00
fixed-popover.less feat(popover): Add popout animation to popover 2016-03-31 13:23:12 -07:00
generated-form.less refactor(ui-variables): Clean UI variables for consistency/usage 2016-03-15 11:18:50 -07:00
key-commands-region.less feat(keymap): add new <KeymapHandlers /> 2015-11-06 11:47:06 -08:00
list-tabular.less fix(thread-list): Invisible div extending into thread list blocks clicks 2016-02-24 20:05:21 -08:00
menu.less refactor(ui-variables): Clean UI variables for consistency/usage 2016-03-15 11:18:50 -07:00
modal.less 🎨(theme-picker): Adjust styles 2016-03-10 15:18:57 -08:00
nylas-calendar.less feat(calendar): add week view for quick scheduler 2016-04-04 15:05:48 -07:00
outline-view.less fix(sidebar): Only show add folder icon on hover 2016-02-24 16:11:00 -08:00
popover.less fix(composer-buttons): Fix broken icons on overflow, make buttons wrap 2016-02-25 12:30:20 -08:00
scroll-region.less feat(find-in-thread): add the ability to find in a thread 2016-03-02 14:46:27 -08:00
spinner.less fix(spinner): Improve loading indicator style / tweening 2015-12-09 15:47:51 -08:00
switch.less 🎨(preferences): Updates preferences to look prettier 2016-04-01 14:01:26 -07:00
tokenizing-text-field.less fix(focus): Remove focusedField in favor of imperative focus, break apart ComposerView 2016-04-04 15:22:01 -07:00
unsafe.less fix(lint): fix linter errors with latest land 2015-04-30 18:27:39 -07:00