Commit graph

738 commits

Author SHA1 Message Date
Ben Gotow 3fdfbefcb3 fix(sidebar): Swap out + image, tweak CSS for unread 2015-11-23 20:08:10 -08:00
Juan Tejada a9aaab9f38 feat(sidebar): Add sidebar controls to add and remove categories
Summary:
- Refactors account-sidebar internal package:
  - Separates into smaller react components
  - Makes DisclosureTriangle its own independent component
  - Adds data to AccountSidebarStore to allow removal or addition of items for a
    specific section of the sidebar
- Adds button and input and css styles to create categories
- Adds context menu to destroy a category
- Adds new method to CategoryStore to get the icon name for the categories of
  the current account
- Removes some unused code

Test Plan: Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2283
2015-11-23 19:43:56 -08:00
Ben Gotow 522ad2da79 fix(theme): Improve styling of popout composer in dark mode 2015-11-23 18:28:30 -08:00
Ben Gotow 6b6a61f455 fix(copy): Call split / list modes "Single Panel / Two Panel"
Fixes T5907
2015-11-23 17:34:56 -08:00
Ben Gotow b2f8b34a32 feat(counts): Unread counts for all folders and labels across all accounts
Summary:
This diff replaces the UnreadCountStore with a better approach that is able to track unread counts for all folders/labels without continuous (and cripplingly slow) SELECT COUNT(*) queries.

When models are written to the database, we currently don't send out notifications with the "previous" state of those objects in the database. This makes it hard to determine how to update counters. (In the future, we may need to do this for live queries). Unfortunately, getting the "previous" state is going to be very hard, because multiple windows write to the database and the "previous" state we have might be outdated. We'd almost have to run a "SELECT" right before every "REPLACE INTO".

I created an API that allows you to register observers around persistModel and unpersistModel. With this API, you can run queries before and after the database changes are made and pluck just the "before" state you're interested in.

The `ThreadCountsStore` uses this API to determine the impact of persisting a set of threads on the unread counts of different labels. Before the threads are saved, it says "how much do these thread IDs contribute to unread counts currently?". After the write is complete it looks at the models and computes the difference between the old count impact and the new count impact, and updates the counters.

I decided not to attach the unread count to the Label objects themselves because 1) they update frequently and 2) most things observing the DatabaseStore for categories do not care about counts, so they would be updating unnecessarily.

The AccountSidebar now listens to the ThreadCountsStore as well as the CategoryStore, and there's a new preference in the General tab for turning off the counts.

Test Plan: Tests are a work in progress, want to get feedback first!

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2232
2015-11-23 17:12:22 -08:00
Ben Gotow 599d8f834f fix(prefs): Move to a sheet rather than a window, use configSchema
Summary:
This diff moves the preferences interface to a sheet in the main window, with the following benefits:
- We can put any sort of React control in it (no ReactRemote)
- It's not strange for the interface to scroll
- Since it can scroll, it's safe to auto-generate preferences for plugins based on their package config schema.

The general tab is now mostly based on the config schema, with the exception of the "Workspace" and "Layout" bits.

The other tabs are still manual, and should be polished more.

Test Plan: No new tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2278
2015-11-23 12:20:51 -08:00
Juan Tejada ea97d94226 fix(tray): Prevent duplicate trays on preference changes 2015-11-23 09:53:05 -08:00
Juan Tejada b3a9f31051 fix(tray): Prevent system tray from being initialized more than once
- Makes sure the tray is deactivated before activating
2015-11-23 09:31:10 -08:00
Ben Gotow a1b3ad8767 feat(dark-mode): Double invert filter for nice dark HTML bodies 2015-11-20 18:53:34 -08:00
Juan Tejada 39a52f4535 feat(sidebar): Add behavior to persist collapsed state of sidebar items
Summary:  - Updates account sidebar to persist collapsed state to the the config

Test Plan:  - manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2276
2015-11-19 15:48:44 -08:00
Juan Tejada 5be36f8572 fix(specs): Update composer-view-spec to use renamed functions 2015-11-18 15:51:48 -08:00
Juan Tejada c2ce51ae0c fix(composer): Fix several composer issues and refactor Contenteditable
Summary:
  - Fixes T5819 issues
  - Adds ContenteditbalePlugin mechanism to allow extension of Contenteditable
    functionality, and completely removes lifecycleCallbacks from Contenteditable
  - Refactors list functionality outside of Contenteditable and into a plugin
  - Updates ComposerView to apply DraftStoreExtensions through a ContentEditablePlugin
  - Moves spell checking logic outside of Contenteditable into the spellcheck package

Fixes T5824 (atom.assert)
Fixes T5951 (shift-tabbing) bullets

Test Plan: - Unit tests and manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Maniphest Tasks: T5951, T5824, T5819

Differential Revision: https://phab.nylas.com/D2261
2015-11-18 15:22:31 -08:00
Ben Gotow b3845e675e fix(search): Execute search for subject, autoselect first item
Fixes T5899, but we may want to iterate on it more later.
2015-11-18 12:35:19 -08:00
Evan Morikawa 43c4859592 fix(draft): fix showing of incorrect body when pending send
Summary: Fixes T3712

