Commit graph

1070 commits

Author SHA1 Message Date
Juan Tejada 223f7fdde4 fix(sidebar): Update sidebar correctly when an account added or removed 2016-01-29 10:21:49 -08:00
Ben Gotow 179626dc20 fix(config): observe fires immediately, causing re-renders 2016-01-29 00:31:10 -08:00
Juan Tejada e7a70d9bf7 fix(account-switcher): Don't display "All Accounts" when only 1 account 2016-01-28 19:53:12 -08:00
Evan Morikawa f0b0f35433 fix(message): fix truncation of messages
It would seem the document.documentElement.scrollHeight can return 0 when
the document.body.scrollHeight reliably returns the correct height.
Changed to fallback to various height checking mechanisms.

Fixes #425
Fixes #1102
Fixes #1153
2016-01-28 18:07:43 -08:00
Ben Gotow 9dab8d6335 fix(labels): Never show labels UX for threads split across folders 2016-01-28 16:57:24 -08:00
Ben Gotow 12b60e4360 fix(important): Hide important in message column of unified unless Gmail 2016-01-28 16:57:24 -08:00
Ben Gotow db06df0902 fix(account-sidebar): onToggleCollapsed => onCollapseToggled 2016-01-28 16:57:24 -08:00
Juan Tejada 0c3ca4b6e4 fix(sidebar): Prevent editing items in OutlineView when not allowed
- Fix check in OutlineViewItem
2016-01-28 16:21:21 -08:00
Ben Gotow de489368e6 fix(unified): Add a unified icon. designer gets back tues. 2016-01-28 16:01:22 -08:00
Juan Tejada 10a6b76fb7 add(docs): Add docs for OutlineView and OutlineViewItem
- Renames some stuff
2016-01-28 15:28:15 -08:00
Ben Gotow e27c9eaca5 fix(important): Fix bugs in "important" label categorization 2016-01-28 15:27:03 -08:00
Ben Gotow 09a2096690 fix(linter): Switching between Coffee + ES6 is hard... 2016-01-28 14:59:17 -08:00
Ben Gotow 3869b9c214 fix(contact-search): Keep only ranked contacts, query for others. Massive perf boost. 2016-01-28 14:56:15 -08:00
Drew Regitsky e1631db435 fix(templates): small CSS fix in preferences page 2016-01-28 14:51:31 -08:00
Juan Tejada 89f431edec add(specs): Add specs for MailboxPerspective
- Renames canApplyToThreads -> canReceiveThreads and applyToThreads ->
  receiveThreads
- Add initial specs and better documentation for
  MailboxPerspective.canReceiveThreads.
2016-01-28 14:11:50 -08:00
Juan Tejada 8237e3742c fix(perspective): Update MailboxPerspective.canApplyToThreads
- Checks if the account ids of the threads that want to be applied are
  contained inside the perspectives account ids. E.g.:
  - I can move thread from account A to unified inbox or inbox A, but
    not to inbox B.
  - I can move threads from account A to a folder in account A but not a
    folder in account B
- Update data transferred in drag + other minor updates
2016-01-28 13:30:08 -08:00
Evan Morikawa 55aedef697 feat(startup): new option to launch on system start
Summary:
adds new option to launch on system start

Also adds the `--background` flag to launch N1 in the background (aka not
show the main window).

Test Plan: Manual

Reviewers: bengotow, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2474
2016-01-28 12:02:08 -08:00
Ben Gotow 46b339d334 fix(message-list): Spec fixes, all stubs need accountId 2016-01-28 11:14:04 -08:00
Ben Gotow da68b393a2 fix(message-list): Only display labels when usesLabels() 2016-01-28 10:46:33 -08:00
Juan Tejada 19edb34599 Increment max width for sidebar 2016-01-28 01:29:18 -08:00
Juan Tejada 9a86ce06ed Update file uploads (see details):
- Add uploads field to Message and removes cache from FileUploadsStore
- Updates draft via session from DraftStore
  - This makes everything way cleaner
- This fixes bug when creating draft with uploads and the opening it in
  new window
- Updates specs
2016-01-28 00:33:22 -08:00
Juan Tejada 8bd387e8b2 Update OutlineViewItem to focus end of input when editing 2016-01-28 00:02:55 -08:00
Juan Tejada aa4de82625 Add folder/label renames
- Updates OutlineView to reuse OutlineViewItem for creating new items
- Adds ability to edit outline view items via double click or right
  click
