Mailspring/internal_packages
Evan Morikawa d4ef6a20e5 feat(sidebar): Add thread list of currently selected participants
Summary:
WIP. I added a collection index to make displaying the threads of a
currently selected participant on the sidebar easy and fast.

The problem is that the `participants` of a thread, while a collection of
`Contact` objects, have no "ids" for those contact objects.

One idea was to create the join table but access contacts by email instead
of id. This required a minor change to the way the data is entered in the
join table.

This means the sidebar can now simply do:

`DatabaseStore.findAll(Thread).where(Thread.attributes.participants.contains('foo@bar.com'))`

While I didn't for this initial test, we could also/instead create the
`Message-Contact` join table. The trick about a Message-Contact table is
that I believe we'd have to create additional columns further specifying
which field we're interested in.

The following two queries:

`DatabaseStore.findAll(Message).where(Message.attributes.to.contains('foo@bar.com'))`

`DatabaseStore.findAll(Message).where(Message.attributes.from.contains('foo@bar.com'))`

would require additional columns in the `Message-Contact` join table
because currently the only columns are `id` and `value`.

In the case of the sidebar use case, I think the Thread participants is
what you want to see anyway.

Unfortunately an email-centric scheme can't distinguish between
`noreply@phab.com <Evan>` and `noreply@phab.com <Juan>`. I actually think
this may be a good thing since I think most people think in terms of email
address as the unique key anyway and for the use case of showing related
emails in the sidebar I'd rather overshow than undershow.

This solution seems to be working pretty well in initial testing, but I
want to see if you guys can think of anything this may subtly screw up
down the line, or if you can think of a simpler way to do this.

Test Plan: todo

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2687
2016-03-09 14:33:31 -05:00
..
account-error-header fix(sync-errors): Handle account deltas indicating sync issues 2016-03-08 16:06:04 -08:00
account-sidebar fix(remove-from-view): Fix logic for delete/remove-from-view behavior: 2016-03-07 18:16:37 -08:00
attachments 🎨: Smaller buttons, smaller toolbar, smaller text 2016-02-09 19:45:24 -08:00
category-picker remove(popover): Remove Popover in favor of FixedPopover 2016-03-09 10:05:46 -08:00
composer fix(composer): fix minor spacing issue on popout composer 2016-03-02 16:06:40 -08:00
composer-emojis Bump version for node-emoji 2016-03-02 18:58:07 -08:00
composer-signature es6(*): convert 20+ source files used in example packages to ES2016 2016-02-29 18:47:22 -08:00
composer-spellcheck lint(*): correct eslint errors, warnings still exist 2016-03-01 10:58:29 -05:00
composer-templates remove(popover): Remove Popover in favor of FixedPopover 2016-03-09 10:05:46 -08:00
composer-translate remove(popover): Remove Popover in favor of FixedPopover 2016-03-09 10:05:46 -08:00
events Merge branch 'master' into unified-inbox 2016-01-12 08:20:55 -08:00
github-contact-card es6(*): convert 20+ source files used in example packages to ES2016 2016-02-29 18:47:22 -08:00
link-tracking fix(lint): fix linter issues 2016-03-08 13:02:10 -05:00
message-autoload-images fix(autoload-images): Bar disappears when you choose to load images 2016-03-07 18:19:17 -08:00
message-list feat(sidebar): Add thread list of currently selected participants 2016-03-09 14:33:31 -05:00
message-view-on-github es6(*): convert 20+ source files used in example packages to ES2016 2016-02-29 18:47:22 -08:00
mode-switch 💄: White buttons, dropdown / popover cleanup, hairline dividers 2016-02-18 15:21:42 -08:00
notification-mailto fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
notification-update-available fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
notifications Merge branch 'master' into unified-inbox 2016-01-12 08:20:55 -08:00
onboarding feat(onboarding): update account-choose page 2016-03-04 16:53:26 -05:00
open-tracking fix(lint): fix linter issues 2016-03-08 13:02:10 -05:00
participant-profile feat(sidebar): Add thread list of currently selected participants 2016-03-09 14:33:31 -05:00
personal-level-indicators es6(*): convert 20+ source files used in example packages to ES2016 2016-02-29 18:47:22 -08:00
phishing-detection fix(phishing): Tie to MessageStore so it works when msgs aren't ready 2016-03-03 14:39:15 -08:00
plugins fix(plugin): better errors if plugins are malformed 2016-02-25 11:55:11 -08:00
preferences fix(sync-errors): Handle account deltas indicating sync issues 2016-03-08 16:06:04 -08:00
print 💄(print): Fix #1425 2016-02-26 14:40:16 -08:00
quick-schedule fix(error-handling): handle offline for link tracking & read-receipts 2016-02-24 16:06:08 -08:00
screenshot-mode feat(screenshot-mode): Minor fix to unmount method 2016-01-29 16:59:51 -08:00
search-bar 💄(search): Show focus around search input 2016-03-07 18:19:17 -08:00
send-and-archive fix(send-and-archive): Was disabling signatures due to name collision 2016-02-01 17:33:18 -08:00
send-later remove(popover): Remove Popover in favor of FixedPopover 2016-03-09 10:05:46 -08:00
sidebar-fullcontact feat(sidebar): Add thread list of currently selected participants 2016-03-09 14:33:31 -05:00
system-tray lint(system-tray): code style consistent with rest of file 2016-02-26 11:37:20 -05:00
theme-picker fix(theme-picker): Fix linter issues for ES6 2016-03-08 17:41:22 -08:00
thread-list remove(popover): Remove Popover in favor of FixedPopover 2016-03-09 10:05:46 -08:00
thread-snooze remove(popover): Remove Popover in favor of FixedPopover 2016-03-09 10:05:46 -08:00
ui-dark 💄 Minor visual tweaks to win32 + dark mode 2016-02-22 13:30:12 -08:00
ui-light feat(theme-selector): Add theme selector to preferences page 2015-12-15 10:29:58 -08:00
undo-redo fix(undo): Ensure undo bar dismisses after re-appearing 2016-02-05 19:11:27 -08:00
unread-notifications Revert "fix(sidebar): Correctly update sidebar when a notif is selected" 2016-02-02 10:58:24 -08:00
worker-sync fix(sync-errors): Handle account deltas indicating sync issues 2016-03-08 16:06:04 -08:00
worker-ui fix(feedback): Remove feedback btn, update "N1 Help" in menu bar 2016-02-24 13:49:15 -08:00