Commit graph

496 commits

Author SHA1 Message Date
Ben Gotow cc9d32b62f fix(reply-behavior): Reply keyboard shortcuts update existing draft rather than creating new ones
Summary:
When bcc or cc is added, the ComposerView should show the fields. We should never hide a populated field!

Move the logic for determining message reply / replyTo participant sets into the message object. This seems OK because the functions don't modify the message and deal entirely with message attributes

Fix miscelaneous scrollbar issue

The MessageList does not always fire a composeReply action in response to keyboard shortcuts and can update the existing draft instead

There are a couple goals here:
- If you have an existing draft, command-R and command-shift-R should never create a new draft, they should just update and focus the existing draft.
- If you actually press the Reply button on the message item it should still create a new draft. It's still possible to have two.
- If you press Command-R and add a participant, and then press Command-Shift-R, it should add participants but not blow away the one you've added manually.
- If you press Command-Shift-R and then Command-R, it should remove the participants that were part of the "reply all", but leave other participants you've added untouched.

Test Plan: Run new tests!

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T2140

Differential Revision: https://phab.nylas.com/D1734
2015-07-13 16:30:02 -07:00
Ben Gotow 9ff6e75c30 fix(quoted-text-button): New, more obvious design for quoted text toggle
Test Plan: Run existing tests

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T2282

Differential Revision: https://phab.nylas.com/D1735
2015-07-13 16:28:20 -07:00
Ben Gotow 1794111041 bump(electron): 0.29.2 and a few minor bug fixes
Summary:
Saving only 50 models at a time instead of 100 fixes a reproducible issue with database errors during initial sync on my machine. With 100, it reports "unexpected ; on line 2123..." during the query.

Only the main window should update the unread badge count.

Test Plan: Tests still pass and it seems like everything is still functional.

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1736
2015-07-13 16:28:06 -07:00
Evan Morikawa 9904df6e94 fix(composer): remove colon from "Subject" 2015-07-13 11:01:07 -04:00
Evan Morikawa 815b21ad36 fix(composer): fix double-sending issue
Summary:
Fixes T2275

Messages were still double sending sometimes because it took a while for
the Task to end up on the TaskQueue, which is what we were using to
determine re-sendability

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T2275

Differential Revision: https://phab.nylas.com/D1728
2015-07-13 10:50:27 -04:00
Evan Morikawa bda80df05c fix(*): can select participant with space if it's an email
Summary:
Fixes T2272

If the label is too long, the unread icons will now ellipsis truncate the
text correctly instead of being pushed off of the side.

I made the max-width of the sidebar 17px wider to allow for Karim's french
"Inbox" translation.

Fixes T2266

Added some more protection to places where filenames could be blank when
downloading.

This was partially fixed by Rob's D1685

Fixes T2258

You can now finish selecting a participant by pressing `space`, but only
when the participant looks like an email address.

When you do this we directly add the email address to the chip instead of
looking up a contact. This allows you to send just to the email instead of
adding a potentially erroneous name into the input field

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T2272, T2266, T2258

Differential Revision: https://phab.nylas.com/D1729
2015-07-13 10:25:30 -04:00
Evan Morikawa 1e146f6781 fix(composer): warn when empty body
Summary:
Fixes T2276
Since the new `QuotedHTMLParser` uses full HTML parsing, when you ask it
for the version of the document without the quoted nodes, it returns a
full html document. Unfortunately I forgot about the 2 <br> tags we
manually generate when creating a reply to a message with quoted text.

This is a pretty brittle solution, but considerably easier then checking
if the contents really are "blank". We could check innerText, but would
have to worry about img tags and other text-invisible-but-still-valid
elements. Since we control the generation of the reply in the
`DraftStore`, I think this is acceptable for now

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T2276

Differential Revision: https://phab.nylas.com/D1730
2015-07-13 10:12:52 -04:00
Evan Morikawa de110d4556 bump(version): 0.1.8 2015-07-09 14:32:14 -07:00
Evan Morikawa 72ff7c1627 fix(db): fix bug where seutp queries sometimes aren't run 2015-07-09 14:05:06 -07:00
EthanBlackburn a54bdc94fd Delete button now appears when drafts are selected
Summary: Fixes T2230 Support for deleting multiple drafts in the local drafts view