- Cleans up css and code and sidebar item
- Updates SyncbackCategoryTask to update categories as well
- Adds 405 to permanent api error codes
2016-01-27 23:16:17 -08:00
Juan Tejada 1d8f56e7f8 Misc fixes for FileUploadStore 2016-01-27 15:38:01 -08:00
Juan Tejada 08ec481739 Fix ComposerView specs 2016-01-27 13:49:34 -08:00
Ben Gotow 53390fbd5c Basic fixes for drag and drop 2016-01-27 11:45:02 -08:00
Ben Gotow 470fbae6a3 Fix sidebar when an account doesn't have a standard category 2016-01-27 11:14:11 -08:00
Juan Tejada 63d36a78c3 Inits FileUploadStore from current state in the filesystem
- Removes uploads when draft is deleted
- Misc fixes and renaming
2016-01-26 18:48:58 -08:00
Ben Gotow 752a749da7 More sending fixes - attachments working! 2016-01-26 18:03:01 -08:00
Juan Tejada 7c71576192 Misc fixes for FileUploadStore 2016-01-26 16:58:20 -08:00
Juan Tejada dcb08932c0 Refactor FileUploadStore and composer attachments - WIP 2016-01-26 15:36:38 -08:00
Juan Tejada 1435904f3c Fix when checking if draft is a reply when getting accounts for send 2016-01-26 13:55:26 -08:00
Ben Gotow 3bcbec4118 Fix for bad @props 2016-01-25 19:07:28 -08:00
Juan Tejada 324123731a Add ability to select account to send from
- Adds settings option to select default account to send from
2016-01-25 18:20:54 -08:00
Ben Gotow 205ec50b98 Fix AccountStore.current() references in private packages 2016-01-25 18:02:56 -08:00
Ben Gotow e2234bf58e 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 68d55fb662 Clean up action bars, random exceptions 2016-01-25 17:08:38 -08:00
Ben Gotow 22121f9f18 Fix drafts 2016-01-25 16:37:34 -08:00
Evan Morikawa ecbadaf01e feat(send): Send and Archive
Summary: Send and Archive plus a new setting.

Test Plan: new tests

Reviewers: bengotow, juan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2446
2016-01-25 14:14:09 -08:00
Ben Gotow cffb3ad4a2 Fix for search bar issue with threads not appearing 2016-01-25 13:47:41 -08:00
Ben Gotow 18b9a1a9a0 More spec fixes 2016-01-25 11:42:39 -08:00
Ben Gotow 2bb9ce3591 More database-related spec fixes 2016-01-25 11:35:23 -08:00
Ben Gotow a2c901559e DatabaseTransaction / QueryBuilder spec fixes 2016-01-25 11:11:57 -08:00
Ben Gotow 9fc11512ad CategoryPicker / PerspectiveStore spec fixes 2016-01-25 11:07:40 -08:00
Evan Morikawa d15d39abdf fix(keymap): the remove and go to prev/next keys were reversed
Fixes #924
2016-01-22 15:33:49 -08:00
Juan Tejada 901ce1bcbd Show window when switching accounts if it isnt visible 2016-01-22 11:58:24 -08:00
Ben Gotow e887722e4a Rebuild SearchSuggestionStore to fix errors, appearing after search committed 2016-01-21 16:00:18 -08:00
Juan Tejada 2380e1eefa Update sidebar to hold state for selected account
- Ensures that it displays the correct set of sidebar items even when
  the perspective changes
- Also sets up hotkeys to switch currently focused accounts
2016-01-21 14:13:48 -08:00
Ben Gotow 8f7f63af3a TaskFactory now returns N tasks for performing standard actions, undo uses arrays 2016-01-21 13:46:04 -08:00
Juan Tejada e8583abb01 Update default collapsed value for sidebar items in unified inbox view 2016-01-20 19:22:33 -08:00
Ben Gotow 8b8a505b20 fix(onboarding): Minor style changes, headers for EAS 2016-01-20 17:09:15 -08:00
Juan Tejada 6c559ddb7e Add collapse capabilities to OutlineView
- Make user category sections collapsible when in unified view
- Get rid of dumb CategoryHelpers class
2016-01-20 17:09:05 -08:00
Evan Morikawa c7a685630d refactor(toolbar): allow toolbar extensions in contenteditable
Summary:
This is a refactor of the toolbar in the contenteditable. Goals of this
are:

