Commit graph

1081 commits

Author SHA1 Message Date
Ben Gotow 71a5662553 🎨: Smaller buttons, smaller toolbar, smaller text
This should not be considered final, but we do plan to shrink the size of the entire UI slightly to match platform conventions.
2016-02-09 19:45:24 -08:00
Ben Gotow 6e49dbd2c3 bump(*): Electron 0.36.7, version to 0.4.6 2016-02-08 18:35:23 -08:00
Ben Gotow d4e7b7e712 fix(readme): Force github to refresh cache of screenshot 2016-02-08 14:52:07 -08:00
Ben Gotow 9bed0e6380 fix(tray): Do not show count on Mac OS X when 0. Fixes #1233 2016-02-08 10:31:13 -08:00
Ben Gotow fcc8ca8b07 fix(system-start): Do not continue when checkAvailability returns false 2016-02-06 11:35:01 -08:00
Ben Gotow 0e661ec996 fix(undo): Ensure undo bar dismisses after re-appearing 2016-02-05 19:11:27 -08:00
Ben Gotow a6d8783dae fix(messages): Field label was always "To" 2016-02-05 18:42:29 -08:00
Ben Gotow ca31ee10bd feat(perspective): Restore through NylasEnv.savedState 2016-02-05 18:36:48 -08:00
Ben Gotow 1cd49d952d fix(message): Allow height to be 0, remove 150px min height 2016-02-05 15:33:07 -08:00
Ben Gotow 50bd559623 fix(tray): Fix accidental conversion to NaN 2016-02-05 14:37:55 -08:00
Juan Tejada 199150188d fix(sidebar): Handle edge cases for sidebar shortcuts
Summary:
- Update menus and shortcuts correclt when accounts change or focused
  accounts change
- Move menu logic into SidebarCommands to remove duplicated logic
- Make `Window` menu also contain checkboxes

Test Plan: - Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2534
2016-02-05 14:25:07 -08:00
Juan Tejada 2b6ed11828 fix(sidebar): Display correct keyboard shortcuts in account switcher
- Fixes #1203
2016-02-05 09:55:27 -08:00
Ben Gotow 835e7fe9c8 perf(outbox): Only trigger when send draft tasks are present 2016-02-04 20:15:15 -08:00
Juan Tejada c0e8dc7ccb fix(styles): Fix less lint error 2016-02-04 18:19:26 -08:00
Juan Tejada 774957a5ff update(sidebar): Update sidebar design + context menus
Summary:
- Removes account switcher almost entirely
- Update context menu to edit and delete sidebar items
- Gross hardcoded position and size for the switcher icon -- will likely update with later redesign

Test Plan: - Visual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2527
2016-02-04 14:58:47 -08:00
Ben Gotow 91240f8979 feat(outbox): Sending status now appears beside drafts
Summary:
This diff adds an "OutboxStore" which reflects the TaskQueue and
adds a progress bar / cancel button to drafts which are currently sending.

- Sending state is different from things like Send later because drafts
  which are sending shouldn't be editable. You should have to stop them
  from sending before editing. I think we can implement "Send Later"
  indicators, etc. with a simple InjectedComponentSet on the draft list
  rows, but the OutboxStore is woven into the DraftList query subscription
  so every draft has a `uploadTaskId`.

- The TaskQueue now saves periodically (every one second) when there are
  "Processing" tasks. This is not really necessary, but makes it super
  easy for tasks to expose "progress", because they're essentially
  serialized and propagated to all windows every one second with the
  current progress value. Kind of questionable, but super convenient.

- I also cleaned up ListTabular and MultiselectList a bit because they
  applied the className prop to an inner element and not the top one.

- If a DestroyDraft task is created for a draft without a server id, it
  ends with Task.Status.Continue and not Failed.

- The SendDraftTask doesn't delete uploads until the send actually goes
  through, in case the app crashes and it forgets the file IDs it created.

