Commit graph

311 commits

Author SHA1 Message Date
Evan Morikawa e6e8932231 fix(composer): focus on the absolute end when clicking near the bottom 2016-02-25 13:31:34 -08:00
Drew Regitsky 097bc94cd7 fix(composer-buttons): Fix broken icons on overflow, make buttons wrap 2016-02-25 12:30:20 -08:00
Juan Tejada 9330f00549 💄(composer): Properly align 'X more' token 2016-02-25 11:42:38 -08:00
Evan Morikawa 717d20f96e fix(composer): minor padding fix in composer 2016-02-25 10:06:17 -08:00
Evan Morikawa f0e76019fd fix(error-handling): handle offline for link tracking & read-receipts
Fix offline error handling of link tracking and read receipts

Fix ellipses for tooltips

Allow you to change the title in the error box
2016-02-24 16:06:08 -08:00
Juan Tejada 9f87ab25dd fix(signature): Update signature when account is changed in composer
Summary:
- Fixes #1239
- Adds action in composer view to indicate when draft partcipants have
  changed. This seemed like the simplest way to listen for this change without
  adding another extension point
- Updates signature plugin to listen to this action and update signature
  accordingly
- Adds test

Test Plan: - Unit tests

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2614
2016-02-24 00:19:55 -08:00
Ben Gotow 6eed3ce054 fix(composer): Redo toolbar styling with theme variables + minor fixes 2016-02-23 15:40:44 -08:00
Evan Morikawa ac5266a1a5 fix(linter): fix less linter error 2016-02-23 14:18:49 -08:00
Evan Morikawa eb09929ae7 fix(composer): fix styles in popout composer 2016-02-23 13:55:31 -08:00
Evan Morikawa 6349a1ff0c feat(composer): new composer footer and icon design 2016-02-23 13:42:10 -08:00
Ben Gotow 42793e6b0c 💄 Minor visual tweaks to win32 + dark mode 2016-02-22 13:30:12 -08:00
Ben Gotow b6ebefe1ca fix(compose): More defensive check when switching from address, see description
This fixes #1341, but is more restrictive:

- You cannot switch From: accounts if the draft was retrieved from the sync engine (authored via Gmail or via another copy of N1. The sync-engine gives drafts a non-null threadId)

- You cannot switch From: accounts if the draft is a forward from an existing thread.

These two restrictions are unfortunately necessary to ensure that we don't have to download attachments we don't have to re-upload them to another account on the sync-engine. We could write code for this in the future but it's going to be gross.
2016-02-19 19:19:43 -08:00
Ben Gotow 9f8f1750cc fix(compose): Enable esc-to-cancel from Cannot Send dialog (Fixes #1383) 2016-02-19 18:59:17 -08:00
Ben Gotow b6a1674173 💄: White buttons, dropdown / popover cleanup, hairline dividers 2016-02-18 15:21:42 -08:00
Juan Tejada d0bdeb3a02 🎨(composer): Fix show-more token style in collapsed participants 2016-02-18 12:06:29 -08:00
Evan Morikawa 3298a38d6a fix(composer): fix dissapearing participant bug w/ multiple composers
If you had multiple composers on a single thread, all but the last
composer would lose its participants. This was because once it loaded the
participants would blur and trigger a request to set the participants to
blank. That request was async so by the time it was resolved the draft was
loaded and the request erroneously went through
2016-02-15 18:12:41 -05:00
Evan Morikawa 60f7290564 fix(messages): fix jumping message list on draft focus
We were erroneously jumping to an individual message when you focused on
it.
2016-02-15 16:34:23 -05:00
Ben Gotow 793fc5ef2c fix(min-height): Reduce minimum window size to 250px. Fixes #1293 2016-02-10 12:39:13 -08:00
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 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
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
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
Ben Gotow 277bdc4e10 💄(composer): Account dropdown aliases styling 2016-02-02 11:33:08 -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 eec7c829ce fix(dropdown): Open up or down depending on position 2016-01-29 15:52:40 -08:00
Juan Tejada a3b686e546 fix(electron): Update api usage to require('electron') 2016-01-29 14:24:33 -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
Ben Gotow d1415585d5 fix(contact-search): Keep only ranked contacts, query for others. Massive perf boost. 2016-01-28 14:56:15 -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 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
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
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 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
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
Evan Morikawa c2ceb6fd6c 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
Evan Morikawa 74e21bce16 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
Ben Gotow cb5f2985ef Merge branch 'master' into unified-inbox
# Conflicts:
#	spec/stores/file-download-store-spec.coffee
2016-01-13 17:20:34 -08:00
Juan Tejada 890db385f9 fix(warnings): Don't issue a warning for attachments when word attach in
signature

- Fixes #912
2016-01-12 18:45:27 -08:00
Juan Tejada 1c12fe3d6a 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 5c491d16af 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 0360c59460 fix(composer): Fix tabbing from body to subject 2016-01-11 18:13:42 -08:00
Ben Gotow 963d86cfd3 fix(composer): 30px area would focus wrap instead of contenteditable. Fixes #935 2016-01-11 17:44:55 -08:00
Ben Gotow 0aa4b88e1e fix(composer): Focus last element, not just text node 2016-01-11 17:44:17 -08:00