Commit graph

676 commits

Author SHA1 Message Date
Ben Gotow e17c7812a8 fix(drafts): Fix rapid draft creation and deletion issues 2015-08-05 17:40:33 -07:00
Ben Gotow 5e39454ad9 fix(labels/folders): Temporarily disable changing nested messages
- It's slow, and causes performLocal to take much longer
- It's making changes we receive from the streaming API a few moments later
- We don't actually display nested folder data anywhere important
2015-08-05 17:39:48 -07:00
Ben Gotow be4af0671b feat(composer): Show blue focus ring around the composer 2015-08-05 17:38:44 -07:00
Ben Gotow 1e6e857f28 perf(*): Add indexes, optimize "shouldAcceptModel", optimize Tasks
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
2015-08-05 15:53:08 -07:00
Evan Morikawa 4e4e510833 fix(spec): Fix memory leak in NamespaceStoreSpec 2015-08-05 09:44:34 -07:00
Evan Morikawa aeced745f3 fix(spec): Make specs work with new animated pending message 2015-08-05 09:34:56 -07:00
Evan Morikawa a125e79799 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
Evan Morikawa 1d617f7f62 fix(folder): require Task object 2015-08-04 14:41:27 -07:00
Ben Gotow 1ba02de407 fix(reply-all): Fix edge case where same person in CC/To causes error when replying-all 2015-08-04 13:57:12 -07:00
Ben Gotow 7cc04a6eed fix(iframe): allowDefault for events within message iFrames, just not link clicks 2015-08-04 13:37:05 -07:00
Ben Gotow 7a5d90cc56 bump(version): 0.2.3
- Threads sort the same way they do in Gmail, by "last message received"
- We now use native SQLite bindings, and SQLite 3.8.11.1, which is 22% faster
- We now display an affordance for undoing changes to threads
- Scroll handling in the message list is much better
- Contact chips have been overhauled in the composer, and are now editable
- Contact autocompletions are better, and based on frequency of use
- Messages wrap better in many scenarios
- More than 20 bug fixes!

We now have more than 1,000 specs for Nylas Mail.
2015-08-03 19:46:38 -07:00
Evan Morikawa dae2cec8fb fix(folder): specs and fixes to ChangeFolderTask
Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1834
2015-08-03 19:09:41 -07:00
Ben Gotow 7f84917675 fix(lint): Address linter errors 2015-08-03 19:09:08 -07:00
Ben Gotow dd7140ee1f fix(threads): Use last_message_timestamp fallback until migration has completed 2015-08-03 18:52:07 -07:00
Ben Gotow 0b9b72dce5 fix(draft-scroll): Ignore composer scroll requests while moving to new draft 2015-08-03 18:39:11 -07:00
Ben Gotow 0f76577a15 fix(message-scroll): Remove double overflow:auto to prevent scroll weirdness
Fixes T2357
2015-08-03 18:37:06 -07:00
Evan Morikawa c001cb0be8 fix(spec): fix rename issue 2015-08-03 17:41:18 -07:00
Ben Gotow 6e11f3d5b4 fix(query): Properly escape single quotes in SQLite 2015-08-03 17:36:49 -07:00
Evan Morikawa 763e42d974 fix(message-list): fix type and change variable name 2015-08-03 17:28:56 -07:00
Evan Morikawa ada9f722f5 feat(message-list): better sending state
Summary:
We now have a `MessageItemContainer` class that handles the logic of
deciding what kind of message to show. We introduce a new `PendingMessage`
(which is just a sublcass of `MessageItem`) that has the spinner and
stuff.

Also tests

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1833
2015-08-03 17:19:07 -07:00
Ben Gotow 9b2f830348 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 8884435da0 fix(undo-redo): Minor tweaks to undo/redo based on testing - see description
Summary:
Give UpdateThreadsTask a description method for strings like "Marked as read"

Give ChangeLabelsTask a better description method that returns shorter strings and is specific when possible

Give ChangeFolderTask a more specific description and don't assume folderOrId will always be a folder

Make it so that passive "mark as read" from the message store isn't undoable

Give the base class a description method that names the object

Change UndoRedo component CSS a bit:

- Use "inline-flexbox" with a max-width so that we can define shrinking rules on the label and Undo button (label gets ellipsis, button does not shrink at all)

- Avoid left:39%, since it assumed that the undo-redo element would be 22% of the width of the thread list, which wasn't always true. Instead, make the `undo-redo-manager` container "text-align:center", so the `undo-redo` div is always centered within it.

- Add `cursor:default` so that the user sees the pointer, not the text insertion cursor when hovering over "Undo"

- Add overflow / text-overflow so that if the message is ever too long, the user sees `...` ellipsis properly.

Test Plan: Run a few new tests

Reviewers: evan, ethanb

Reviewed By: ethanb

Differential Revision: https://phab.nylas.com/D1830
2015-08-03 14:46:19 -07:00
Ben Gotow c95ad97a4c fix(assertions): Add earlier checks for bad queries, invalid local links 2015-08-03 14:45:47 -07:00
Ben Gotow 00bab73fbe fix(thread-list): Add more shouldComponentUpdate to prevent threadlist re-rendering as you move keyboard cursor 2015-08-03 14:09:29 -07:00
Ben Gotow 1dc7c03ebd fix(contact-chips): Contact chips are editable and have much better style
Summary:
The TokenizingTextField has several new optional props, including onEdit, which enables
editing of the tokens and tokenIsInvalid, which allows you to make tokens red, while still
accepting them as tokens.