1. Allow developers to add new buttons to the toolbar
2. Allow developers to add other component types to the floating toolbar (like the LinkEditor)
3. Make the toolbar declaratively defined instead of imperatively set
4. Separate out logical units of the toolbar into individual sections
5. Clean up `innerState` of the Contenteditable

The Floating Toolbar used to be an imperative mess. Doing simple
functionality additions required re-understanding a very complex set of
logic to hide and show the toolbar and delecately manage focus states.
There also was no real capacity for any developer to extend the toolbar.

It also used to be completely outside of our `atomicEdit` system and was a
legacy of having raw access to contenteditable controls (since it all used
to be directly inside of the contenteditable)

Finally it was difficult to declaratively define things because the
`innerState` of the Contenteditable was inconsistently used and its
lifecycle not properly thought through. This fixed several lifecycle bugs
with that.

Along the way several of the DOMUtils methods were also subtly not
functional and fixed.

The Toolbar is now broken apart into separate logical units.

There are now `ContentedtiableExtension`s that declare what should be
displayed in the toolbar at any given moment.

They define a method called `toolbarComponentData`. This is a pure
function of the state of the `Contenteditable`. If selection and content
conditions look correct, then that method will return a component to
render. This is how we declaratively define whether a toolbar should be
visible or not instead of manually setting `hide` & `show` bits.

There is also a `toolbarButtons` method that declaratively defines buttons
that can go in the new `<ToolbarButtons>` component.

The `ToolbarButtonManager` takes care of extracting these and binding the
correct editorAPI context.

Now the `<LinkEditor>` is a separate component from the `<ToolbarButtons>`
instead of being smashed together.

The `LinkManager` takes care of declaring when the `LinkEditor` should be
displayed and has properly bound methods to update the `contenteditable`
through the standard `atomicEdit` interface.

If users have additional contenteditable popup plugins (like displaying
extra info on a name or some content in the composer), they can now
implement the `toolbarComponentData` api and declaratively define that
information based on the state of the contenteditable.

Test Plan: TODO

Reviewers: bengotow, juan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2442
2016-01-20 14:35:20 -08:00
Ben Gotow 1d55f1ac11 Change the sidebar to use Flexbox for container 2016-01-20 13:04:06 -08:00
Ben Gotow 353be64e10 rm(tooltip): Tooltip package no longer in use 2016-01-20 11:30:57 -08:00
Ben Gotow 45403131f1 rm(intercom): Point feedback to support.nylas, shrink button 2016-01-20 11:26:14 -08:00
Ben Gotow 3c40b3496c fix(auth): Increase timeout to 60s for Exchange auth 2016-01-20 10:49:27 -08:00
Drew Regitsky 9641ac0e6e fix(templates): fix when the "no templates" message is displayed 2016-01-20 10:24:45 -08:00
Juan Tejada b538ec050c Add account switcher back to sidebar:
- Account switcher can now switch between all accounts and each account
- Updates FocusedPerspectiveStore and Actions.focusDefaultMailboxPerspectiveForAccounts
  to focus a perspective for accountIds instead of for a single account,
  and updates methods
  - Adds helpers to CategoryStore and MailboxPerspective
  - Updates key commands to allow switch to unified inbox
2016-01-19 23:42:50 -08:00
Ben Gotow 5c26340965 Merge pull request #966 from cllns/standardize-am-and-pm-capitalization
Standardize capitalization to am/pm, for message-list
2016-01-19 16:45:02 -08:00
Jackie Luo 1f0751c026 fix(message): Message time no longer selectable
Summary: Closes #910.

