Mailspring/internal_packages/thread-list/lib
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
..
category-removal-target-rulesets.es6 fix(remove-from-view): Fix logic for delete/remove-from-view behavior: 2016-03-07 18:16:37 -08:00
injects-toolbar-buttons.jsx feat(selection): Add new display for selection count + update toolbar 2016-03-21 12:20:11 -07:00
main.cjsx feat(selection): Add new display for selection count + update toolbar 2016-03-21 12:20:11 -07:00
message-list-toolbar.jsx bump(react): 0.13.2 => 0.14.7 2016-03-29 01:43:12 -07:00
selected-items-stack.jsx fix(selection): Make the clear selection button a button 2016-03-24 10:57:12 -07:00
thread-list-columns.cjsx fix(thread-list): Show emoji in bolded subject lines 2016-03-27 15:51:27 -07:00
thread-list-context-menu.es6 fix(drafts): Formalize draft factory, add reply "behaviors" #1722 2016-03-22 15:47:51 -07:00
thread-list-data-source.coffee feat(outbox): Sending status now appears beside drafts 2016-02-04 14:14:24 -08:00
thread-list-icon.cjsx feat(tooltip): use native tooltip style 2015-10-21 11:27:57 -07:00
thread-list-participants.cjsx fix(contact): Converge on displayName(), don't show account label in ThreadList. Fixes #1157 2016-02-01 19:12:06 -08:00
thread-list-quick-actions.cjsx fix(gmail-labels): Constraint so threads always belong to all,spam or trash 2016-03-10 14:13:31 -08:00
thread-list-scroll-tooltip.cjsx feat(selection): Add new display for selection count + update toolbar 2016-03-21 12:20:11 -07:00
thread-list-store.coffee fix(search): Display search API errors in transient notiication bar 2016-03-24 15:42:05 -07:00
thread-list-toolbar.jsx feat(selection): Add new display for selection count + update toolbar 2016-03-21 12:20:11 -07:00
thread-list.cjsx bump(react): 0.13.2 => 0.14.7 2016-03-29 01:43:12 -07:00
thread-toolbar-buttons.cjsx fix(focus): Remove focusedField in favor of imperative focus, break apart ComposerView 2016-04-04 15:22:01 -07:00