Test Plan: tested manually

Reviewers: bengotow, evan

Reviewed By: evan

Subscribers: gleb

Maniphest Tasks: T2230

Differential Revision: https://phab.nylas.com/D1714
2015-07-09 13:28:02 -07:00
Evan Morikawa 786ae7441d feat(api): add api-experimental.nylas.com as login option 2015-07-08 13:25:11 -07:00
Evan Morikawa bd72a29409 feat(quoted-text): New quoted text engine
Summary:
Add email reply parser

Quoted text detection for HTML

More blockquote specs

Added 'On … wrote:'

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1719
2015-07-08 09:51:33 -07:00
EthanBlackburn 9df066808b Contact first names now set to the first non-article word
Summary: Fixes T2179. This fixes the weird bug where first names like "The Nylas Team" was shortened to "The". The fix just chooses the first non-article word as the first name

Test Plan: tested manually

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: jennie

Maniphest Tasks: T2179

Differential Revision: https://phab.nylas.com/D1715
2015-07-07 12:08:59 -07:00
Ben Gotow 343bb3163b feat(offline-mode, undo-redo): Tasks handle network errors better and retry, undo/redo based on tasks
Summary:
This diff does a couple things:

- Undo redo with a new undo/redo store that maintains it's own queue of undo/redo tasks. This queue is separate from the TaskQueue because not all tasks should be considered for undo history! Right now just the AddRemoveTagsTask is undoable.

- NylasAPI.makeRequest now returns a promise which resolves with the result or rejects with an error. For things that still need them, there's still `success` and `error` callbacks. I also added `started:(req) ->` which allows you to get the underlying request.

- Aborting a NylasAPI request now makes it call it's error callback / promise reject.

- You can now run code after perform local has completed using this syntax:

```
    task = new AddRemoveTagsTask(focused, ['archive'], ['inbox'])
    task.waitForPerformLocal().then ->
      Actions.setFocus(collection: 'thread', item: nextFocus)
      Actions.setCursorPosition(collection: 'thread', item: nextKeyboard)
    Actions.queueTask(task)
```

- In specs, you can now use `advanceClock` to get through a Promise.then/catch/finally. Turns out it was using something low level and not using setTimeout(0).

- The TaskQueue uses promises better and defers a lot of the complexity around queueState for performLocal/performRemote to a task subclass called APITask. APITask implements "perform" and breaks it into "performLocal" and "performRemote".

- All tasks either resolve or reject. They're always removed from the queue, unless they resolve with Task.Status.Retry, which means they internally did a .catch (err) => Promise.resolve(Task.Status.Retry) and they want to be run again later.

- API tasks retry until they succeed or receive a NylasAPI.PermanentErrorCode (400,404,500), in which case they revert and finish.

- The AddRemoveTags Task can now take more than one thread! This is super cool because you can undo/redo a bulk action and also because we'll probably have a bulk tag modification API endpoint soon.

Getting undo / redo working revealed that the thread versioning system we built isn't working because the server was incrementing things by more than 1 at a time. Now we count the number of unresolved "optimistic" changes we've made to a given model, and only accept the server's version of it once the number of optimistic changes is back at zero.

Known Issues:

- AddRemoveTagsTasks aren't dependent on each other, so if you (undo/redo x lots) and then come back online, all the tasks try to add / remove all the tags at the same time. To fix this we can either allow the tasks to be merged together into a minimal set or make them block on each other.

- When Offline, you still get errors in the console for GET requests. Need to catch these and display an offline status bar.

- The metadata tasks haven't been updated yet to the new API. Wanted to get it reviewed first!