Test Plan: Manual. Tested locally.

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2453
2016-01-19 16:32:03 -08:00
Sean Collins 1f0ebfca78 Standardize message-list capitalization to AM/PM, 2016-01-19 15:54:44 -07:00
Ben Gotow cf39491240 Merge pull request #1029 from mbilker/phishing-detection
Set Phishing Detection package name to the correct value
2016-01-19 13:51:57 -08:00
Juan Tejada 38590139bc Fix collapsing behavior for non perspective sidebar items
- Assign unique id for sheet and draft sidebar items
2016-01-19 10:51:52 -08:00
Ben Gotow 50e03946dd Show the important icon whenever any account in the perspective supports it 2016-01-19 00:00:08 -08:00
Juan Tejada 866805f835 More account sidebar refactor + sections for unified inbox
- Refactors some of the old code which was 💩
  - Makes SidbarSection a factory for different types of items for the
    OutlineView
  - Decided not to create a OutlineViewItem.Model class since the only
    purpose it would serve would be to validate getters for props or for
    documentation, both of which are already done via React.PropTypes.
- Adds sections when looking at unified inbox and integrates with new
  mailbox perspecitve interface
- Updates OutlineViewItem a bit + styles
- Tests missing
2016-01-18 23:22:46 -08:00
Juan Tejada 81bd78fb09 Fix merge errors 2016-01-18 11:56:52 -08:00
Juan Tejada e1084708b8 Minor fixes and style updates 2016-01-18 11:48:34 -08:00
Ben Gotow 00ff8269da Make a few changes to AccountSidebar - needs to use accountIds? 2016-01-18 01:31:54 -08:00
Ben Gotow 99854add72 Remove current()? references, use Perspectiv.forNothing instead 2016-01-18 01:31:35 -08:00
Ben Gotow f1b4a23897 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 96f429ff39 Unified inbox mailbox perspectives working (sidebar disabled atm) 2016-01-18 00:47:04 -08:00
Juan Tejada ebb9c9735f 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 774562dbc1 Clean up the MultiselectList implementation a bit 2016-01-15 14:26:07 -08:00
Evan Morikawa 6695de4187 feat(tasks): add Create, Update, Destroy tasks plus spec & lint fixes
Summary:
1. **Generic CUD Tasks**: There is now a generic `CreateModelTask`,
`UpdateModelTask`, and `DestroyModelTask`. These can either be used as-is
or trivially overridden to easily update simple objects. Hopefully all of
the boilerplate rollback, error handling, and undo logic won't have to be
re-duplicated on every task. There are also tests for these tasks. We use
them to perform mutating actions on `Metadata` objects.

1. **Failing on Promise Rejects**: Turns out that if a Promise rejected
due to an error or `Promise.reject` we were ignoring it and letting tests
pass. Now, tests will Fail if any unhandled promise rejects. This
uncovered a variety of errors throughout the test suite that had to be
fixed. The most significant one was during the `theme-manager` tests when
all packages (and their stores with async DB requests) was loaded. Long
after the `theme-manager` specs finished, those DB requests were
(somtimes) silently failing.

1. **Globally stub `DatabaseStore._query`**: All tests shouldn't actually
make queries on the database. Furthremore, the `inTransaction` block
doesn't resolve at all unless `_query` is stubbed. Instead of manually
remembering to do this in every test that touches the DB, it's now mocked
in `spec_helper`. This broke a handful of tests that needed to be manually
fixed.

1. **ESLint Fixes**: Some minor fixes to the linter config to prevent
yelling about minor ES6 things and ensuring we have the correct parser.

Test Plan: new tests

Reviewers: bengotow, juan, drew

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

Remove cloudState and N1-Send-Later
2016-01-15 15:16:21 -05:00
Karim Hamidou da54fa7e29 [N1] Validate input in the signup dialog
Summary:
This diff bundles a number of small usability fixes to the "Create account" window. It notably:
- forces users to enter required fields before moving on to the next step
- validates email addresses and domain names

Test Plan: Tested manually by going through all the possible auth flows.

Reviewers: evan, juan, bengotow

Reviewed By: bengotow

Subscribers: bengotow

Projects: #edgehill

