Commit graph

100 commits

Author SHA1 Message Date
Juan Tejada 96846d4052 feat(download-all): Adds download-all button + style updates, more ES6
Summary:
- Adds initial version of download all button
- Converts attachments plugin to ES6 and adds updated styling
- Updates quoted text button
- #905, #1712

Test Plan: - Unit + manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2769
2016-03-21 18:23:26 -07:00
Jackie Luo c49d523e8f refactor(ui-variables): Clean UI variables for consistency/usage
Summary: Shortens and simplifies UI variables so that unused variables are no longer present.

Test Plan: Tested locally.

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2738
2016-03-15 11:18:50 -07:00
Ben Gotow 04492c06c7 fix(messages): Replace calc with margin to make plugin styling easier 2016-03-10 15:31:05 -08:00
Evan Morikawa dade20a148 fix(sidebar): minor sidebar style and padding tweaks 2016-03-10 15:06:59 -05:00
Ben Gotow 7a31da9fc9 fix(bodies): Move loading into component, add retry, loading spinner 2016-03-09 19:14:54 -08:00
Evan Morikawa 19682d8095 fix(search): search perf and fix css issues 2016-03-09 18:12:06 -05:00
Evan Morikawa 8475afbbfb fix(sidebar): ui tweaks to narrow sidebar 2016-03-09 15:46:10 -05:00
Evan Morikawa d4ef6a20e5 feat(sidebar): Add thread list of currently selected participants
Summary:
WIP. I added a collection index to make displaying the threads of a
currently selected participant on the sidebar easy and fast.

The problem is that the `participants` of a thread, while a collection of
`Contact` objects, have no "ids" for those contact objects.

One idea was to create the join table but access contacts by email instead
of id. This required a minor change to the way the data is entered in the
join table.

This means the sidebar can now simply do:

`DatabaseStore.findAll(Thread).where(Thread.attributes.participants.contains('foo@bar.com'))`

While I didn't for this initial test, we could also/instead create the
`Message-Contact` join table. The trick about a Message-Contact table is
that I believe we'd have to create additional columns further specifying
which field we're interested in.

The following two queries:

`DatabaseStore.findAll(Message).where(Message.attributes.to.contains('foo@bar.com'))`

`DatabaseStore.findAll(Message).where(Message.attributes.from.contains('foo@bar.com'))`

would require additional columns in the `Message-Contact` join table
because currently the only columns are `id` and `value`.

In the case of the sidebar use case, I think the Thread participants is
what you want to see anyway.

Unfortunately an email-centric scheme can't distinguish between
`noreply@phab.com <Evan>` and `noreply@phab.com <Juan>`. I actually think
this may be a good thing since I think most people think in terms of email
address as the unique key anyway and for the use case of showing related
emails in the sidebar I'd rather overshow than undershow.

This solution seems to be working pretty well in initial testing, but I
want to see if you guys can think of anything this may subtly screw up
down the line, or if you can think of a simpler way to do this.

Test Plan: todo

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2687
2016-03-09 14:33:31 -05:00
Evan Morikawa 10e0fcc965 feat(find-in-thread): add the ability to find in a thread
Summary: Find in thread

Test Plan: todo

Reviewers: bengotow, juan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2660
2016-03-02 14:46:27 -08:00
Ben Gotow f5ee557e2e feat(hidden-messages): Filter trash/spam messages. Fixes #1135
Summary:
By default, the messages in a thread are now filtered to exclude
ones moved to trash or spam. You can choose to view those messages by clicking
the new bar in the message list.

When you view your spam or trash, we only show the messages on those threads
that have been marked as spam/trash.