Test Plan: new tests

Reviewers: juan, bengotow

Reviewed By: bengotow

Maniphest Tasks: T3712

Differential Revision: https://phab.nylas.com/D2273
2015-11-18 12:32:07 -08:00
Ben Gotow 285a60493e fix(specs): Ternary operator in jasmine-helper was valid coffee... 2015-11-17 17:48:32 -08:00
Ben Gotow a5013c0bbd fix(specs): Update specs following 0.29.2 > 0.34.3 move 2015-11-17 17:40:06 -08:00
Evan Morikawa 51602f69a5 refactor(env): new NylasEnv global
Converted all references of global atom to NylasEnv

Temporary rename atom.io

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.io/temporaryAtomIoReplacement/g'

atom.config to NylasEnv.config

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.config/NylasEnv.config/g'

atom.packages -> NylasEnv.packages

atom.commands -> NylasEnv.commands atom.getLoadSettings

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.commands/NylasEnv.commands/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getLoadSettings/NylasEnv.getLoadSettings/g'

More common atom methods

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.styles/NylasEnv.styles/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.emitError/NylasEnv.emitError/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.inSpecMode/NylasEnv.inSpecMode/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.inDevMode/NylasEnv.inDevMode/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getWindowType/NylasEnv.getWindowType/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.displayWindow/NylasEnv.displayWindow/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.quit/NylasEnv.quit/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.close/NylasEnv.close/g'

More atom method changes

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.keymaps/NylasEnv.keymaps/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.hide/NylasEnv.hide/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getCurrentWindow/NylasEnv.getCurrentWindow/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.menu/NylasEnv.menu/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getConfigDirPath/NylasEnv.getConfigDirPath/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.isMainWindow/NylasEnv.isMainWindow/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.finishUnload/NylasEnv.finishUnload/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.isWorkWindow/NylasEnv.isWorkWindow/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.showSaveDialog/NylasEnv.showSaveDialog/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.append/NylasEnv.append/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.confirm/NylasEnv.confirm/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.clipboard/NylasEnv.clipboard/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getVersion/NylasEnv.getVersion/g'

More atom renaming

Rename atom methods

More atom methods

Fix grunt config variable

Change atom.cmd to N1.cmd

Rename atom.coffee and atom.js to nylas-env.coffee nylas-env.js

Fix atom global reference in specs manually

Fix atom requires

Change engine from atom to nylas

got rid of global/nylas-env

rename to nylas-win-bootup

Fix onWindowPropsChanged to onWindowPropsReceived

fix nylas-workspace

atom-text-editor to nylas-theme-wrap

atom-text-editor -> nylas-theme-wrap

Replacing atom keyword

AtomWindow -> NylasWindow

Replace Atom -> N1

Rename atom items

nylas.asar -> atom.asar

Remove more atom references

Remove 6to5 references

Remove license exception for atom
2015-11-17 16:41:20 -08:00
Evan Morikawa 46ee3d8cc8 fix(docs): fix docs so they compile properly. 2015-11-17 15:48:59 -08:00
Ben Gotow 3a16484d7d fix(tray): Retina tray icon with template image for dark menu bar mode 2015-11-17 15:36:52 -08:00
Ben Gotow 74252d58d9 bump(️): Electron 0.29.2 > 0.34.3, Sqlite 3.0.11 > 3.1.1 2015-11-17 15:36:32 -08:00
Ben Gotow c34747c03c fix(tray): Slightly resize win/linux tray icons 2015-11-14 13:10:39 -08:00
Juan Tejada 6786e0ae04 fix(lint): Remove lint errors 2015-11-13 19:41:53 -08:00
Ben Gotow 27ae261d1b fix(tray): "Open Inbox" if main window is minimized / hidden 2015-11-13 18:11:44 -08:00
Ben Gotow 53bca8e2f5 fix(category-picker): vertical alignment of labels/folders icon 2015-11-13 17:42:10 -08:00
Ben Gotow 697b3855bf fix(dropdowns): 3% darken on hover, not full blue 2015-11-13 16:58:55 -08:00
Ben Gotow 5b24e22cbd fix(search): Prevent search from hitting X button 2015-11-13 16:10:49 -08:00
Ben Gotow fb6ea89491 fix(sidebar): Don't capitalize every word in label names. #401
Fixes #401
2015-11-13 09:45:19 -08:00
Juan Tejada 4a4c60bafc fix(system-tray): prevent duplicate menu item on darwin 2015-11-11 13:44:37 -08:00
Ben Gotow d28e84d95a undo(prefs): atom.keymaps does not implement unsubscribe 2015-11-11 10:20:48 -08:00
Ben Gotow 683ef61c1f fix(prefs): atom.keymaps does not implement unsubscribe
https://github.com/atom/atom-keymap/issues/101
2015-11-09 21:44:59 -08:00
Ben Gotow 0ab065aab3 fix(specs): Remove loading cover in spec window 2015-11-09 20:53:17 -08:00
Ben Gotow 7d7ba4fbba fix(ui-dark): Small color adjustments, resolves #299, #148 2015-11-09 18:52:24 -08:00
Ben Gotow 04be333f3f fix(account-switcher): Dark content mode, closes #382 2015-11-09 18:15:27 -08:00
Ben Gotow bbea8beee5 fix(feedback): Move feedback window creation to app process
Prevents cross-window callbacks that are preventing the app from quitting
2015-11-09 12:15:24 -08:00
Ben Gotow a4df144dbf fix(autoload-images): Check to see if whitelist exists 2015-11-09 12:15:24 -08:00
Evan Morikawa 119da453e1 feat(selection): add selection of read, unread, starred, etc
Summary:
Can select all, deselect-all, read, unread, starred, unstarred.