Differential Revision: https://phab.nylas.com/D2377
2016-01-15 11:27:14 -08:00
Drew Regitsky fc20b60b61 fix(mail-rules): tiny CSS fix to "+" button in mail rules 2016-01-15 11:01:59 -08:00
mbilker efc9950ead fix(phishing): set the package name to the correct value 2016-01-14 22:43:40 -05:00
Ben Gotow 8957c560f5 More renaming of view => data source 2016-01-14 15:04:17 -08:00
Ben Gotow d78e61839d Some basic thread list cleanup 2016-01-14 14:04:51 -08:00
Ben Gotow ff01c3a502 DataView => ListDataSource 2016-01-14 12:26:54 -08:00
Ben Gotow 3a8a38b8bc Merge branch 'master' into unified-inbox
# Conflicts:
#	spec/stores/file-download-store-spec.coffee
2016-01-13 17:20:34 -08:00
Drew Regitsky f469fd29d8 fix(templates): rewritten "welcome" file / example template 2016-01-13 12:08:41 -08:00
Ben Gotow fb41a8184e fix(specs): Spec fixes for 37e1f6bb 2016-01-12 19:11:47 -08:00
Ben Gotow e8997b0944 fix(spellcheck): Unwrap nodes with simpler code with less side effects 2016-01-12 19:03:04 -08:00
Juan Tejada 0dd87c80d7 fix(warnings): Don't issue a warning for attachments when word attach in
signature

- Fixes #912
2016-01-12 18:45:27 -08:00
Evan Morikawa ef8759dd62 fix(lint): fix linter issues in template store 2016-01-12 18:33:01 -05:00
Drew Regitsky 6cc0e6ca0d fix(templates): insert template no longer overwrites signature 2016-01-12 14:09:37 -08:00
Ben Gotow 5a12dde49c fix(drag): Drag and drop files with illegial path characters 2016-01-12 13:52:01 -08:00
Ben Gotow 97d49256bd fix(packages): Default icon for third-party packages 2016-01-12 13:52:01 -08:00
Juan Tejada 646785e182 fix(styles): Add bottom margin to templates plugin message 2016-01-12 13:46:50 -08:00
Drew Regitsky c91a0c6062 fix(templates): fix several bugs in templates plugin
Fixes behavior when there are no template files, prevents renaming/creating
with an empty name, fixes yet another way to accidentally make yellow text,
misc small style fixes
2016-01-12 12:44:38 -08:00
Juan Tejada 57aee26256 fix(composer): Fix focus behavior when signature present and when
clicking outside:

- When focusing the composer via click inside the contenteditable region or via
tabbing, last text node before the signature (or blockquotes) will be focused.
- When focusing composer by clicking outside contenteditable region, it
  will default to default contenteditable focus behavior via new method:
  `nativeFocus`
2016-01-12 12:36:19 -08:00
Ben Gotow c7ebbb189b fix(indicators): Remove duplicate description key 2016-01-12 10:28:34 -08:00
Juan Tejada cec3b38d1d Update names to use perspective instead of view 2016-01-12 09:49:56 -08:00
Ben Gotow 13870fecd5 Merge branch 'master' into unified-inbox
# Conflicts:
#	internal_packages/events/lib/event-header.cjsx
#	spec/stores/file-download-store-spec.coffee
#	spec/tasks/event-rsvp-spec.coffee
#	src/flux/tasks/event-rsvp.coffee
2016-01-12 08:20:55 -08:00
Ben Gotow b6d20ce88c fix(composer): Fix tabbing from body to subject 2016-01-11 18:13:42 -08:00
Juan Tejada 8db220cbb9 Fix issues in AccountSidebarStore and MailboxPerpective#isEqual 2016-01-11 17:54:40 -08:00
Ben Gotow fa01a31631 fix(composer): 30px area would focus wrap instead of contenteditable. Fixes #935 2016-01-11 17:44:55 -08:00
Ben Gotow 893e26dfc6 fix(composer): Focus last element, not just text node 2016-01-11 17:44:17 -08:00
Ben Gotow d06b235edf fix(spellcheck): Redo node creation each time, optimize findSimilarNodes
findSimilarNodes was taking 20% of total execution time because my test email was a jenkins error report with thousands of text nodes.
2016-01-11 17:31:03 -08:00
Juan Tejada b1d1889f28 Fix SuggestioStore -- update to use NylasStore 2016-01-11 16:32:25 -08:00
Ben Gotow df124e1472 Fix search suggestions using old-style store 2016-01-11 16:26:41 -08:00
Ben Gotow 9ee1d83fcd Remove query formatting that used to match ElasticSearch 2016-01-11 16:16:35 -08:00
Juan Tejada 813598d536 Fix more specs:
- SearchBar
- EventRSVPTask
- ContactStore
2016-01-11 16:14:21 -08:00
Ben Gotow 212adcdf84 Search bar fixes 2016-01-11 15:58:10 -08:00
Drew Regitsky f212752c1c fix(templates): fix two bugs breaking templates plugin rename and search 2016-01-11 15:28:31 -08:00
Juan Tejada a1a5cd7fb9 Fix tests for AccountSidebarStore
- Switches to using CategoryStore to reduce complexity
- Update CategoryStore.categories to retun all categories when account
  is null