Test Plan: Tests coming soon

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2524
2016-02-04 14:14:24 -08:00
Dakota Nelson 2a692456b3 Disallow Gmail accounts from entering IMAP flow
Summary:
The error message from D2515 is being upgraded to also disable the
continue button so that a user is unable to sync an @gmail.com account
using the IMAP flow.

Test Plan: Tested locally.

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2516
2016-02-04 09:54:01 -08:00
Bernd Verst 21201d7d16 Removes the MessageListNotificationBar editable component in favor of the existing MessageListHeaders
Summary: Removes the MessageListNotificationBar editable component in favor of the existing MessageListHeaders

Test Plan: Manually built N1 and verified the MessageListNotificationBar no longer appears as editable component.

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2523
2016-02-03 18:11:23 -08:00
Jackie Luo 3202a57d00 fix(composer-emojis): Fix bugs around null nodes and whitespace
Summary: Corrected the linting errors and changed some of the logic around tracking typed text and triggering properly.

Test Plan: Tested locally.

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2522
2016-02-03 18:10:56 -08:00
Ben Gotow 8b7c1aaa01 fix(send-action): Make dropdown trigger secondary send actions
We can come up with a new UX for this later, but for now this is important for consistency with the Reply/Reply-All/Forward picker and others in the app that perform actions rather than changing selection. Also makes it possible to choose to "Send and Archive" /without/ making it the future default, which will be nice when there are many you may want infrequently.
2016-02-03 16:27:11 -08:00
Ben Gotow b29b087a9f 💄(emoji): Add an icon / description to emoji package 2016-02-03 15:43:22 -08:00
Dakota Nelson 21ba15c5a5 Warn when entering Gmail address in imap settings
Summary:
Users have been configuring their Gmail accounts using the IMAP
authentication method, which causes problems. Attempting to do so will
now create an error message.

Test Plan: Tested locally.

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: mg, emfree

Maniphest Tasks: T6621

Differential Revision: https://phab.nylas.com/D2515
2016-02-03 15:14:02 -08:00
Evan Morikawa 918090a4e1 feat(error): improve error reporting. Now NylasEnv.reportError
Summary:
The goal is to let us see what plugins are throwing errors on Sentry.

We are using a Sentry `tag` to identify and group plugins and their
errors.