Test Plan: Run a couple new tests

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2662
2016-03-02 10:05:17 -08:00
Ben Gotow 04f93bd055 💄(print): Fix #1425 2016-02-26 14:40:16 -08:00
Ben Gotow 0559e92dc3 fix(sending): Tiny fix for strange vertical space when sending 2016-02-19 15:31:51 -08:00
Ben Gotow 298eb06548 💄: White buttons, dropdown / popover cleanup, hairline dividers 2016-02-18 15:21:42 -08:00
Ben Gotow 92abf1f441 🎨: Fixes, labels in narrow thread view, better label wrap 2016-02-11 15:25:24 -08:00
Ben Gotow 8a8170eb0e 🎨: 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 1b3c4cf594 fix(messages): Field label was always "To" 2016-02-05 18:42:29 -08:00
Bernd Verst f162353ce4 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
Juan Tejada 97e9637068 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
Jackie Luo d718c05e02 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:55:52 -08:00
Ben Gotow cd3aea9885 style(message-list): Correct alignment of dropdown. Fixes #659 2016-01-08 11:48:14 -08:00
Ben Gotow cc7b457bdd polish(quick-schedule): Use calendar icon in the composer 2015-12-09 10:55:08 -08:00
Ben Gotow 3931a0b948 fix(expand-all): Fixes for dark theme, don't show expand when one message 2015-12-07 18:01:06 -08:00
Juan Tejada e45a7526db feat(messages): Add button to expand/collapse all messages in thread
Summary:
- Works like Gmail does
- Adds specs

Test Plan: - Unit tests

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2301
2015-12-03 11:57:48 -08:00
Ben Gotow 452cbf1fa7 fix(ui-dark): Small color adjustments, resolves #299, #148 2015-11-09 18:52:24 -08:00
Evan Morikawa b76fd0e578 feat(windows): improve UI for Windows
Remove rounded corners and gradients
2015-10-21 20:32:33 -07:00
Evan Morikawa 1516e3fb8c feat(windows): upgarade preferences UI on Windows 2015-10-21 17:28:52 -07:00
Evan Morikawa 7969ed14c8 feat(win32): improve button styles for Win 8.1 spec 2015-10-21 12:17:34 -07:00
Evan Morikawa 658a267f9d fix(styles): padding fixes 2015-10-05 00:38:48 -07:00
Evan Morikawa c093cb1764 fix(styles): fix fonts in settings and iframe 2015-10-02 17:48:36 -07:00
Ben Gotow b84e99851a perf(toolbar): Remove rather than hide message toolbar items (incl. category picker) 2015-09-30 15:00:49 -07:00
Ben Gotow d5f4aa4ac0 fix(message-sidebar): New ContactCard injectable role, updated FocusedContactStore
- The FocusedContactStore was triggering too often, and leaving it up to the FullcontactStore to fetch the full Contact model for the focused contact (pulled from thread.)

The FocusedContactStore triggers more responsibly, and registering for the role "MessageListSidebar:ContactCard" now gives you the focused contact as a full database model. The whole ContactCard region also fades in and out.
2015-09-24 18:58:53 -07:00
Ben Gotow 3f3ec441ae feat(important): Improtant flags you can enable optionally for Gmail accounts
Summary: Fixes T3477

Test Plan: Tests are forthcoming

Reviewers: dillon, evan

Reviewed By: evan

Maniphest Tasks: T3477

Differential Revision: https://phab.nylas.com/D1990
2015-09-08 10:53:07 -07:00
dillon 6f9e2194eb fix(mode-toggle): mode toggler now toggles the sidebar rather than the list/split view. fixes T3462.
Summary:
add functioning toggling

add correct hide/show behavior for toggler

remove old hide/show button

add padding to make buttons prettier

Test Plan: tested manually. all tests remain green.

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T3462

Differential Revision: https://phab.nylas.com/D1980
2015-09-04 12:32:19 -07:00
dillon be54063659 fix(message-list): collapsed message participants no longer looks broken. fixes T3377.
Summary: moved non-view logic outside of the render function, which also helped for testing purposes

Test Plan: added a test, but this also leaves the window open for testing the other use cases beyond T3377. not sure whether we should add tests for this patch or for another ticket.

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T3377

Differential Revision: https://phab.nylas.com/D1916
2015-08-19 17:39:16 -07:00
dillon cd6f33250f fix(message-list): side-bar button shouldn't be selectable
Summary: fixes T2852

Test Plan: tested manually

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T2852

Differential Revision: https://phab.nylas.com/D1859
2015-08-10 11:40:19 -07:00
Evan Morikawa 9fe11bd655 fix(message-list): get rid of flicker and add transitions
Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1841
2015-08-04 19:35:56 -07:00
Ben Gotow 97c792b7f4 fix(message-scroll): Remove double overflow:auto to prevent scroll weirdness
Fixes T2357
2015-08-03 18:37:06 -07:00
Ben Gotow e68a139f4d fix(*): Minor performance tweaks and fixes to category picker
Summary:
fix(undo-redo): UndoRedoComponent does not take props

