Commit graph

206 commits

Author SHA1 Message Date
Ben Gotow 0ef4911b22 Merge branch 'master' into unified-inbox
# Conflicts:
#	internal_packages/feedback/lib/feedback-button.cjsx
#	internal_packages/thread-list/lib/thread-list.cjsx
#	src/flux/stores/draft-store.coffee
2016-01-25 17:28:29 -08:00
Ben Gotow bb03e52e33 Clean up action bars, random exceptions 2016-01-25 17:08:38 -08:00
Ben Gotow e4553ffb1e Fix drafts 2016-01-25 16:37:34 -08:00
Ben Gotow c9e5b68f16 More database-related spec fixes 2016-01-25 11:35:23 -08:00
Evan Morikawa 5057ad3d20 fix(keymap): the remove and go to prev/next keys were reversed
Fixes #924
2016-01-22 15:33:49 -08:00
Ben Gotow 7458fdd4db TaskFactory now returns N tasks for performing standard actions, undo uses arrays 2016-01-21 13:46:04 -08:00
Ben Gotow 07df74f823 Show the important icon whenever any account in the perspective supports it 2016-01-19 00:00:08 -08:00
Ben Gotow 3ee96b714b Remove current()? references, use Perspectiv.forNothing instead 2016-01-18 01:31:35 -08:00
Ben Gotow b7144d9402 Merge branch 'unified-inbox-bg' into unified-inbox
# Conflicts:
#	internal_packages/account-sidebar/lib/account-sidebar-store.coffee
#	internal_packages/account-sidebar/lib/main.coffee
#	internal_packages/category-picker/lib/category-picker.cjsx
#	spec/stores/focused-perspective-store-spec.coffee
#	src/flux/stores/focused-perspective-store.coffee
#	src/mailbox-perspective.coffee
2016-01-18 00:53:03 -08:00
Ben Gotow 1e5b26a818 Unified inbox mailbox perspectives working (sidebar disabled atm) 2016-01-18 00:47:04 -08:00
Juan Tejada 351a602b86 AccountSidebar package refactor:
- Creates OutlineView generic component and uses that instead of custom
  code
- Refactors AccountSidebarStore:
  - Split the generation of the state tree into smaller functions
  - Adds different types of account sidebar items and sections, which contain
    logic and props necessary to be rendered as OutlineViewItems, and
    removes that logic from the store
- Removes WorkspaceStore.SidebarItem and removes the ability to register
  new sidebar items. If people want to add something to the sidebar they
  can just register a Component via the component registry and use the
  OutlineView component
- Removes the DraftListSidebarItem, which was basically duplicated code
  for an item but with a different data source. This is now handled
  generically by the account sidebar by rendering OutlineViewItems with
  different props and handlers
- Clean ups here and there:

- TODO
  - Add AccountSwitcher
  - Revisit calculation and generation of the state tree. Should the
    parent store contain and update the entire state all the time.
    Should separate items inside the tree have their own data sources?
  - This would avoid having the AccountSidebarStore listen to a bunch of
    different other stores, and the specific logic wold be contained
    inside each item type.
2016-01-15 16:55:21 -08:00
Ben Gotow 1ac84f4013 Clean up the MultiselectList implementation a bit 2016-01-15 14:26:07 -08:00
Ben Gotow 6b6f2b39d3 More renaming of view => data source 2016-01-14 15:04:17 -08:00
Ben Gotow 85e65e9135 Some basic thread list cleanup 2016-01-14 14:04:51 -08:00
Ben Gotow 273679a861 DataView => ListDataSource 2016-01-14 12:26:54 -08:00
Juan Tejada fe625d8f6d Update names to use perspective instead of view 2016-01-12 09:49:56 -08:00
Juan Tejada 2c7626a355 Fix ThreadListParticipants spec 2016-01-11 13:31:35 -08:00
Juan Tejada f6579ceaa4 Fix misc errors that made the app crash 2016-01-11 11:39:14 -08:00
Juan Tejada d265bf1248 fix(category-store): Fix issue with observables in CategoryStore
- Removes use of observables from category store and keeps a big cache
  of categories per account
- Upates Category Observables with new helper observables
- Updates CategoryPicker and AccountSidebarStore to use observables
- Misc fixes
2016-01-08 18:03:18 -08:00
Ben Gotow 2ddafe7154 Rename MailViewFilter => MailboxPerspective 2016-01-08 14:58:31 -08:00
Ben Gotow f026974bae Merging in new observables for thread list
commit 7a67c1fd349c575a91b162024cc03050e86574c9
Author: Ben Gotow <bengotow@gmail.com>
Date:   Fri Jan 8 11:14:07 2016 -0800

    WIP

