Summary: RSVP tile now appears for messages with attached events.
Test Plan: Tested manually. Will add unit tests
Reviewers: evan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D1797
Summary: Threads are now sorted using the thread's receivedrecentdate instead of recentdate
Test Plan: Tested Manually
Reviewers: bengotow
Reviewed By: bengotow
Subscribers: mg
Differential Revision: https://phab.nylas.com/D1812
Summary:
We need to remove quoted text completely from bodies in a composer.
Unfortunately, that makes it very difficult to determine how to put it
back in.
For now the scheme is to append the quoted text at the end. However, that
means that we need to only pull out quoted text at the end of a message.
Unfortunately there are lots of places that quoted text appears inline
with regular text.
Determining whether or not some content is at the "end" of a message
turned out to be non-trivial.
We now have a new `DOMUtils` that looks for empty areas at the end.
We also have a new quoted HTML parser that finds trailing quotes.
Fixes T2335
Test Plan: lots of new quoted text tests
Reviewers: bengotow
Reviewed By: bengotow
Maniphest Tasks: T2335
Differential Revision: https://phab.nylas.com/D1773
Summary:
- You cannot drag an attachmentComponent unless it represents a fully downloaded file on disk.
- You cannot drag and drop an item from a composer onto the same composer.
- Attachments on expanded messages start downloading as soon as it's viewed (necessary for drag and dropping attachments, also probably best. Previously was just images.)
- You can now cancel an attachment download. Was really broken.
Test Plan: Run many new specs!
Reviewers: evan
Reviewed By: evan
Maniphest Tasks: T1196
Differential Revision: https://phab.nylas.com/D1764
Summary: The diff adds very basic versioning to the database via sqlite's built-in `user_version`. If the version is bumped in DatabaseStore, it means that all existing data should be blown away and the user should have to refetch the entire cache. Critically, this does not log the user out.
Test Plan: Run no new tests :-(
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1760
Summary:
There are now two objects, Folders & Labels. These inherit from `Category`
(that's what Eben said they were using on the backend).
There are two separate tasks.
1. MoveToFolderTask
2. ApplyLabelsTask
It turns out that the semantics between the two are quite different.
The reverse operation for moving to a folder is a bit tricky.
As of 7-8-15, the Tasks are pretty much complete. I need to write tests
for them still and do some manual testing in the client.
Test Plan: Writing specs
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D1724
Summary:
Cancelling a file upload properly makes the task return Task.Status.Finished (previously it was broken and returning Task.Status.Retry)
Dragging a directory now gives you a nice error message
Aborting an upload now looks for the task with the given ID, not a task with the given filepath since there could be identical uploads happening in other windows
Make it more explicit that the uploadId is not the task ID
Add a few tests
Test Plan: Run new tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1750
Summary:
- Draft Store extensions can now implement `prepareNewDraft` to have an opportunity to change a draft before it's displayed for the first time.
- When composers are torn down, they delete their draft if it is still pristine. This makes the behavior of closing unedited popout drafts the same as leaving unedited inline drafts.
- The DraftStoreProxy keeps the initial body of the draft *if* it started in a pristine state. This means "is the body empty" is just a simple == check, and it takes into account anything added to the body by extensions.
- Calling Actions.destroyDraft doesn't blow up anymore if the draft session can't be found. This was a bug and meant that you couldn't destroy drafts which hadn't been previously edited, and also meant that bad things(tm) happened when you called destroyDraft twice, which seemed like overkill.
- DestroyDraft task now exits gracefully when the draft cannot be found.
You can test this feature by adding the following to your config.cson:
```
signatures:
NAMESPACEID: "<br/><br/><div id=\"Signature\"><div id=\"divtagdefaultwrapper\" style=\"font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif\"><p></p><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"450\" style=\"font-family:'Times New Roman'; table-layout:fixed\"><tbody><tr><td class=\"logo-td\" align=\"left\" valign=\"top\" width=\"76\"><p style=\"margin-bottom:10px; margin-right:10px; font-family:Helvetica,Arial,sans-serif; font-size:14px; line-height:16px\"><a href=\"http://www.nylas.com/\" class=\"clink logo-container\" style=\"text-decoration:none\"><img alt=\"Nylas\" border=\"0\" class=\"sig-logo\" height=\"80\" width=\"66\" style=\"-webkit-user-select: none;\" src=\"https://s3-us-west-2.amazonaws.com/nylas-static-assets/nylas-email-signature.png\"></a></p><p class=\"social-list\" style=\"font-size:0px; line-height:0; font-family:Helvetica,Arial,sans-serif\"></p></td><td align=\"left\" valign=\"top\" nowrap=\"nowrap\" class=\"spacer-td\" width=\"16\" style=\"border-left-width:2px; border-left-style:solid; border-left-color:rgb(30,162,162)\"><img width=\"10\" style=\"-webkit-user-select: none;\" src=\"https://s3.amazonaws.com/htmlsig-assets/spacer.gif\"></td><td align=\"left\" valign=\"top\" nowrap=\"nowrap\" class=\"content-td\" width=\"368\"><div class=\"content-pad\"><p style=\"font-family:Helvetica,Arial,sans-serif; font-size:14px; line-height:16px; color:rgb(33,33,33); margin-bottom:10px\"><span class=\"txt signature_name-target sig-hide\" style=\"font-weight:bold; display:inline\">Gleb Polyakov</span> <span class=\"email-sep break\" style=\"display:inline\"><br></span><a class=\"link email signature_email-target sig-hide\" href=\"mailto:gleb@nylas.com\" style=\"color:rgb(30,162,162); text-decoration:none; display:inline\">gleb@nylas.com</a><span class=\"signature_email-sep sep\" style=\"display:inline\"> / </span><span class=\"txt signature_mobilephone-target sig-hide\" style=\"display:inline\">404-786-4100</span></p><p style=\"font-family:Helvetica,Arial,sans-serif; font-size:14px; line-height:16px; margin-bottom:10px\"><span class=\"txt signature_companyname-target sig-hide\" style=\"font-weight:bold; color:rgb(33,33,33); display:inline\">Nylas</span> <span class=\"company-sep break\" style=\"display:inline\"><br></span><span class=\"address-sep break\"></span><span class=\"address2-sep break\"></span><span class=\"website-sep break\"></span><a class=\"link signature_website-target sig-hide\" href=\"http://www.nylas.com/\" style=\"color:rgb(30,162,162); text-decoration:none; display:inline\">http://www.nylas.com</a></p></div></td></tr><tr><td colspan=\"3\"></td></tr><tr><td colspan=\"3\"></td></tr><tr><td colspan=\"3\"><p class=\"txt signature_disclaimer-target\" style=\"font-family:Helvetica,Arial,sans-serif; color:rgb(33,33,33); font-size:9px; line-height:12px; margin-top:10px\"></p></td></tr></tbody></table><p></p></div></div>"
```
specs for draft store extension hooks, some draft store refactoring
Test Plan: Run a few new specs that make sure extensions are run
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1741
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
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
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
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
Summary:
Fixes T1927
- Allow email addresses to contain `_`
- Centralize logic for parsing string into Contact objects into ContactStore
- Always decode and then encode mailto links to ensure spaces, special characters are properly encoded and that the URL is valid
- Add specs for mailto:// behavior
Test Plan: Run wonderful new tests covering mailto://
Reviewers: evan
Reviewed By: evan
Maniphest Tasks: T1927
Differential Revision: https://phab.nylas.com/D1657
Summary:
Allow Database models to create indexes, but don't autocreate bad ones
fix minor bug in error-reporter
Fix index on message list to make thread list lookups use proper index
Developer bar ignores state changes unless it's open
DatabaseView now asks for metadata for a set of items rather than calling a function for every item. Promise.props was cute but we really needed to make a single database query for all message metadata.
New "in" matcher so you can say `thread_id IN (1,2,3)`
Add .scroll-region-content-inner which is larger than the viewport by 1 page size, and uses transform(0,0,0) trick
ScrollRegion exposes `onScrollEnd` so listTabular, et al don't need to re-implement it with more timers. Also removing requestAnimationFrame which was causing us to request scrollTop when it was not ready, and caching the values of...
...clientHeight/scrollHeight while scrolling is in-flight
Updating rendered content 10 rows at a time (RangeChunkSize) was a bad idea. Instead, add every row in a render: pass as it comes in (less work all the time vs more work intermittently). Also remove bad requestAnimationFrame, and prevent calls to...
...updateRangeState from triggering additional calls to updateRangeState by removing `componentDidUpdate => updateRangeState `
Turning off hover (pointer-events:none) is now standard in ScrollRegion
Loading text in the scroll tooltip, instead of random date shown
Handle query parse errors by catching error and throwing a better more explanatory error
Replace "quick action" retina images with background images to make React render easier
Replace hasTagId with a faster implementation which doesn't call functions and doesn't build a temporary array
Print query durations when printing to console instead of only in metadata
Remove headers from support from ListTabular, we'll never use it
Making columns part of state was a good idea but changing the array causes the entire ListTabular to re-render. To avoid this, be smarter about updating columns. This logic could potentially go in `componentDidReceiveProps` too.
Fix specs and add 6 more for new database store functionality
Test Plan: Run 6 new specs. More in the works?
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1651
Summary: Resolves T1984 fixes T1984 closes T1984
Test Plan: Run two new test cases
Reviewers: evan
Reviewed By: evan
Maniphest Tasks: T1984
Differential Revision: https://phab.nylas.com/D1654
Summary:
Silence buffered process spec
Clean up error reporter and spec bootup
fix errors in draft store spec
package manager spec and theme spec fixes
Fix memory leak in draft store
Test Plan: mmmmmm tests. Run all those green passing tests :)
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D1628
Summary:
Give DatabaseStore trigger payload a 'type' so that you can handle the deletion of objects (clear focus if the object is focused, know to remove it from database view)
Fix specs and add one for new DatabaseView => unpersist handler
Test Plan: Run new test case
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1639
Summary:
Fix bug in apm_wrapper
Refactor model selection so that it's easier to understand the logic for split vs list mode
Test Plan: Run new specs (WIP)
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1619
Summary:
There's now an `updateLevel` that can be set in the config file.
It has the valid values of "major", "minor", "patch", and "commit". By
default it upgrades on the "patch" level.
If you want to be on the bleeding edge, manually change the config file to
add `updateLevel: 'commit'`
Test Plan: A new `auto-update-manager-spec` :)
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D1567
Summary:
This diff attempts to improve the responsiveness of the app when you hit "Reply". This is achieved by being smarter about creating the draft and loading it into the draft store, and also by allowing the compose* actions to take objects instead of just IDs (resulting in a fetch of the object).
Allow Actions.composeReply,etc. to optionally be called with thread and message objects instead of IDs. This prevents a database lookup and the data is "right there."
Create DraftStoreProxy for new drafts optimistically—this allows us to hand it the draft model we just created and it doesn't have to go query for it
When we create a new Draft, immediately bind it to a LocalId. This means that when the MessageStore receives the trigger() event from the Database, it doesn't have to wait while a localId is created
When MessageStore sees a new Message come in which is on the current thread, a draft, and not in the localIds map, assume it's a new draft and shortcut fetchFromCaceh to manually add it to the items array and display. This means the user sees the...
...draft instantly.
Remove delays from focusing draft, scrolling to draft after content is ready. I actually removed these thinking it would break something, and it didn't break anything.... Maybe new Chromium handles better?
Fix specs
Test Plan: Run specs - more in progress right now
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1598
Summary:
Features:
- ThreadListParticipants ignores drafts when computing participants, renders "Draft" label, pending design
- Put the WorkspaceStore in every window—means they all get toolbars and custom gumdrop icons on Mac OS X
Bug Fixes:
- Never display notifications for email the user just sent
- Fix obscure issue with DatabaseView trying to update metadata on items it froze. This resolves issue with names remaining bold after marking as read, drafts not appearing in message list immediately.
- When you pop out a draft, save it first and *wait* for the commit() promise to succeed.
- If you scroll very fast, you node.contentWindow can be null in eventedIframe
Other:
Make it OK to re-register the same component
Make it possible to unregister a hot window
Break the Sheet Toolbar out into it's own file to make things manageable
Replace `package.windowPropsReceived` with a store-style model where anyone can listen for changes to `windowProps`
When I put the WorkspaceStore in every window, I ran into a problem because the package was no longer rendering an instance of the Composer, it was declaring a root sheet with a composer in it. This meant that it was actually a React component that needed to listen to window props, not the package itself.
`atom` is already an event emitter, so I added a `onWindowPropsReceived` hook so that components can listen to window props as if they were listening to a store. I think this might be more flexible than only broadcasting the props change event to packages.
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1592
Summary:
- ModelViewSelection shouldn't break if you accidentally call it with null
- ModelViewSelection methods should throw if you pass non-items, need to do this to narrow down other Sentry errors
Test Plan: Run new specs
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1589
Summary: Fixed T1743. Adds the replyTo field to Message objects and handling to the DraftStore. Also adds specs to make sure we don't break it.
Test Plan: Run 3 new tests
Reviewers: evan
Reviewed By: evan
Maniphest Tasks: T1743
Differential Revision: https://phab.nylas.com/D1565
Summary:
atom-window `sendMessage` was not the same as `browserWindow.webContents.send`. WTF.
Save current namespace to config.cson so that it is never null when window opens
Don't re-create thread view on namespace change unless the namespace has changed
Tests for NamespaceStore state
Push worker immediately in workerForNamcespace to avoid creating two connections per namespace
Allow \n to be put into sreaming buffer, but only one
Clear streaming buffer when we're reconnecting to avoid processing same deltas twice (because of 400msec throttle)
Make `onProcessBuffer` more elegant—No functional changes
Test Plan: Run tests!
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1551
Summary:
fix(task-queue): Repair the findTask function
Add "ship logs" and "open logs" to the developer menu
Patches for Chromium 42
Test Plan: Run tests!
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1547
Summary:
- We now make verbose log files continuously as you use the app
- We ship the logs to LogStash via S3 when an exception occurs
- We log the DatabaseStore, ActionBridge and Analytics packages
- We are now on the latest version of Electron 0.26.0
- We are now on Chrome 42 and io.js 1.4.3
- We should be setup to use ASAR soon.
Update atom.sh to reflect that we're now electron
oniguruma was unnecessary
correctly find log files that haven't been shipped yet
Fix a small issue with nodeIsVisible after upgrade to Chrome 42
Delete old logs, better logging from database store, don't ship empty logs
Test Plan: Run existing tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1531
Summary:
Fixes T1327
Fixes T1294
Fixes T1307
Fixes T1207
- More robus Undo Manager
- Scrolls to the most recent undo location
- Fixes a variety of bugs when the composer's cursor ends up in an unsupported
location
- Fixes auto-scroll detection at end of content
Test Plan: edgehill --test
Reviewers: bengotow
Reviewed By: bengotow
Maniphest Tasks: T1207, T1294, T1307, T1327
Differential Revision: https://phab.nylas.com/D1529
Summary:
Fixes: T1334
remove final InboxApp references
move out all underscore-plus methods
Mass find and replace of underscore-plus
sed -i '' -- 's/underscore-plus/underscore/g' **/*.coffee
sed -i '' -- 's/underscore-plus/underscore/g' **/*.cjsx
Test Plan: edgehill --test
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D1534
Summary:
Rename ActivityBar => DeveloperBar
Expose sync workers and make them observable
New activity sidebar that replaces momentary notifications
Updated specs
Test Plan: Run new specs!
Reviewers: evan
Reviewed By: evan
Maniphest Tasks: T1131
Differential Revision: https://phab.nylas.com/D1521
Summary:
This is an effort to make the logic around the process of sending a draft
cleaner and easier to understand.
Fixes T1253
Test Plan: edgehill --test
Reviewers: bengotow
Reviewed By: bengotow
Maniphest Tasks: T1253
Differential Revision: https://phab.nylas.com/D1518
Summary: Closes T1264: Drafts save when they close
Test Plan: edgehill --test
Reviewers: bengotow
Reviewed By: bengotow
Maniphest Tasks: T1264
Differential Revision: https://review.inboxapp.com/D1515