Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
jstejada committed Oct 24, 2016
2 parents 81bf8b6 + a95c17b commit 95301d1
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 20 deletions.
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,59 @@
# N1 Changelog

### 0.4.59 (10/24/16)

- Features:

+ Spellchecker: Spellchecker now intelligently detects different languages
across Windows, Mac and Linux.
+ You can now select N1 as the default mail client on Windows.
+ You can now open threads in a new window.
+ You can now pick which of your calendars you want displayed in the calendar
view when proposing times to meet.
+ Automatically add N1 to the dock on install (Mac only).

- Fixes:

+ N1 no longer becomes locked when offline.
+ Thread sharing popover is now correctly closed when blurred or when a new
thread is selected.
+ Tutorial tips are now correctly positioned when the theme is changed and
correctly hidden when the element they are attached to is not visible.
+ Spellchecker no longer spellchecks `<code>`, `<a>`, `<pre>` tags.
+ Inline Images: When download mode is “manual”, add an option to manually
download inline images.
+ Mail Merge now correctly sends inline images
+ Mail Rules: Allow recipient filters to contain names (#2942)
+ Correctly detect dev mode. This will prevent errors from popping out in the
developer console unless you are actually running in dev mode.
+ When copying participants, include space (#2871).
+ Notifications will no longer error when the thread is not found.
+ Phishing now correctly handles scenarios where input is malformed.
+ QuickReplies now correctly handles errors when scanning templates directory.
+ Enabled click regions on margins of composer.
+ In composer, can now Shift-Tab back to the subject correctly.
+ Allow mailto links to have bodies with \n or \r characters.
+ Prevent tutorial tips from breaking send later button.
+ Add preview as recipient toggle back to composer.
+ No longer display outdated welcome message in the onboarding window.

- Design:

+ All notification bars previously displayed at the top of the main window are
now displayed in the lower left side of the window with an improved design.

- Development:

+ We switched our SQLite bindings from `node-sqlite3` to `better-sqlite3`
which improves query performance by ~28%, and fixes an error which
caused the database to become locked.
+ Dev mode: No longer store devMode flag in `config.json` to prevent the
production build from incorrectly running in dev mode.
Rather, run N1 with `--dev` flag.
+ All database-related code (ORM) has been transitioned to ES6.
+ Improve spec bootup process.


### 0.4.56 (9/29/16)

- Features:
Expand Down
3 changes: 0 additions & 3 deletions internal_packages/thread-search/keymaps/search-bar.json

This file was deleted.

18 changes: 10 additions & 8 deletions internal_packages/thread-search/lib/search-bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class SearchBar extends React.Component {

componentDidMount() {
this._mounted = true;
this._unsubscribes = [
this._unsubscribers = [
SearchStore.listen(this._onChange),
WorkspaceStore.listen(() => {
if (this.state.focused) {
Expand All @@ -30,20 +30,22 @@ export default class SearchBar extends React.Component {
];
}

// It's important that every React class explicitly stops listening to
// N1 events before it unmounts. Thank you event-kit
// This can be fixed via a Reflux mixin
componentWillUnmount() {
this._mounted = false;
for (const usub of this._unsubscribes) {
usub();
}
this._unsubscribers.forEach((usub) => usub())
}

_onFocusSearch = () => {
ReactDOM.findDOMNode(this.refs.searchInput).focus();
}

_onInputKeyDown = (event) => {
const {key, target: {value}} = event;
if (value.length > 0 && key === 'Escape') {
this._onClearAndBlur();
}
}

_onValueChange = (event) => {
SearchActions.queryChanged(event.target.value);
if (event.target.value === '') {
Expand Down Expand Up @@ -136,6 +138,7 @@ export default class SearchBar extends React.Component {
className={inputClass}
placeholder="Search all email"
value={query}
onKeyDown={this._onInputKeyDown}
onChange={this._onValueChange}
onFocus={this._onFocus}
onBlur={this._onBlur}
Expand Down Expand Up @@ -168,7 +171,6 @@ export default class SearchBar extends React.Component {
className="search-bar"
globalHandlers={{
'core:focus-search': this._onFocusSearch,
'search-bar:escape-search': this._onClearAndBlur,
}}
>
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ class SearchQuerySubscription extends MutableQuerySubscription {
if (this._accountIds.length === 1) {
dbQuery = dbQuery.where({accountId: this._accountIds[0]})
}
dbQuery = dbQuery.search(this._searchQuery).limit(30)
dbQuery = dbQuery
.search(this._searchQuery)
.order(Thread.attributes.lastMessageReceivedTimestamp.descending())
.limit(30)

dbQuery.then((results) => {
if (results.length > 0) {
this.replaceQuery(dbQuery)
Expand Down
16 changes: 8 additions & 8 deletions internal_packages/thread-search/lib/search-store.es6
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,17 @@ class SearchStore extends NylasStore {
if (this._fetchingThreadResultsVersion) { return; }
this._fetchingThreadResultsVersion = this._searchSuggestionsVersion;

const databaseQuery = DatabaseStore.findAll(Thread)
.where(Thread.attributes.subject.like(this._searchQuery))
.order(Thread.attributes.lastMessageReceivedTimestamp.descending())
.limit(4);

const {accountIds} = FocusedPerspectiveStore.current();
if (accountIds instanceof Array) {
databaseQuery.where(Thread.attributes.accountId.in(accountIds));
let dbQuery = DatabaseStore.findAll(Thread)
if (Array.isArray(accountIds) && accountIds.length === 1) {
dbQuery = dbQuery.where({accountId: accountIds[0]})
}
dbQuery = dbQuery
.search(this._searchQuery)
.order(Thread.attributes.lastMessageReceivedTimestamp.descending())
.limit(4);

databaseQuery.then(results => {
dbQuery.then(results => {
// We've fetched the latest thread results - display them!
if (this._searchSuggestionsVersion === this._fetchingThreadResultsVersion) {
this._fetchingThreadResultsVersion = null;
Expand Down

0 comments on commit 95301d1

Please sign in to comment.