commit 891f23487827a447ec95406ef26f1473a0c07de6
Author: Ben Gotow <bengotow@gmail.com>
Date:   Wed Jan 6 15:25:09 2016 -0800

    WIP

commit 3c323cd4beb2df2fae2439a556d3129404d942cc
Author: Ben Gotow <bengotow@gmail.com>
Date:   Mon Jan 4 17:46:11 2016 -0800

    WIP

commit ec7090ea9e1969fea2ea583f80a9a2ac41e6c8b0
Author: Ben Gotow <bengotow@gmail.com>
Date:   Mon Jan 4 17:22:07 2016 -0800

    Remove unused LRUCache

commit e10c3919559d3c364cb7bb94d19094a2444c10f3
Author: Ben Gotow <bengotow@gmail.com>
Date:   Mon Jan 4 16:21:37 2016 -0800

    rm(database-view): Performance refactor of thread-list

    Summary:
    This diff removes the old DatabaseView class, which included lots of gross optimizations that have since been duplicated in QuerySubscription and makes the thread list use the QuerySubscription class.

    This diff also substantially replaces the QuerySubscription class. The new implementation actually makes more queries but is less gross and more straightforward. It leverages a couple findings from database profiling:

    - Because of the sqlite page cache, asking for ids you've previously asked for is very fast.
        + Don't bother sorting in memory to avoid a query, just ask for ids again and fill in any missing objects.
    - Loading and inflating models is 4x+ slower than just grabbing ids

    I've also added more convenience classes around database queries:
    - QueryRange: Represents {offset, limit}, and can do boolean intersections
    - QueryResultSet: Better than passing an array of 50 items when you really mean items 150-200. Also tries hard to be immutable.

    This diff doesn't fully remove the concept of a "ModelView" because it's used /everywhere/ in the multiselect list source. There's a small shim that we can remove when we refactor that code. Ideally, I think we should rename ModelView to "MultiselectListDataSource" to follow iOS conventions (eg UITableViewDataSource). RIP 80char lines?

    Test Plan: They've gone to hell. WIP.

    Reviewers: evan, juan

    Differential Revision: https://phab.nylas.com/D2408

commit 32607eee8aafb7fa98b866347bdd2c0b963a602c
Author: Ben Gotow <bengotow@gmail.com>
Date:   Mon Jan 4 09:56:34 2016 -0800

    WIP

commit 5ab5fe74e94db6904bd77d224720ad9fc69fe6a7
Author: Ben Gotow <bengotow@gmail.com>
Date:   Wed Dec 30 22:56:46 2015 -0800

    redo scrollbars to not require counts

commit 361bb192d072dc8a69fd3ef143cad7bed214ebdc
Author: Ben Gotow <bengotow@gmail.com>
Date:   Wed Dec 30 17:50:57 2015 -0800

    wip

commit 079394de1cc3344fb6568efe00a52d7fc97fbd27
Author: Ben Gotow <bengotow@gmail.com>
Date:   Wed Dec 30 13:49:11 2015 -0800

    wip

commit 65142be03c27c653fe1147fdde6c2f9b046ade22
Author: Ben Gotow <bengotow@gmail.com>
Date:   Wed Dec 30 01:23:20 2015 -0800

    wip

commit 5d412ec276be1104175ad0f43c9d54e1cea857bf
Author: Ben Gotow <bengotow@gmail.com>
Date:   Tue Dec 29 22:49:58 2015 -0800

    Refactor start

commit d2b6eea884fcd2bd81ebe3985f2b2636a510c493
Author: Ben Gotow <bengotow@gmail.com>
Date:   Tue Dec 29 18:51:53 2015 -0800

    RIP DatabaseView
2016-01-08 14:31:33 -08:00
Juan Tejada 9f998d1964 refactor(rip-current-account): Rips out AccountStore.current
Summary:
- WIP: Need to fix tests and some errors!
- Refactors Category class to hold information about its type
- Refactors CategoryStore to rely on observables instead of local caches
- Adds and updates Observables and helpers
- Refactors ContactStore to hold entire cache of contacts instead of per
  current account
  - Same for ContactRankingStore and other stores
- Refactors method names for AccountStore + some helpers
- Updates MailViewFilter to hold an account
  - Adds basic Unified filter
