Summary:
This diff centralizes logic for creating common tasks for things like moving to trash, archive, etc. TaskFactory exposes a set of convenience methods and hides the whole "and also remove the current label" business from the user.
This diff also formally separates the concept of "moving to trash" and "archiving" so that "remove" isn't used in an unclear way.
I also refactored where selection is managed. Previously you'd fire some action like archiveSelection and it'd clear the selection, but if you selected some items and used another method to archive a few, they were still selected. The selection is now bound to the ModelView as intended, so if items are removed from the modelView, they are removed from it's attached selection. This means that it shouldn't /technically/ be possible to have selected items which are not in view.
I haven't refactored the tests yet. They are likely broken...
Fix next/prev logic
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D2157
Summary:
This started when I noticed that drafts weren't dissapearing from the
draft list after send. This was a pretty big bug because if you ever
clicked on one again and tried to re-send it would throw a 400 error
saying the draft id doesn't exist.
This uncovered a few fundamental issues with the DB.
First of all, the reason the draft list wasn't updating was because the DB
trigger that happened when we got in a new message, was being ignored
since the diff contained no drafts (it's now a message).
The bigger issue was that if you had a draft with only a clientId, gave it
a serverId, and tried to call "save", the REPLACE INTO method would not
update the old object, but rather create a second duplicate. This is
because the `id` field was being used as the PRIMARY KEY, and in this
case, that `id` field changed! The fix was to change the PRIMARY KEY to be
the `cilent_id` instead of the `id` and use that as the REPLACE INTO
index.
We still need the `id` field; however, because all of our reads depend on
that field usually being the serverId
Fixes T3507
Test Plan: See new and updated tests
Reviewers: dillon, bengotow
Reviewed By: bengotow
Maniphest Tasks: T3507
Differential Revision: https://phab.nylas.com/D1992
Summary:
This diff replaces the Namespace object with the Account object, and changes all references to namespace_id => account_id, etc. The endpoints are now `/threads` instead of `/n/<id>/threads`.
This diff also adds preliminary support for multiple accounts. When you log in, we now log you in to all the attached accounts on edgehill server. From the preferences panel, you can auth with / unlink additional accounts. Shockingly, this all seems to pretty much work.
When replying to a thread, you cannot switch from addresses. However, when creating a new message in a popout composer, you can change the from address and the SaveDraftTask will delete/re-root the draft on the new account.
Search bar doesn't need to do full refresh on clear if it never committed
Allow drafts to be switched to a different account when not in reply to an existing thread
Fix edge case where ChangeMailTask throws exception if no models are modified during performLocal
Show many dots for many accounts in long polling status bar
add/remove accounts from prefs
Spec fixes!
Test Plan: Run tests, none broken!
Reviewers: evan, dillon
Reviewed By: evan, dillon
Differential Revision: https://phab.nylas.com/D1928
Summary:
Fixes: T1334
remove final InboxApp references
move out all underscore-plus methods
Mass find and replace of underscore-plus
sed -i '' -- 's/underscore-plus/underscore/g' **/*.coffee
sed -i '' -- 's/underscore-plus/underscore/g' **/*.cjsx
Test Plan: edgehill --test
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D1534
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