- Inits AccountSidebarStore._account based on the currently focused
  MailboxPerspective
2016-01-11 15:16:50 -08:00
Ben Gotow 7b6f122119 AccountStore no longer tracks index, Actions.selectAccount gone 2016-01-11 14:11:48 -08:00
Ben Gotow 651ea8c1c5 More spec fixes 2016-01-11 13:40:42 -08:00
Juan Tejada 162872fc82 Remove fdescribe 2016-01-11 13:39:25 -08:00
Juan Tejada 4978e61d91 Fix AccountSwitcher specs 2016-01-11 13:38:44 -08:00
Juan Tejada db8b9bae23 Fix ThreadListParticipants spec 2016-01-11 13:31:35 -08:00
Juan Tejada e97ca2b606 Fix CategoryPicker specs
- Add NylasUtils.mockObservable helper
2016-01-11 13:23:59 -08:00
Ben Gotow a352e40af7 fixes for draft store specs, contact.isMe now returns true if it matches any account 2016-01-11 13:23:35 -08:00
Ben Gotow 356365dc42 fix(rsvp): Check that you are a participant, support aliases. Fixes #962 2016-01-11 12:20:26 -08:00
Juan Tejada 29601a7d57 Fix misc errors that made the app crash 2016-01-11 11:39:14 -08:00
Ben Gotow db7bc9e81c fix(quoted-text): Fix + test case for Sentry 8323, body el is quoted text 2016-01-11 11:14:34 -08:00
Ben Gotow 65ee221bc9 fix(notifications): Fix notification removal [Sentry 8957] 2016-01-11 10:56:17 -08:00
Ben Gotow b3841d79e6 fix(composer): Temporary patch for broken focus
Long term, we need to refactor this so that it's either entirely controlled or uncontrolled. Potentially use focusin?
2016-01-08 18:45:26 -08:00
Juan Tejada b5fa97bc7a 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 14d6cec669 Rename MailViewFilter => MailboxPerspective 2016-01-08 14:58:31 -08:00
Ben Gotow d3f62d4bb0 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 34f68dcc0d 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
Ben Gotow cd3aea9885 style(message-list): Correct alignment of dropdown. Fixes #659 2016-01-08 11:48:14 -08:00
Ben Gotow a258ba4613 feat(zoom): Allow users to override interface zoom. Fixes #699 2016-01-08 11:32:32 -08:00
Ben Gotow 3b6fdd3a53 fix(specs): Minor change to templates package for Travis 2016-01-08 10:52:37 -08:00
Ben Gotow 506ada3a59 fix(lint): Fix linter issues in template package 2016-01-08 10:47:41 -08:00
Drew Regitsky 2a5c1383f8 fix(templates): disable outdated tests in templates plugin for now
TODO: update and rewrite tests for templates plugin
2016-01-07 21:13:07 -08:00
Ben Gotow 3a86c34883 feat(newsletter): Manage subscription directly from N1 2016-01-07 18:44:40 -08:00
Ben Gotow ed50039b00 rename(templates): Use "Quick Replies" name in plugins screen 2016-01-07 15:23:54 -08:00
Ben Gotow 460a715e4d fix(examples): examples => packages, move away from installing them 2016-01-07 14:56:34 -08:00
Ben Gotow cca6b70223 fix(keymaps): Display composer keymaps, fix Apple Mail 2016-01-06 11:44:20 -08:00
Colin King 1db98f80b6 Reordered archive and trash icons 2016-01-06 14:22:41 -05:00
Ben Gotow 188e637236 fix(rules): Overflow in the prefrences sidebar. Fixes #908 2016-01-06 09:51:42 -08:00
Ben Gotow 1d94fcaaf9 fix(sig): Remove selectEnd, place cursor before sig
Summary: When focusing the composer, select the end of the last text block above any signatures / quoted text (which can be visible by default in Fwd:).

