Commit graph

4371 commits

Author SHA1 Message Date
Ben Gotow d9ee12cf81 refactor(*): Thread list fixes, flexible workspace store, multiple root sheets
Summary:
Remember to remove all the event listeners added to email frame

New files tab, queryable filename, not attribute

Rename ThreadSelectionBar to RootSelectionBar to go with RootCenterComponent, make it appear for draft selection and file selection as well

Initial file list and file list store, File Location

Remove unnecessary shouldComponentUpdate

Always track whether new requests have happened since ours to prevent out of order triggers

Always scroll to the current [focused/keyboard-cursor] in lists

So goodbye to the trash tag

Only scroll to current item if focus or keyboard has moved

Show message snippet in notification if no subject line

Make the RootSelectionBar pull items from Component Registry

New Archive button (prettier than the other one)

Refactor event additions to iframe so iframe can be used for file display also

Thread List is no longer the uber root package - drafts and files moved to separate packages

WorkspaceStore now allows packages to register sheets, "view" concept replaced with "root sheet" concept, "mode" may not be observed by all sheets, and is now called "preferred mode"

Don't animate transitions between two root sheets

Mode switch is only visible on root sheets that support multiple modes

Account sidebar now shows "Views" that have registered themselves: drafts and files for now

Model Selection Bar is now a component, just like ModelList. Meant to be in the toolbar above a Model List

Misc supporting changes

New files package which registers it's views and components

Rename files package to `file-list`

Move checkmark column down into model list

Don't throw exception if shift-down arrow and nothing selected

Takes a long time on login to fetch first page of threads, make pages smaller

Displaynames, spec fixes

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1412
2015-04-10 14:33:05 -07:00
Evan Morikawa f7fe9a93c8 fix(uploads): upload files work in popout composers 2015-04-10 10:43:57 -07:00
Ben Gotow 232f23d428 fix(build): Never use .coffee extension in require statements 2015-04-08 19:35:38 -07:00
Ben Gotow 86f7d65034 feat(thread-list): Multiple selection, bulk actions, refactoring
Summary:
This diff provides multi-selection in the thread list powered by a new ModelList component that implements selection on top of ListTabular (or soon another List component). It includes business logic for single selection, shift selection, command-click selection, etc.

This diff also improves the performance of DatabaseView by assessing whether updates are required based on specific database changes and skipping queries in many scenarios.

WIP

WIP

Move selection into modelView instead of store

WIP

Preparing to convert to ModelList mixin

Make ThreadStore => ThreadListStore

Break the DraftStore in two (new DraftListStore) to avoid keeping all drafts in all windows

Get rid of unread instance variable in favor of getter that falls through to isUnread()

Much smarter logic in DatabaseView to prevent needless queries (especially counts and full invalidation of retained range)

Squashed commit of the following:

commit 486516b540e659735675765ca8b20d8a107ee2a9
Author: Ben Gotow <bengotow@gmail.com>
Date:   Tue Apr 7 17:30:23 2015 -0700

    Invalidate the retained range debounced

commit 7ac80403f52d108696c555f79c4c687d969f0228
Author: Ben Gotow <bengotow@gmail.com>
Date:   Tue Apr 7 17:30:16 2015 -0700

    Wait until after the view updates to move focus

commit 88d66eb19a9710847ff98bea22045bb686f30cc6
Author: Ben Gotow <bengotow@gmail.com>
Date:   Tue Apr 7 17:28:01 2015 -0700

    Bail out early when loading data if a reload has been requested

commit a49bedc44687040f7c675ff298376917a0b5fdcb
Author: Ben Gotow <bengotow@gmail.com>
Date:   Tue Apr 7 16:38:58 2015 -0700

    Log query data when in a query is being logged

commit c64a9e02f9072fd30edb98c45be581d6ac00c48a
Author: Ben Gotow <bengotow@gmail.com>
Date:   Tue Apr 7 16:38:45 2015 -0700

    Mark thread and messages as read in parallel instead of in sequence

commit 4b227100a795e20257cda0d60b00cc75b0000b0f
Author: Ben Gotow <bengotow@gmail.com>
Date:   Tue Apr 7 16:38:32 2015 -0700

    Don't load tags with hardcoded IDs from the database, and load them in parallel instead of in sequence