Yes, it's not REALLY select "all", but it uses the items in the current
`retainedRange`. This is actually similar to what gmail does (only selects
on the first page of a 100).

Test Plan: new test

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2241
2015-11-09 10:03:55 -05:00
Juan Tejada fe8767fc0b fix(keymaps): create user keymaps file in .nylas/ if non existent 2015-11-06 19:01:31 -08:00
Ben Gotow f152cca4d6 feat(reading): Disable autoloading of images, opt-in one by one
Summary: This diff implements Gmails "load images, always load images from bengotow@gmail.com" option. Someone asked for it late last night and I figured it'd be fun to add. We also needed to refactor the MessageItem to allow for a GPG plugin - MessageItems now subscribe to the body of the message from the messageBodyProcessor, so in the event that processing rules change, someone can invalidate the processor cache by calling `resetCache()`, and then it recomputes bodies and triggers a refresh of each message body.

Test Plan: Updated existing tests, no new tests for this plugin just yet.

Reviewers: evan, juan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2235
2015-11-06 15:53:21 -08:00
Evan Morikawa 55d3e92f50 feat(keymap): add cmd+1, cmd+2, etc to quick-select accounts
Fix "unique key" for react props

Fix composer styling bug in popout composer
2015-11-06 14:38:50 -08:00
Juan Tejada 66252fc7bc fix(system-tray): properly deactivates package 2015-11-06 13:52:08 -08:00
Evan Morikawa 6588da7f33 fix(signatures): temporarily disable signatures in preferences 2015-11-06 12:40:34 -08:00
Evan Morikawa 0fae7ce13c fix(specs): fix specs 2015-11-06 12:08:32 -08:00
Evan Morikawa 37e3fe0f45 feat(keymap): add new <KeymapHandlers />
Summary:
Refactor keymaps to wrap components with a <KeymapHandlers /> component.
This more Reactful way of declaring keyback handlers prevents us from
needing to subscribe to `atom.commands`

Test Plan: new tests

Reviewers: bengotow, juan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2226
2015-11-06 11:47:06 -08:00
Juan Tejada a6c44b8529 feat(system-tray): add system-tray package
Summary:
- Updates support for ES6 code inside packages
- Displays system tray icon with unread count on darwin, or with bubble on other platforms
- Uses canvas api to dynamically generate icon image given unread count:
  - Adds CavasUtils.canvasFromImgAndText to do this
- Adds config option to display system tray icon on darwin

Test Plan: Need to write the tests for this.

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2231
2015-11-06 11:12:38 -08:00
Ben Gotow dc538930a7 fix(search): Allow typing in the middle of the search text 2015-11-04 17:11:40 -08:00
Ben Gotow c1bf8ae026 fix(deltas): Use the official API to create cursors 2015-10-30 22:20:41 -07:00
Evan Morikawa eea25a307d fix(composer): support Chinese & others - handle composition events
Summary:
ignores composition event commands until they're done. We then simply
update the new state after that happens.

Some additional refactoring:

- The <Contenteditable /> prop is 'value' instead of 'html' to make it
  look more like a standard React controlled input
- Removed `filters` prop and `footerElements` prop from Contenteditable.
  These could easily be moved into the composer (where they belong).
- Moved contenteditable and a few of its helper classes into their own
  folder.
- Moved `UndoManager` up out of the `flux` folder into `src`. Currently
  undo/redo is only in the composer when all contenteditables should have
  the basic funcionality. Will refactor this later.
- Fix tests

Test Plan: manual

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2211
2015-10-30 20:03:33 -04:00
Ben Gotow 6bee127134 feat(shortcuts): Pageup/dn in message list, shift+pageup/dn in thread list 2015-10-29 20:34:43 -07:00
Ben Gotow 538af665cf fix(sp): It's => its 2015-10-29 19:35:31 -07:00
Evan Morikawa cc61aa7811 feat(signatures): add signature support in preferences
Summary:
Adding signature support in preferences

Extracting out DraftStore extensions from the Contenteditable component

Moved Contenteditable to the nylas component kit

Build react remote window selection synchronization.

Test Plan: todo

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2204
2015-10-29 17:20:41 -04:00