Test Plan: All the tests still pass!

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1694
2015-07-07 13:38:53 -04:00
Ben Gotow 069c145442 bump(version): 0.1.7 2015-07-06 16:02:20 -04:00
Ben Gotow 74c1f21848 fix(getting-started): New menu item, sample package for devs 2015-07-06 14:23:51 -04:00
Ben Gotow 883e2c0f40 fix(database): Do not send empty error JSON 2015-07-02 19:24:43 +02:00
Ben Gotow 54558c5e5b fix(linux): Resolve linux launch issue due to missing require 2015-07-02 19:15:46 +02:00
Ben Gotow 771b5023c1 fix(database): Ensure errors reach the renderer-side by sending them as JSON strings, reinflating as Errors 2015-07-02 19:15:31 +02:00
Ben Gotow f29b24c5b2 fix(downloads): Cannot download unnamed attachments (resolves Sentry #598) 2015-07-02 18:54:59 +02:00
Ben Gotow d5a7a60700 fix(nylas-api): When offline, response is undefined 2015-07-02 18:54:16 +02:00
Ben Gotow d8ec1417ec updater(*): Send current platform in update check, publish to S3 in /darwin/ folder 2015-06-30 11:03:24 -07:00
Ben Gotow 4267de5f1e fix(quoted-text): Do not consider gmail_extra quoted text
I don't know what gmail_extra is used for, but it appears from @mg's sample messages that it does not indicate quoted regions of the body. We also weren't looking for it in our hasQuotedText function.
2015-06-29 17:26:14 -07:00
Ben Gotow 7ff724493c fix(attachment-css): Tiny style tweaks 2015-06-29 17:25:00 -07:00
Ben Gotow b738770379 fix(button-dropdown): merge causing style conflicts 2015-06-26 18:03:28 -07:00
Ben Gotow 398771674c bump(version): 0.1.6 2015-06-26 17:58:14 -07:00
EthanBlackburn 067834839c Reply all behavior and button click capturing
Summary:
If an email is to a group, the reply button should have `To` set the original email sender and `Cc` the group Fixes Phab ticket 2142. Previously, the click on the reply button was not captured unless the click occured on the reply or reply all icon. Changed the span to a div with no padding that captures all clicks

Test Plan: tested manually, unit tests

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: evan

Maniphest Tasks: T2142

Differential Revision: https://phab.nylas.com/D1696
2015-06-26 16:45:05 -07:00
Ben Gotow 93ea7ec039 fix(database): Bad reference to queryKey bricking app after slow queries!
Also changed _query to just run a callback because we were doing callback => promise => callback in the IPC handler.
2015-06-26 16:35:27 -07:00
Ben Gotow f0c9c6b033 fix(search): Reliably clear back to previously selected Tag when you click "X"
Fixes T1173
2015-06-26 16:15:21 -07:00
Ben Gotow 60102cb55b fix(invariant): Warnings when trying to settle scroll state after unmount 2015-06-26 16:08:41 -07:00
Ben Gotow d3542fef46 fix(counts): Centralize handling of unread count / draft count
Fixes T2155 and T1765
2015-06-26 16:02:08 -07:00
Ben Gotow 8d60325ee0 fix(reply-dropdown): Improved assets and dropdown styles, hit regions 2015-06-26 15:03:13 -07:00
Ben Gotow 4b8dd87410 fix(T2049): in 2-pane mode, keyboard actions are applied to selection, not message you are viewing
Fixes T2049 and moves ownership of the reply/reply-all/forward actions to the MessageList, which Rob did for starring and actually makes more sense.
2015-06-26 14:47:14 -07:00
Robert McQueen 84295b05d0 Add (s) hotkey for starring in both thread-list and message-list views
Summary:
Adding spec for message list star. Fixing multi-select in 3-pane starring

I didn't write a spec for thread-list because the thread-list-spec appears to be broken (returns immedietly at the top). I spent ~15 minutes attempting to fix but didn't make much progress

Test Plan: Added spec to message list

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T1957

Differential Revision: https://phab.nylas.com/D1697
2015-06-26 14:06:31 -07:00
Ben Gotow fd20d7489a fix(T2138): Clicking the area "around" the arrow inside the button doesn't trigger it
Fixes T2138
2015-06-26 13:49:16 -07:00
Ben Gotow 4d4b942c94 bump(version): 0.1.5 2015-06-26 13:26:45 -07:00
Evan Morikawa 68a0f73390 fix(db): fix database setup 2015-06-26 11:23:37 -07:00
Ben Gotow 769d497b4b fix(windows): Bad merge 2015-06-26 10:54:18 -07:00
Ben Gotow 0b68dbc2e2 fix(windows): Minor changes to support windows
Summary: Small tweaks to fix the windows build. Details in inline comments

Test Plan: Run windows build

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1689
2015-06-26 10:50:19 -07:00
Ben Gotow a757c0812f fix(assets): New toolbar icons, shadows to achieve less heavy edges on messages
Summary: Just visual changes

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1695
2015-06-26 10:38:07 -07:00
Evan Morikawa cd9ccd85e2 refactor(DB): promisify database
Summary:
WIP. The app launches and works for me. I still need to fix the tests
just the DB ones though :D

I changed the `DatabaseProxy` into a `DatabaseConnection` object. It will
request a fully instantiated databse from the backend Browser.

If we're already setup, it'll connect straight to the existing DB.

If we're not setup, then it'll create a new database and run the inital
schema migration on it. The `_createNewDatabase` promise won't resolve
until the migration has run.

Until we add in a more sophisticated migration system and get rid of the
stupid `modelClassMap` that's shoved in `Utils`, I'm passing in a series
of `_setupQueries()` to get everything started.

The `DatabaseConnection` is also the one responsible for queuing up
queries until the DB is fully populated and ready to go.

We actually get a lot of queries before we're setup because a lot of
Stores will make DB requests on `require` in their `constructor` or `init`
methods. (remember all the times we call `_populateStore` in `init`).

Now those queries are aggregated by the `DatabaseConnection` and then
executed sequentially.

Our methods like `persistModel` now resolve only after both the queries
have completed AND their corresponding `triggerLater` has completed as
well.

Test Plan: in progress

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1688
2015-06-26 07:42:41 -07:00
Evan Morikawa 70a83a648d fix(*): minor fixes
Summary:
Fixes T1905 - Gost line in recipients field
Fixes T1877 - Collapsed dates should not show time

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T1877, T1905

Differential Revision: https://phab.nylas.com/D1671
2015-06-26 07:06:57 -07:00
Robert McQueen 2c09cc18d7 Add attachement icon to collapsed message if message has attachement
Summary: Adds attachment icon to collased message if message has attachment. I just copied the attachment icon in the thread-list to the message-list namespace in the static directory. If you want to do it another way, feel free to update

Test Plan: Tested locally. Not sure if this is worth a test, but I can write one if you want.

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T2085

Differential Revision: https://phab.nylas.com/D1687
2015-06-25 10:35:06 -07:00
Robert McQueen 28692ff5af feat(starring): Star/unstar from the message detail view
Summary: Adding star button to message-toolbar view

Test Plan: Added spec for starring message from the message-toolbar view

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1683
2015-06-25 10:33:26 -07:00
Robert McQueen 1dc43770a6 Adding ATag component which prevents <a> tags from taking over edgehill when clicked.
Summary: Applying the new ATag to the admin sidebar per the bug T2075

Test Plan: Tested locally. I'm unsure how to test how an ATag can open a browser window, so I forego'd a unit test

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T2075

Differential Revision: https://phab.nylas.com/D1686
2015-06-25 10:28:31 -07:00
Robert McQueen b42d102740 Include unnamed files as attachements and rename to 'Unnamed Attachement'
Summary: Fixes T2024 and renames unnamed files to Unnamed Attachment before appending the attachement component to message list

Test Plan: Added a test to ensure file without filename is renamed to Unnamed Attachment

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T2024

Differential Revision: https://phab.nylas.com/D1685
2015-06-25 09:51:46 -07:00
Michael Grinich 13f3669ebf add win32 exe renaming 2015-06-24 13:41:15 -07:00
Ben Gotow 8c764ca75d fix(composer): Show a scrollbar in the popout composer
Summary:
Fixes T1990

Change the ScrollRegion component so that you can optionally provide a getScrollbar prop that resolves to a ScrollRegion.Scrollbar component. This allows you to easily put the Scrollbar outside of the ScrollRegion if necessary.

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T1990

Differential Revision: https://phab.nylas.com/D1665
2015-06-23 15:21:25 -07:00
Evan Morikawa ffe87e4e9c fix(build): fix tello issue and less linter issue 2015-06-22 17:12:26 -07:00
Evan Morikawa 012c610009 fix(less): import for build script 2015-06-22 16:28:25 -07:00