commit aeb7f1d646786cfa1c247fe78ce5467da07c4446
Author: Ben Gotow <bengotow@gmail.com>
Date:   Tue Apr 7 16:37:54 2015 -0700

    Pass objects instead of ids to thread methods—since we always have the most current thread anyway, this makes things a bit faster

commit e70889d1d05ece81a081b8b3f27b62491429b6f9
Author: Ben Gotow <bengotow@gmail.com>
Date:   Mon Apr 6 16:41:49 2015 -0700

    [icon] Paper airplanes

Restyle account sidebar, optimize tag count queries a bit more

Fix initialization issue with webkit image mask

Can't compare dates with is/isnt

Assets for check boxes

Bug fixes

Wrap ModelList instead of providing props

Verbose mode for database view

Fix existing specs

Six new specs covering invalidateIfItemsInconsistent

Test Plan: Run 40+ new tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1410
2015-04-08 19:25:00 -07:00
Ben Gotow 47069ab81d [icon] Paper airplanes 2015-04-06 16:41:49 -07:00
Ben Gotow 523ed4b316 feat(thread-list): Inifite scrolling, powered by new DatabaseView, InboxSyncWorker
Summary:
NamespaceStore needs to be more careful about triggering unnecessarily

ThreadListParticipants should use minimum set of <span> tags, not one per name

FocusedTagStore triggers only when the tag has actually changed

New InboxSyncWorker is responsible for fetching contacts, calendars, threads

Update the draft list to look like the thread list

ThreadStore now uses a "Database View" to vend items, which will free it up to focus on things like selection soon. The DatabaseView handles pagination and maintains a cache of items in a "retained range" the view needs. It also abstracts the...

..."thread metadata" concept into a general purpose pattern

Thread-list package implements SearchView to match the DatabaseView. Instead of fetching items from the database it uses the search API

Update existing specs

Bug fix

Specs for focused stores

New specs!

Pad search range so we prefetch the next pages

Clear the scroll offset if the view is changed (between tabs)

Test Plan: Run 58 new tests with 110 new assertions!

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1398
2015-04-06 11:46:20 -07:00
Ben Gotow 622688e1ef [api] Move from nilas -> nylas for endpoints 2015-04-06 10:15:36 -07:00
Ben Gotow 4497de634e fix(analytics): Add Mixpanel alias, don't store @id locally 2015-04-03 18:51:19 -07:00
Ben Gotow 402e481b31 fix(win32/linux) Quit when the user closes the last window. Was broken because of hidden windows
Test Plan: Run on win32/linux

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1386
2015-04-03 10:08:12 -07:00
Ben Gotow 80afdcb7fa fix(templates): Minor fixes for templating footer actions 2015-03-31 18:58:14 -07:00
Ben Gotow eb27c7cd1b fix(message-list): Revert changes causing message list to appear before content ready and scrolled 2015-03-31 17:23:16 -07:00
Evan Morikawa 33a33eedca fix(specs): remove unnecessary trigger 2015-03-31 17:20:17 -07:00
Ben Gotow d15b5080fb fix(stores): FocusedThreadStore, FocusedTagStore, speed improvements
Summary:
ThreadStore is now in the thread-list package.

Account sidebar no longer has random stuff dealing with search, no longer maintains selection apart from FocusedTagStore

Thread nav buttons are in the thread package

Account sidebar pulls selection from FocusedTagStore, no longer fires an Action to select Inbox, which was weird

Thread store is in thread-list package. No longer has any selection concept -> moved to FocusedThreadStore. Also looks at database changes to do "shallow" updates when only threads and not messages have changed, or when only messages of a few...

...threads have changed.

WorkspaceStore now handles both pushing AND popping the thread sheet. So all sheet behavior is here.

ThreadStore => FocusedThreadStore, selectThreadId => selectThread

Include all models in inbox-exports

It actually takes a long time to call Promise.reject because Bluebird generates stack traces. Resolve with false instead (100msec faster!)

Cache the model class map. All the requires take ~20msec per call to this method

ThreadList looks at FocusedThreadStore for selection

FocusedThreadStore, FocusedTagStore

Updated specs

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1384
2015-03-31 17:19:17 -07:00
Evan Morikawa 911d7f961d fix:(specs) for message list 2015-03-31 17:04:10 -07:00
Evan Morikawa 231f31ecf7 refactor(message-list): much faster message list loading
Summary:
custom options with tests