Along the way, I cleaned up the error catching and reporting system. There
was a lot of duplicate error logic (that wasn't always right) and some
legacy Atom error handling.

Now, if you catch an error that we should report (like when handling
extensions), call `NylasEnv.reportError`. This used to be called
`emitError` but I changed it to `reportError` to be consistent with the
ErrorReporter and be a bit more indicative of what it does.

In the production version, the `ErrorLogger` will forward the request to
the `nylas-private-error-reporter` which will report to Sentry.

The `reportError` function also now inspects the stack to determine which
plugin(s) it came from. These are passed along to Sentry.

I also cleaned up the `console.log` and `console.error` code. We were
logging errors multiple times making the console confusing to read. Worse
is that we were logging the `error` object, which would print not the
stack of the actual error, but rather the stack of where the console.error
was logged from. Printing `error.stack` instead shows much more accurate
stack traces.

See changes in the Edgehill repo here: 8c4a86eb7e

Test Plan: Manual

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2509
2016-02-03 18:06:52 -05:00
Jackie Luo 74db6eb90f feat(composer-emojis): Add emojis to composer
Summary:
Emojis can now be added in the composer window with colons and the emoji names (referenced by the same names used on Slack/GitHub/etc.).

When using the correct syntax, if there are emojis that match the text typed, they appear in a dropdown floating toolbar.

Selection works with either mouse clicks or arrow keys (plus `Enter`).

Currently, the toolbar won't trigger if the colon is adjacent to a non-whitespace character.

Test Plan: TODO: Will write tests soon!

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2505
2016-02-03 15:05:36 -08:00
Bernd Verst 6e35ce7dd7 Use vertical layout for MessageListHeaders, MessageListNotificationBar, Draft:Footer
Test Plan: No new tests. Visual verification.

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2514
2016-02-03 14:51:46 -08:00
Juan Tejada 1e02d8c9c0 fix(message): Limit number of collapsed recipients in message
Summary:
- `from` participants now have their own line
- `to` participants in collapsed mode merge `to`, `cc`, `bcc` as in
  gmail, and start in separate line from `from`
- number of `to` participants in collapsed mode is limited, and also overflows
  with an ellipsis with css in case its too long
- /some/ cleanup
- Unsuccessfully tried to update the css for the message item header to convert to a flexbox. Wrapping the `from` address when the text is too long is still a TODO
- Fixes #1113

Test Plan: - Manual

Reviewers: bengotow, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2507
2016-02-03 11:24:29 -08:00
Ben Gotow a038b23cab lint(tray): Fix "new Number" not allowed 2016-02-03 09:20:40 -08:00
Evan Morikawa 8b895068e2 feat(metadata): add cloudState that sync with Metadata service
Summary:
Now all plugins get passed a `cloudState` object to their `activate`
method.

The `cloudState` object is an instance of `CloudState` and acts like a
key-value store backed by the yet-to-be-implemented Metadata service.

It has a `get`, `getAll`, and `observe` method. The `observe` method
returns a new `Rx.Observable` for the given key.

It has a `set`, and `unset` method that doesn't actually mutate state, but
rather dispatches new `Task`s to Create, Update, and Delete `Metadata`
objects.

The whole object is backed by `Metadata` objects. Since these are standard
Database Objects that will appear on the delta sync streaming API, any
updates from the server will automatically propagate down to listening
views via the `Rx.Observable`s.

Additionally, there is a new `N1-Send-Later` stub plugin that demonstrates
how to use the `cloudState`.

There are few other minor refactors included in this diff:

**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.

**New `boundProps` for `InjectedComponents`**: When making the
`N1-Send_later` plugin, I realized that the injected component needed to
get the `cloudState` somehow. Traditionally components would require
Stores and load data that way, but these are setup at `require`-time. Now
that `cloudState` only is available on `activate` we needed a way to get
the data to the components. There's now the concept of `boundProps` which
will be props added to the Component when it gets injected. This required
changing the return signature of `findComponentMatching`, which got
renamed to `findComponentDataMatching`.

**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.

**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.

**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: drew, bengotow, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2419
2016-02-02 15:28:06 -05:00
Ben Gotow 5051bdbd61 fix(tray): Order of operations causing exception 2016-02-02 12:24:59 -08:00
Ben Gotow 180294e70c 💄(tray): Use locale string so unread count uses comma notation 2016-02-02 12:18:37 -08:00
Ben Gotow 277bdc4e10 💄(composer): Account dropdown aliases styling 2016-02-02 11:33:08 -08:00
Ben Gotow fd9850b74d 💄(thread-list): Correct top border on selected threads. Fixes #1189 2016-02-02 11:12:28 -08:00
Juan Tejada 460956bc37 fix(sidebar):Correctly update sidebar by listening to FocusedPerspective
-  Clean up AccountSwitcher a bit
2016-02-02 10:59:44 -08:00
Juan Tejada bdabd1de62 Revert "fix(sidebar): Correctly update sidebar when a notif is selected"
This reverts commit 0828badb921c81a9779b2e52ab4829bf0db07410.
2016-02-02 10:58:24 -08:00
Juan Tejada 236c5ddc53 fix(sidebar): Correctly update sidebar when a notif is selected
- Clean up AccountSwitcher a bit
2016-02-02 10:44:18 -08:00
Ben Gotow 11429727f9 fix(composer): Attachment check ignores uploads. Fixes #1190 2016-02-02 10:15:20 -08:00
Juan Tejada 6a14d5b561 fix(lint): Fix new eslint rule introduced with babel-eslint upgrade.
See https://phabricator.babeljs.io/T6925
2016-02-01 20:07:36 -08:00
Ben Gotow d9c4739f78 fix(contact): Converge on displayName(), don't show account label in ThreadList. Fixes #1157 2016-02-01 19:12:06 -08:00
Ben Gotow aade6a6579 rm(Nilas-contact-elements): Remove unused package 2016-02-01 19:12:06 -08:00
Juan Tejada c67bab052a fix(prefs): Fix selector for default account for send 2016-02-01 18:34:42 -08:00
Juan Tejada 9408feb7aa fix(default-alias):Show correct list of accounts and aliases in composer 2016-02-01 18:34:42 -08:00
Juan Tejada 617e2aed09 fix(remove-from-view): Update remove from view (shortcut) behavior
Summary:
- Now behaves exactly like in Gmail:
  - If viewing inbox, it will archive or trash, depending on setting
  - If viewing starred, will unstar
  - If viewing trash, will move to inbox
  - If viewing label, will remove label (no folder support)
  - No op otherwise
- Updates TaskFactory helpers and adds some helper methods
- Updates specs

Test Plan: - Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2492
2016-02-01 17:40:42 -08:00
Ben Gotow 648bf1b309 fix(send-and-archive): Was disabling signatures due to name collision 2016-02-01 17:33:18 -08:00
Ben Gotow 809f51f960 feat(reorder): Re-order mail rules (#1074) and accounts (#631)
Summary:
This implements EditableList re-ordering via a new prop callback.
You can drag and drop items in the mail rules list and the accounts list.
Note that you can't drag between lists - right now this is just to enable
re-ordering.

Test Plan: No new specs yet

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2495
2016-02-01 14:06:54 -08:00
Juan Tejada 46f331c0b1 fix(alias-list): Editable list wont create empty items
- Update alias coercion to include name by default
2016-02-01 12:45:52 -08:00
Juan Tejada a00adca3e5 fix(shortcuts): Add shortcut to mark as spam, fixes #765
- Minor cleanup + docs
2016-02-01 12:21:42 -08:00
Ben Gotow bf0f3828dc fix(thread-list): Remove dup accountIds to avoid extra work 2016-01-30 15:00:20 -08:00
Ben Gotow e37c95bb4d fix(send+archive): Update to use focused perspective 2016-01-29 19:01:47 -08:00
Ben Gotow c8d8bd0aee fix(thread-list): AccountId resolution for items outside loaded range 2016-01-29 17:56:57 -08:00
Evan Morikawa ec553b0c3d fix(pref): check for mounting on async launch service 2016-01-29 17:11:54 -08:00
Ben Gotow e6360cf18b feat(screenshot-mode): Minor fix to unmount method 2016-01-29 16:59:51 -08:00
Ben Gotow d61becc549 feat(screenshot-mode): Tiny feature for removing PII when taking debug screenshots 2016-01-29 16:39:07 -08:00
Ben Gotow 3c9db9bd85 fix(activity): "Long Polling" => "Delta Streaming" because we don't really poll. 2016-01-29 16:06:33 -08:00
Ben Gotow eec7c829ce fix(dropdown): Open up or down depending on position 2016-01-29 15:52:40 -08:00
Ben Gotow 2027901deb fix(uploads): Consolidate logic, use Promisify, path.join 2016-01-29 14:45:53 -08:00
Juan Tejada a3b686e546 fix(electron): Update api usage to require('electron') 2016-01-29 14:24:33 -08:00
Ben Gotow 48a64e7fef fix(focus): Don't clear when item is scrolled out of retained range 2016-01-29 12:34:58 -08:00
Juan Tejada 5c6a40ae96 fix(styles): Actually fix styles for faded recipient list 2016-01-29 11:18:28 -08:00
Juan Tejada f4f9db9310 fix(styles): Fix styles for faded recipient list 2016-01-29 11:13:25 -08:00
Juan Tejada 6c8a8bca8c fix(styles): Cleanup less files for account sidebar and switcher 2016-01-29 11:03:52 -08:00
Ben Gotow 180da72b77 fix(notifs): Categories inside Threads need accountId. Fixes #1155 2016-01-29 10:49:45 -08:00
Juan Tejada 21ebd82ece fix(sidebar): Update sidebar correctly when an account added or removed 2016-01-29 10:21:49 -08:00
Ben Gotow 183cbaff17 fix(config): observe fires immediately, causing re-renders 2016-01-29 00:31:10 -08:00
Juan Tejada be73b8bea8 fix(account-switcher): Don't display "All Accounts" when only 1 account 2016-01-28 19:53:12 -08:00
Evan Morikawa 6620779ee2 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 25db6c696d fix(labels): Never show labels UX for threads split across folders 2016-01-28 16:57:24 -08:00
Ben Gotow ef5a8fc8e9 fix(important): Hide important in message column of unified unless Gmail 2016-01-28 16:57:24 -08:00
Ben Gotow ef7c98af2c fix(account-sidebar): onToggleCollapsed => onCollapseToggled 2016-01-28 16:57:24 -08:00
Juan Tejada 896c1e1fe9 fix(sidebar): Prevent editing items in OutlineView when not allowed
- Fix check in OutlineViewItem
2016-01-28 16:21:21 -08:00
Ben Gotow 0fe0542bf9 fix(unified): Add a unified icon. designer gets back tues. 2016-01-28 16:01:22 -08:00
Juan Tejada 74c72e0915 add(docs): Add docs for OutlineView and OutlineViewItem
- Renames some stuff
2016-01-28 15:28:15 -08:00
Ben Gotow e39662983d fix(important): Fix bugs in "important" label categorization 2016-01-28 15:27:03 -08:00
Ben Gotow 52a7a6625f fix(linter): Switching between Coffee + ES6 is hard... 2016-01-28 14:59:17 -08:00
Ben Gotow d1415585d5 fix(contact-search): Keep only ranked contacts, query for others. Massive perf boost. 2016-01-28 14:56:15 -08:00
Drew Regitsky bb6f74d5f2 fix(templates): small CSS fix in preferences page 2016-01-28 14:51:31 -08:00
Juan Tejada f00f7c56f8 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 79c103ae15 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 67edcc836f 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 63102ba732 fix(message-list): Spec fixes, all stubs need accountId 2016-01-28 11:14:04 -08:00
Ben Gotow 3b03f141b1 fix(message-list): Only display labels when usesLabels() 2016-01-28 10:46:33 -08:00
Juan Tejada 6b274593dd Increment max width for sidebar 2016-01-28 01:29:18 -08:00
Juan Tejada 3343000f86 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 8b0a3a69db Update OutlineViewItem to focus end of input when editing 2016-01-28 00:02:55 -08:00
Juan Tejada bf2cebc08f 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 4ed14d137e Misc fixes for FileUploadStore 2016-01-27 15:38:01 -08:00
Juan Tejada bd675ba0c1 Fix ComposerView specs 2016-01-27 13:49:34 -08:00
Ben Gotow 7908ff7899 Basic fixes for drag and drop 2016-01-27 11:45:02 -08:00
Ben Gotow a77c9548d1 Fix sidebar when an account doesn't have a standard category 2016-01-27 11:14:11 -08:00
Juan Tejada fb1324f14e 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 695af8b983 More sending fixes - attachments working! 2016-01-26 18:03:01 -08:00
Juan Tejada 22d9947908 Misc fixes for FileUploadStore 2016-01-26 16:58:20 -08:00
Juan Tejada 8cb14d509f Refactor FileUploadStore and composer attachments - WIP 2016-01-26 15:36:38 -08:00
Juan Tejada b32bf65774 Fix when checking if draft is a reply when getting accounts for send 2016-01-26 13:55:26 -08:00
Ben Gotow 4f3de3fc97 Fix for bad @props 2016-01-25 19:07:28 -08:00
Juan Tejada b13ca724f1 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 b94c2e35e4 Fix AccountStore.current() references in private packages 2016-01-25 18:02:56 -08:00
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
Evan Morikawa 392753233e 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