Summary: NOTE: this ticket and this diff do not address turning the 'Important' label into a more user-friendly chevron. I created T3477 for that.
Test Plan: added more tests. however, seems like somebody merged some tests which are failing.
Reviewers: bengotow, evan
Reviewed By: evan
Maniphest Tasks: T3454
Differential Revision: https://phab.nylas.com/D1963
Summary: I think I might've broken this when I fixed T3402, but I didn't realize it because I had zero drafts at the time, so this component didn't render for me.
Test Plan: tested manually
Reviewers: bengotow
Maniphest Tasks: T3402, T3480
Differential Revision: https://phab.nylas.com/D1965
Summary:
WIP: changing the rest of items to make them look correct
fix last draft item in sidebar
add more padding
Test Plan: tested manually. all tests remain green.
Reviewers: evan, bengotow
Reviewed By: bengotow
Maniphest Tasks: T3402
Differential Revision: https://phab.nylas.com/D1943
Summary:
Move sync workers and Edgehill token checks to work window
Move the task queue and database setup to the work window
Move ContactStore background refresh to work window
Store the task queue in the database
WIP
The TaskQueue now puts tasks in the database instead of in a file, which also means it can be observed
Move all delta sync and initial sync to a package, make NylasSyncStore which exposes read-only sync state
DraftStore no longer reads task status. Once you set the "sending" bit on a draft, it never gets unset. But that's fine actually.
If your package lists windowTypes, you *only* get loaded in those windowTypes. If you specify no windowTypes, you get loaded in the root window.
This means that onboarding, worker-ui, worker-sync, etc. no longer get loaded into the main window
ActivitySidebar has a special little store that observes the task queue since it's no longer in the window
Move "toggle component regions" / "toggle react remote" to the Developer menu
Move sync worker specs, update draft store specs to not rely on TaskQueue at all
Test Plan: Run existing tests, all pass
Reviewers: dillon, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1936
It's possible that 400 characters isn't enough to get any plaintext (if the body begins with a style tag, for example.) Until we get a better solution in place, we need to do this to avoid parsing the king james bible in my draft.
Summary:
This diff replaces the Namespace object with the Account object, and changes all references to namespace_id => account_id, etc. The endpoints are now `/threads` instead of `/n/<id>/threads`.
This diff also adds preliminary support for multiple accounts. When you log in, we now log you in to all the attached accounts on edgehill server. From the preferences panel, you can auth with / unlink additional accounts. Shockingly, this all seems to pretty much work.
When replying to a thread, you cannot switch from addresses. However, when creating a new message in a popout composer, you can change the from address and the SaveDraftTask will delete/re-root the draft on the new account.
Search bar doesn't need to do full refresh on clear if it never committed
Allow drafts to be switched to a different account when not in reply to an existing thread
Fix edge case where ChangeMailTask throws exception if no models are modified during performLocal
Show many dots for many accounts in long polling status bar
add/remove accounts from prefs
Spec fixes!
Test Plan: Run tests, none broken!
Reviewers: evan, dillon
Reviewed By: evan, dillon
Differential Revision: https://phab.nylas.com/D1928
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
Summary:
Fix edge cases where _getRangeInScope is null, fix logic errors
fix(1932) Edge case where we can't find a container for the message Id we're asked to scroll to
Check view exists before trying to perform actions. Will be fixed once keybindings are a React container
Test Plan: Run specs
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1906
Summary: @evan -- would love to get your opinion on this approach!
Test Plan: add new tests
Reviewers: evan
Reviewed By: evan
Subscribers: evan
Maniphest Tasks: T3360
Differential Revision: https://phab.nylas.com/D1904
Summary:
"results.length" not "result.length".
Eventually I want MessageBodyProcessor to be the public interface to another process which asynchronously runs message body parsing? At the very least, caching the results means that miscelaneous refreshes to the message list don't incur significant string processing cost.
Test Plan: No new tests here
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1898
Summary:
Things still to come:
- General tab
- Signatures tab (potentially remove and land)
Adding emacs things to gitignore
Adding progress. iterating on html/css is incredibly painful
Added layout for accounts page.
Adding layout for appearance page
layout for shortcuts preferences page
adding layount for notifications menu
Adding signatures layout
WIP
WIP - tab switching, accounts tab
WIP ALL THE THINGS
Keymap template support (Gmail / outlook, etc.)
Test Plan: No tests atm
Reviewers: evan
Differential Revision: https://phab.nylas.com/D1890
Summary: Desired functionality works, and passing test cases added. Ready for code review for real now! @evan @bengotow
Test Plan: Added extra tests to cover recipient-only cases.
Reviewers: evan, bengotow
Reviewed By: bengotow
Maniphest Tasks: T2239
Differential Revision: https://phab.nylas.com/D1889
Summary: Although this code works as desired, I think the code itself could use some work. Also, I didn't know how I should test this. Any ideas? @bengotow
Test Plan: I'm all ears
Reviewers: bengotow
Reviewed By: bengotow
Subscribers: bengotow
Maniphest Tasks: T2430
Differential Revision: https://phab.nylas.com/D1877
Summary:
Consolidate the smarts from ChangeFolderTask into a generic ChangeMailTask
ChangeMailTask:
- only makes requests for threads / messages that actually changed
- handles incrementing / decrementing locks
- writes changes to the database in a single pass, and only writes modified models
- encapsulates the undo state that was built into ChangeFolderTask
This change means that ChangeLabelsTask enjoys the same "smarts" as ChangeFolderTask. Label changes resulting in no-ops do not create web requests, you can undo label changes and they go back to the correct previous state.
Replace "UpdateThreadsTask" and "UpdateNylasObjectsTask" with subclasses based on the same code used for folder/labels
This means that the naming and parameter sets are consistent for all thread/message changing tasks. It also means that starring/marking as use the same (tested) business logic and starring 999 already-starred threads doesn't create 999 requests.
Go away DraftCountStore - nobody wants you in secondary windows
Add "Debug query plans" option which prints out the steps the database is taking. Look for "SCAN" to now you're having a bad time.
Make "version" field queryable, when we receive deltas/API response, find all versions of existing models in a single query without loading or parsing the objects
Contact: Add index for lookup by email
Label: add index for lookup by name
Message: Add index for message body join table
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1840
Summary: A notification now appears at the bottom of the window when the user performs an action that can be undone
Test Plan: Tested manually
Reviewers: bengotow
Reviewed By: bengotow
Subscribers: mg
Differential Revision: https://phab.nylas.com/D1820
Fixes https://phab.nylas.com/T2347. Note that it could still appear indented a bit if a thread has a particularly long timestamp, but should account for all cases.
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:
Drag threads to the folders / labels in the sidebar
WIP
Drag and drop is styled!
Test Plan: Tests WIP
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1785
Summary:
This is the initial diff for the label picker UI. This is all of the
functionality and none of the CSS.
Test Plan: todo
Reviewers: bengotow
Reviewed By: bengotow
Subscribers: sdw
Differential Revision: https://phab.nylas.com/D1761
- Message reply dropdown uses new images. Fixes T2355
- New hover actions which are darker. Fixes T2358
- New reply icon in the message footer. Fixes T2359
- Toolbar buttons are the correct height. Fixes T2360
- Thread list selection state changes mail label style
- Removed dead assets
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:
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:
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
- Delete should archive selection in split pane mode
- Thread list "quick actions" should be inverted when row is dark blue
- New star "action hover" state
- Multiselect list state is based on WorkspaceStore.layoutMode so add it to state
Summary:
fix(attachment): Bad filenames breaking icons
fix developer bar colors
fix critical bug with files
Render small attachments inline-block, without hover effect, and with nice dotted transparency background
Test Plan: No new tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1661
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