speed changes

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1383
2015-03-31 16:32:14 -07:00
Ben Gotow 4d3e5c4938 fix(participants): Paste contacts with names, and lots of specs
Summary:
- You can now paste Ben Imposter (imposter@nilas.com).
- You can now paste an email and we look up a matching name in the Contact Store

Test Plan: Run glorious new specs

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1378
2015-03-31 15:54:16 -07:00
Evan Morikawa 5796e2665c feat(message-list): tracks when at the bottom and pane resizes
Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1377
2015-03-31 14:31:01 -07:00
Ben Gotow c09d6dba77 fix(animations): Don't process API data while animations are in-flight
Summary:
Expose the animation coordinator in Nilas-exports, use in more places

Provide a way for queries to individually bypass waiting (messages query when opening thread)

Test Plan: No new tests to see here yet

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1376
2015-03-30 18:08:38 -07:00
Ben Gotow 6ebe1118eb Immediately blow up if the user passes incorrect query params
Summary: If state.selectedId is null, or otherwise cannot find item, don't throw exception

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1373
2015-03-30 17:25:08 -07:00
Evan Morikawa f19f178e3c feat(search): escape will blur and clear search
Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1374
2015-03-30 16:43:38 -07:00
Evan Morikawa 0a7843c6e7 feat(toolbar): long urls make a longer toolbar
Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1375
2015-03-30 16:41:01 -07:00
Ben Gotow 48e293e146 fix(drag): Resize bars losing mosueup when over iframes 2015-03-30 14:54:49 -07:00
Evan Morikawa 18165d5ebb fix(spec): fix thread list participants name undefined error
Summary:
A change in the spec caused an error when message metatdata wasn't
available. The specs were also not updated to reflect the change.

fix thread list participants spec
fix thread list spec

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1372
2015-03-30 11:21:23 -07:00
Ben Gotow 24b29fd397 fix(thread-list): Email not ready when _prepareColumns runs 2015-03-27 18:23:34 -07:00
Ben Gotow 115f0b7735 fix(tags): Don't request unread count for * 2015-03-27 18:12:54 -07:00
Ben Gotow a764c160d1 fix(dnd): Update react-dnd package 2015-03-27 16:57:27 -07:00
Ben Gotow 9b3bcac256 feat(report): Message list actions for phoning home bad text content
Summary: Little feature

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1365
2015-03-27 16:38:34 -07:00
Ben Gotow a10f86a3a2 feat(all-mail): Add special case * tag for all mail
Summary: This one is a bit interesting. We want to allow the user to view "All Mail", which is essentially "threads, with no tags query whatsoever." Rather than try to make `null` a valid selected tag Id, I used `*` as a "magic" tag id which is interpreted by the ThreadStore to mean "no tags where clause." Definitely a hack, but simpler than trying to make the account sidebar properly select "all mail" when selectedTagId = null.

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1360
2015-03-27 16:37:42 -07:00
Ben Gotow d0d96f90f5 feat(unread-notifications): Check that unread messages are in inbox
Summary: When we get unread messages, grab their threads and then make sure they're in the inbox before notifying.

Test Plan: See updated specs!

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1361
2015-03-27 16:37:13 -07:00
Ben Gotow 23e9d8ccf5 rm(contextual-menu-manager): See details for reasoning
Summary:
Atom provides a ContextualMenuManager which auto-generates contextual menus based on CSS rules, which fire commands. This is conceptually cool since it allows for extendable contextual menus, but A) it uses commands and B) it doesn't play nicely with React components.

This diff removes this manager object completely. Instead, React components can create contextual menus for themselves and dispatch actions / make local changes as they see fit.

If we want to allow people to extend our contextual menus, we can come up with a new solution that is not based on them having a `cson` file referencing a CSS Selector string that they don't own, and using strings for everything.

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1362
2015-03-27 16:36:16 -07:00
Ben Gotow 6c7760c7e3 fix(reply-area): Use existing flexbox so message-wrap and reply area never competing for clickability
Summary: Just a couple CSS tweaks

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1364
2015-03-27 16:35:55 -07:00
Evan Morikawa 9859e594f2 feat(composer): typing at the end of the composer tracks scrolling
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
2015-03-27 19:35:27 -04:00
Evan Morikawa 286fdcfad9 feat(icons): mac hover state shows icons
Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1359
2015-03-27 19:35:15 -04:00
Ben Gotow 7c298aa158 fix(performance): Thread-list re-renders too often
Summary:
Freeze threads on their way out of the ThreadStore