fix(category-picker):

- Use Actions.queueTask like the rest of the app so UndoRedoStore can see it. Can change this in the future but it's currently the only place in the app we directly queue tasks.

- Stop subscribing to the FocusedContentStore / FocusedCategoryStore (which are not used in setState?) since we receive threads as props

- Rename categoryDatum to item because it's not a category. (Was super confused that categories were becoming JSON in `_extendCategoryWithDisplayData`) Give item a category property so that tasks can specify items and not IDs (allows for better descriptions like "Moved one thread to Archive"

Add simple shouldComponentUpdate to retina-img

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1832
2015-08-03 17:05:31 -07:00
Ben Gotow b054ed431d fix(message-list-scrolling): Move scroll logic to ScrollRegion
Summary: This is still a work in progress and needs more specs

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1808
2015-07-30 18:29:38 -07:00
Evan Morikawa 9eb36f5813 fix(popover): don't let popover overflow
Summary:
The popover class now will adjust itself until it fits within the window
frame. You don't see the intermediate state in the double render.

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1795
2015-07-23 19:42:16 -07:00
Ben Gotow 60ccd86de1 fix(message): Show folder in expanded headers 2015-07-23 15:18:08 -07:00
Ben Gotow b412c580fc fix(workspace): Support for hidden locations / columns
Summary:
- New control will likely be shortlived - SDW mocking up replacement for when settings UI lands
- New action for toggling location hidden
- New rule for mail labels: can't remove "Sent"

Test Plan: Run tests - none new atm

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1782
2015-07-23 11:18:42 -07:00
Ben Gotow 3aa7801d89 fix(labels): Labels in the thread list and in the message subject line
Summary: Mail labels

Test Plan: No tests atm, just visual code

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1774
2015-07-21 11:50:08 -07:00
Ben Gotow 42a3359fa8 fix(toolbar-style): Add gradient to top toolbar, blurred styling 2015-07-16 17:51:18 -07:00
Ben Gotow b0f93dc52c fix(drag-n-drop): Remove react-dnd, display dropzone, allow tokens to be dragged out of app as plaintext
React-dnd is a nice library but it assumes it's going to be the only thing managing your drag and drop in the entire app. It also hides the underlying dataTransfer object so it's difficult to implement native drag and drop behaviors other than for Files and Urls, which they special-case.

Implementing it manually really isn't hard, and we can do things like attach a text/plain version of contact data to the contact drag.

Fixes T2054
2015-07-15 20:06:11 -07:00
Ben Gotow 4fe54c3d1e feat(attachments): Tons of tiny fixes to attachments, drag-and-drop attachments to other apps
Summary:
consolidate all the "untitled" stuff into a convenience method on the File itself. Previously it'd show "Unnamed Attachment", download as "Untitled" and open as "<file.id>". Now it's consistent everywhere and chooses names based on the contenttype (Event.ics).

Rewrite CSS rules for uploads and attachments to be simpler

- remove container divs and classnames from things that have no CSS
- switch to using Flexbox so it's not necesary to have so many containers
- remove zIndex hacks, apply overflow rules to name div only, so long filenames don't make action button unclickable
- consolidate CSS classnames for uploads/attachments
-

Other style fixes

- cursor "default" instead of text insertion on image attachments
- cursor "default" on action buttons
- image uplaods / attachments with long filenames truncate with ellpsis
- attachments are not indented by an extra 15px in message bodies

Prevent progress bar overflow (was ending above 100%, 100.12315%...)

Update FileDownloadStore so it never creates Download objects when file is downloaded already

- Previously, the download itself decided if it would be a no-op, but this meant the download was around for a split second and you'd see progress indicators flash for a moment when opening/saving an attachment.

Upgrade FileDownloadStore use of promises

Restore Image attachment drag and drop - was broken because the name gradient thing was covering the entire drag region.

Allow file attachments to be drag and dropped to the finder and other applications 😍😍😍

Test Plan: Tests still pass

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1745
2015-07-15 13:15:05 -07:00
Ben Gotow 769a5e5765 fix(back): Remove "Back to " prefix, centralize into back button itself, align using vertial-align instead of margin-top
Summary: Fixes T2135

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T2135

Differential Revision: https://phab.nylas.com/D1731
2015-07-13 16:33:57 -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 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