- Replaces AccountStore.current calls with either:
  - The account of the currently focused MailViewFilter
  - The account associated with a thread, message, file, etc...
  - A parameter to be passed in
  - Arbitrarily, the first account in the AccountsStore

Test Plan: - Unit tests

Reviewers: evan, bengotow

Differential Revision: https://phab.nylas.com/D2423
2016-01-08 14:22:13 -08:00
Colin King f14a480d30 Reordered archive and trash icons 2016-01-06 14:22:41 -05:00
Colin King 8794686688 Moved all quick actions within flexbox from injectable component
Fixed linting issues

Moved away from ComponentRegistry towards InjectComponentSet children
2016-01-04 20:25:59 -05:00
Ben Gotow 608060ed6d fix(search): Switching accounts while searching no longer breaks app
Fixes #850
2015-12-28 12:16:56 -08:00
Juan Tejada aed9b77207 fix(shortcuts): Fix shortcut handlers for marking as read/unread
- Marking as read/unread did not work when selecting multiple threads
2015-12-14 10:32:45 -08:00
Ben Gotow 9eb3eb3297 fix(thread-list): Initialize database view immediately 2015-12-11 12:15:38 -08:00
Juan Tejada 281e458d39 feat(account-prefs): Adds new page for Account in preferences
Summary:
Adds the new Account preferences page. This consists of two major React components,
PreferencesAccountList and PreferencesAccountDetails, both of which use EditableList.

I added a bunch of fixes and updated the API for EditableList, plus a bit of
refactoring for PreferencesAccount component, and a bunch of CSS so its a big diff.

The detailed changelog:

Updates to EditableList:
  - Fix bug updating selection state when arrows pressed to move selection
  - Add new props:
    - allowEmptySelection to allow the list to have no selection
    - createInputProps to pass aditional props to the createInput
  - Add scroll region for list items
  - Update styles and refactor render methods

Other Updates:
- Updates Account model to hold aliases and a label
  - Adds getter for label to default to email
- Update accountswitcher to display label, update styles and spec

- Refactor PreferencesAccounts component:
  - Splits it into smaller components,
  - Removes unused code
- Splits preferences styelsheets into smaller separate stylesheet for
  account page. Adds some updates and fixes (scroll-region padding)
- Update AccountStore to be able to perform updates on an account.
- Adds new Action to update account, and an action to remove account to
  be consistent with Action usage
- Adds components for Account list and Aliases list using EditableList

Test Plan: - All specs pass, but need to write new tests!

Reviewers: bengotow, evan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2332
2015-12-10 15:27:29 -08:00
Ben Gotow 03908fbd84 fix(drafts): Refresh view when draft becomes message 2015-12-10 13:43:27 -08:00
Juan Tejada f7b73c6920 fix(important): Fixes keymap handlers for mark as important/unimportant
- Updates to bind handlers inside thread list
- Fixes typo in event name
- Updates config path for showImportant
2015-12-07 12:05:40 -08:00
Ben Gotow 77394b837d fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
Yoeri Stessens 4567183d3a Merge branch 'master' of github.com:nylas/N1 2015-12-07 12:04:41 +01:00
Yoeri Stessens 9d6769ba89 Add remove fallback for archiving messages 2015-12-07 11:29:31 +01:00
Ben Gotow 386a599fbc fix(keymaps): Listen to atom commands instead of DOM events
Using `addEventListener` only works when the command is triggered by the atom keymaps manager, NOT when the command is triggered by the command registry (NylasEnv.commands.dispatch). Odds are, when you subscribe to key commands you /really/ mean to subscribe to the command, no matter how it's invoked.

This fixes #556, in which the down / up arrows in the message list weren't working.
2015-12-04 18:27:11 -08:00
Ben Gotow f308e51f62 fix(unread-icon): Show the correct icon for the action 2015-12-04 16:38:26 -08:00
Yoeri Stessens 44e3f99cc9 Alter the text to a more general approach and run tests
The text is now more in line with other mail clients to minimalize possible confusion between users of multiple mail clients and/or platforms.
2015-12-02 08:23:03 +01:00
Yoeri Stessens da56a9b5c8 Change backspace behavior
There is a setting so that the backspace can delete messages instead of archiving.
I think that backspace must delete the message, but like many other clients, you have the choice.
2015-12-01 17:07:46 +01:00
DC 2bd710d668 Internal package.json license: GPLv3
Changed from 'Propietary' to 'GPLv3' to match LICENSE.md
2015-11-24 09:09:33 -08:00
Ben Gotow b3845e675e fix(search): Execute search for subject, autoselect first item
Fixes T5899, but we may want to iterate on it more later.
2015-11-18 12:35:19 -08:00
Evan Morikawa 51602f69a5 refactor(env): new NylasEnv global
Converted all references of global atom to NylasEnv