Don't add an unread attribute to contacts by accident...

Don't pass inline functions as props that are looked at by _isEqual

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1367
2015-03-27 16:34:59 -07:00
Ben Gotow 5826d0dd37 fix(displayWindow): Don't display on all selection changes, just when clicking notifications 2015-03-27 15:24:26 -07:00
Ben Gotow cef394b2a3 fix(thread-store): Don't bother fetching if no threadId. Causing ?thread_id= 400 error 2015-03-27 14:21:03 -07:00
Ben Gotow bb38651c44 fix(destroy-draft): Do not throw exception deleting non-existent draft 2015-03-27 14:21:03 -07:00
Evan Morikawa 59d378781b fix(composer): better html paste regex 2015-03-27 13:33:20 -04:00
Ben Gotow a0d2cc1785 feat(spellcheck): Turn on atom spellchecker, new contextual menu
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
2015-03-27 10:12:56 -07:00
Evan Morikawa 5bcefd23ba feat(notifications): can select a thread from any view
Summary:
The issue was that when selecting a thread id, it was not loaded in the
current list of items in the ThreadList and failing to come up.

The notifications now pass a property that the AccountSidebarStore listens
for to indicate what tag we think is most likely to contain the thread
that we're directly trying to access.

Eventually the correct data set may be loaded that contains the thread we
want. In the meantime, the requested selectedThreadId may or may not
resolve to an actual selectedThread object. If we detect that the
requested thread came into scope, we trigger another action to notify
everyone that the thread is now available. We also pass along a force
flag since this is a case when the requested thread id hasn't changed

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1353
2015-03-26 22:07:31 -04:00
Evan Morikawa cdfaf5cf77 feat(reply): don't reply to yourself
Summary:
If the last message was sent by you, and you reply to it, you probably
want to talk to you the most recent people you tried to email.

Now with test coverage :)

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1356
2015-03-26 22:07:21 -04:00
Evan Morikawa 1c56e5c15b fix(composer): get rid of extra blank lines on paste
Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1357
2015-03-26 22:07:13 -04:00
Ben Gotow e5f3f3087b fix(draft-store-proxy): Centralize check for body 2015-03-26 18:28:11 -07:00
Ben Gotow 7e6d5b64d8 fix(logs): Minor tweaks to prevent react logging 2015-03-26 18:25:21 -07:00
Evan Morikawa 9a0fce22c4 fix(lint): fix linting css errors 2015-03-26 14:49:03 -04:00
Evan Morikawa 3f55979beb feat(threads): in split mode select the first thread if none selected
Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1354
2015-03-26 14:46:26 -04:00
Evan Morikawa ee51602b26 feat(selection): by default nothing is selectable.
Summary:
Now all elements by default have selection set to inherit with the root
level body object set to no selection.

This makes everything (except input elements) not selectable by default.

You can explicitly set the css class or use the new `.selectable` class.

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1355
2015-03-26 14:39:42 -04:00
Evan Morikawa e728e5990a feat(attachments): forwarded messages get attachments too
Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1351
2015-03-25 21:25:08 -04:00
Ben Gotow dff5465931 fix(*) Small visual tweaks and fixes - see summary
Summary:
ThreadStore should be done loading as soon as threads are available

SearchSuggestionStore should use ContactsStore for contact results

Contact Store should not "filter all, take 10" it should only filter until it has 10. It should also check against "Ben Gotow" as well as "Ben" and "Gotow", so I can type "Ben Go"

Sometimes participants are "Ben Gotow <ben@g.com>", "ben@g.com". If we get zero contacts after removing Me, put "Me" back in...

Fix "Update Available" notification, broken reference to `atom.views.getView(atom.workspace)`

A bit more debugging around cursors. Need to handle this case soon.

Only use atomWorkspace if it exists.

Fix for dragging next to / around toolbar window controls

Consolidate the display of Contacts in menus into a single MenuItem subclass

Update Template Popover styling

fetchFromCache should only remove thread loading indicator *IF* it found results in the cache. Doh...

Give the thread list "Name" column a fixed width (mg)

Better styling of message list collapsed mode, rage against user selection and cursor: pointer

Occasionally admin.inboxapp.com returns bogus data

Sebaastian feedback on thread list

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1350
2015-03-25 18:22:52 -07:00
Evan Morikawa c04d8a6a93 fix(lint): fix minor linting errors 2015-03-25 16:01:22 -04:00