When you go to send a message with invalid recipients it won't let you until you remove/
edit them.

Hotloading

Edit chips, keymappings not through command registry, 7 new tests for editing chips

Test Plan: Run 7 new tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1825
2015-08-03 13:06:28 -07:00
Ben Gotow 6b18b9715c fix(first-responder): Apply changes from Atom to window-event-handler
Applies a4d716c491 to our code.

Fixes https://sentry.nylas.com/sentry/edgehill/group/1716/
2015-08-03 11:56:12 -07:00
Ben Gotow 0ca900c9bd fix(multiselect-list): Occasionally, no dataView or handler is defined for MultiselectList
Fixes https://sentry.nylas.com/sentry/edgehill/group/1710/
2015-08-03 11:38:57 -07:00
Ben Gotow 5280040e5c fix(change-category): Redefine objectIds when objects cannot be found
Fixes https://sentry.nylas.com/sentry/edgehill/group/1717/
2015-08-03 11:38:57 -07:00
Ben Gotow b2602222bc fix(invariant): Remove event listener with "capture: true"
Fixes https://sentry.nylas.com/sentry/edgehill/group/1831/
2015-08-03 11:38:57 -07:00
Evan Morikawa 9d17b90b93 fix(tooltip): doesn't show on archive either 2015-08-03 10:57:56 -07:00
Evan Morikawa 2370c7cdc1 fix(scroll): don't scroll to region if node doesn't exist 2015-08-03 10:56:43 -07:00
Ben Gotow 99da4a112a fix(undo-redo): Clear timeout when component unmounts to avoid React errors 2015-08-03 10:21:04 -07:00
Evan Morikawa b3f7e40588 test(folders): adding specs for changing folders and labels
Summary:
ChangeLabelsTask specs

adding change folders task

Adding tests for ChangeFolderTask

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1806
2015-08-03 10:16:46 -07:00
Ben Gotow 83197fabd7 fix(streaming): Tell the API we want folder/label deltas 2015-07-31 18:54:40 -07:00
EthanBlackburn 11b20f326d Removed old code from thread-list 2015-07-31 14:02:13 -07:00
EthanBlackburn 76b83f5faf Merge branch 'master' of github.com:nylas/edgehill into receivedrecentdate-sent-folder-fix 2015-07-31 13:59:05 -07:00
EthanBlackburn 5a187e1e9f Removed print statements 2015-07-31 13:58:40 -07:00
EthanBlackburn 17bcb88ae3 UndoRedoButton now shows
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
2015-07-31 13:12:47 -07:00
EthanBlackburn 631098f4f0 Merge branch 'master' of github.com:nylas/edgehill into receivedrecentdate-sent-folder-fix 2015-07-31 12:38:53 -07:00
Ben Gotow 73ae6ea6f3 fix(T2387): Use better file icons from SDW
Summary:
fix misc spec failure by making event store fetch immediately on setup

add specs for displayExtension, displayName

Test Plan: Run new tests

Reviewers: evan

Maniphest Tasks: T2387

Differential Revision: https://phab.nylas.com/D1821
2015-07-31 12:34:24 -07:00
Ben Gotow bf89ea8c64 fix(build): Linux needs to build sqlite after pulling electron 2015-07-31 12:14:14 -07:00
Ben Gotow 31512e8d9a fix(specs): Resolve merge issues in specs 2015-07-31 12:06:34 -07:00
EthanBlackburn c9ef090fa0 Fixed bug where items in sent folder have "invalid date" 2015-07-31 08:23:03 -07:00
Ben Gotow d551fd37f2 feat(contact-ranking): Use /contacts/rankings in the Contact Store
Summary:
- New JSONCache class hides logic around saving/loading rankings from a file
- Contacts are sorted whenever they're loaded so the runtime of searchContacts is still O(limit * n)

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1793
2015-07-30 18:31:25 -07:00
Ben Gotow 43f9b0b8c3 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
Ben Gotow cab654ec48 fix(sqlite): Connect to sqlite directly rather than sending queries over IPC (twice...)
Summary:
- We now build sqlite3 manually from source in script/bootstrap
- We now allow queries to run in parallel outside of transaction blocks

- When signining in and out, the main window creates the database file and then advances the database "phase", which allows all the windows to connect to the initialized database.

This diff also fixes T2411 where popout drafts opened twice, and several issues around Windows icons and install.

Test Plan: Run existing tests

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T2411

Differential Revision: https://phab.nylas.com/D1815
2015-07-30 18:09:20 -07:00
Ben Gotow fa2519923f fix(T2337): Break words to ensure messages wrap, fall back to horizontal scrolling of messages
Fixes T2337
2015-07-30 17:49:06 -07:00
Ben Gotow 2c3d4d5307 fix(T2338): You can now use keyboard shortcuts on focused BrowserWindows
Fixes T2338, and also removes a bit of dead code
2015-07-30 17:32:21 -07:00
Ben Gotow 266e50607e fix(T2347): Alignment of attachment icon is now consistent row-to-row
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.
2015-07-30 16:43:44 -07:00
Ben Gotow 9d8174460f fix(T2408): On the Mac, show open / save dialogs as sheets
Fixes T2408
2015-07-30 16:34:25 -07:00