Temporary rename atom.io

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.io/temporaryAtomIoReplacement/g'

atom.config to NylasEnv.config

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.config/NylasEnv.config/g'

atom.packages -> NylasEnv.packages

atom.commands -> NylasEnv.commands atom.getLoadSettings

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.commands/NylasEnv.commands/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getLoadSettings/NylasEnv.getLoadSettings/g'

More common atom methods

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.styles/NylasEnv.styles/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.emitError/NylasEnv.emitError/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.inSpecMode/NylasEnv.inSpecMode/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.inDevMode/NylasEnv.inDevMode/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getWindowType/NylasEnv.getWindowType/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.displayWindow/NylasEnv.displayWindow/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.quit/NylasEnv.quit/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.close/NylasEnv.close/g'

More atom method changes

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.keymaps/NylasEnv.keymaps/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.hide/NylasEnv.hide/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getCurrentWindow/NylasEnv.getCurrentWindow/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.menu/NylasEnv.menu/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getConfigDirPath/NylasEnv.getConfigDirPath/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.isMainWindow/NylasEnv.isMainWindow/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.finishUnload/NylasEnv.finishUnload/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.isWorkWindow/NylasEnv.isWorkWindow/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.showSaveDialog/NylasEnv.showSaveDialog/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.append/NylasEnv.append/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.confirm/NylasEnv.confirm/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.clipboard/NylasEnv.clipboard/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getVersion/NylasEnv.getVersion/g'

More atom renaming

Rename atom methods

More atom methods

Fix grunt config variable

Change atom.cmd to N1.cmd

Rename atom.coffee and atom.js to nylas-env.coffee nylas-env.js

Fix atom global reference in specs manually

Fix atom requires

Change engine from atom to nylas

got rid of global/nylas-env

rename to nylas-win-bootup

Fix onWindowPropsChanged to onWindowPropsReceived

fix nylas-workspace

atom-text-editor to nylas-theme-wrap

atom-text-editor -> nylas-theme-wrap

Replacing atom keyword

AtomWindow -> NylasWindow

Replace Atom -> N1

Rename atom items

nylas.asar -> atom.asar

Remove more atom references

Remove 6to5 references

Remove license exception for atom
2015-11-17 16:41:20 -08:00
Evan Morikawa 119da453e1 feat(selection): add selection of read, unread, starred, etc
Summary:
Can select all, deselect-all, read, unread, starred, unstarred.

Yes, it's not REALLY select "all", but it uses the items in the current
`retainedRange`. This is actually similar to what gmail does (only selects
on the first page of a 100).

Test Plan: new test

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2241
2015-11-09 10:03:55 -05:00
Evan Morikawa 55d3e92f50 feat(keymap): add cmd+1, cmd+2, etc to quick-select accounts
Fix "unique key" for react props

Fix composer styling bug in popout composer
2015-11-06 14:38:50 -08:00
Evan Morikawa 37e3fe0f45 feat(keymap): add new <KeymapHandlers />
Summary:
Refactor keymaps to wrap components with a <KeymapHandlers /> component.
This more Reactful way of declaring keyback handlers prevents us from
needing to subscribe to `atom.commands`

Test Plan: new tests

Reviewers: bengotow, juan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2226
2015-11-06 11:47:06 -08:00
Ben Gotow 62d45698d1 fix(thread-list): Line up sender, subject and snippet
Fixes GitHub issue #278
2015-10-29 11:30:06 -07:00
Evan Morikawa 985a8b55fe fix(ui): better unread count box
Smaller box that sits next to item.
Drafts is now no longer a strong color
Fixes T3535
2015-10-28 18:50:04 -04:00
Ben Gotow 5c5c1e98c1 fix(drafts): Draft selection / deletion fixes 2015-10-23 16:04:27 -07:00
Ben Gotow cb50b3700b fix(list): Additional focused CSS changes 2015-10-23 14:55:07 -07:00
Ben Gotow 29fdd3024a fix(threads): Show the archive button in the bulk action bar 2015-10-23 14:50:39 -07:00
Evan Morikawa 45466a18b0 fix(archive): can archive and trash from focused message 2015-10-23 14:49:29 -07:00
Ben Gotow 096e829f33 fix(list): Incorrect snippet color on unread selected threads in narrow mode 2015-10-23 12:54:02 -07:00