Test Plan: Run tests

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2411
2016-01-05 14:31:55 -08:00
Ben Gotow 7f80cc8038 fix(focus): Minor changes to composer focus logic to focus new drafts
Summary:
Remove FocusTrackingRegion—all CommandRegions should be focusable, and nesting the two creates varying behavior based on which is the parent

Calling focus() on an injected / unsafe component should always do /something/. Try the inner React method, inner DOM method, or call on ourselves

Rename contentEditable._focusEditor to "focus" since it intends to replace default focus behavior

In ComposerView, always change focus via setState, never by calling focus() directly. Rather than tracking `_lastFocusedField`, just focus whenever the activeElement isnt within the focusedField. Make body initial focus when draft is pristine...

...(ensures new drafts are focused)

Test Plan: Run tests

Reviewers: evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D2406
2016-01-05 11:34:26 -08:00
Colin King 6d557961db 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 f2f7edea26 fix(spec): Participant tests breaking on Travis 2015-12-30 18:09:16 -08:00
Juan Tejada ebf9185fb0 fix(specs): Fix extension test 2015-12-30 18:08:33 -05:00
Evan Morikawa 11b731891f feat(extension): async extensions
Summary:
WIP:

This is a quick patch for Drew to make extensions async

We'll need to think through the upgrade/deprecation plan to roll out async
extensions across all of our APIs.

Test Plan: TODO

Reviewers: drew, evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2392
2015-12-30 18:04:52 -05:00
Juan Tejada b452be933a feat(column-width): Store column width state in the app
Summary:
- Fixes #833
- Allows column widths to be persisted between sessions

Test Plan: - Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2401
2015-12-30 15:18:38 -05:00
Juan Tejada 6315bc9d80 fix(extension-adapter): Update adapter to support all versions of extension api we've used
Summary:
- Rewrites composer extension adpater to support all versions of the
  ComposerExtension API we've ever declared. This will allow old plugins (or
  plugins that haven't been reinstalled after update) to keep functioning
  without breaking N1
- Adds specs

Test Plan: - Unit tests

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2399
2015-12-30 15:11:37 -05:00
Drew Regitsky 4628643195 fix(signatures-tests): actually fix the signatures tests 2015-12-29 18:31:10 -08:00
Juan Tejada 73f76de7fc fix(composer-focus): Fix focus behavior + update InjectedComponent props
Summary:
- Fixes bug with Composer focus caused by injected component. The composer body
  was being focused, but the cursor remained at the beginning of the content
  instead of at the end. This was caused because the focus method was being
  called before the content had actually been rendered to the dom.
  - Adds a callback to check when injected comp was actually rendered, and uses
    that to focus the body at the correct time.
  - Updates specs
- Updates behavior of focusing composer body when selecting threads in split
  mode --  resolves #T3444
  - It will focus the body when a thread is selcted via a click
  - It wont focus the body when a thread is selected via arrow keys
  - It will focus the body when a new inline reply is created
  - Updates specs

Test Plan: - Unit tests

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2393
2015-12-29 21:28:15 -05:00
Drew Regitsky 0f58618e2a fix(signatures-tests): update tests for new signatures code 2015-12-29 18:00:18 -08:00
Drew Regitsky da15d4598c fix(signatures): Wrap signature in a nylas-n1-signature div to allow easy detection
Summary:
Changes the internal signatures plugin to wrap the signature in a
`<div class="nylas-n1-signature">` block, to make it easier to detect and handle
signatures from within other plugins.

Also:
- Fixes the QuickSchedule plugin to place the scheduling block above the signature.
- Fixes a small syntax error in Translate plugin

Test Plan: manual

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2383
2015-12-29 15:33:49 -08:00
Ben Gotow 9dfb03727d lint(mail-rules): Fix build failure from linter issue 2015-12-29 14:41:30 -08:00
Ben Gotow 55e4dd14b9 fix(uploads): Don't allow dragging of uploading images (Fixes #366) 2015-12-29 14:21:42 -08:00
Ben Gotow e349062835 fix(regex): Chop leading '/" off emails if they are wrapped in quotes 2015-12-28 18:39:06 -08:00