fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
// The ui-variables file is provided by base themes provided by Atom.
|
|
|
|
//
|
|
|
|
// See https://github.com/atom/atom-dark-ui/blob/master/stylesheets/ui-variables.less
|
|
|
|
// for a full listing of what's available.
|
|
|
|
@import "ui-variables";
|
|
|
|
@import "ui-mixins";
|
|
|
|
@import "buttons";
|
|
|
|
|
2015-03-06 05:31:11 +08:00
|
|
|
@compose-width: 800px;
|
2015-03-19 09:21:04 +08:00
|
|
|
@compose-min-height: 150px;
|
2015-03-06 05:31:11 +08:00
|
|
|
|
|
|
|
.composer-inner-wrap {
|
|
|
|
position: relative;
|
fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
height: 100%;
|
2015-03-07 08:08:34 +08:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2015-03-05 07:52:40 +08:00
|
|
|
|
2015-03-13 05:48:56 +08:00
|
|
|
.composer-cover {
|
|
|
|
position: absolute;
|
|
|
|
top: -1 * @spacing-double; right: 0; bottom: 0; left: 0;
|
|
|
|
z-index: 1000;
|
|
|
|
background: rgba(255,255,255,0.7);
|
|
|
|
}
|
|
|
|
|
2015-03-06 05:31:11 +08:00
|
|
|
.composer-action-bar-wrap {
|
2015-03-13 05:48:56 +08:00
|
|
|
position: relative;
|
|
|
|
z-index: 1;
|
fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
width: 100%;
|
2015-03-06 05:31:11 +08:00
|
|
|
background: transparent;
|
|
|
|
border-bottom: 0;
|
2015-03-03 07:33:58 +08:00
|
|
|
|
2015-03-06 05:31:11 +08:00
|
|
|
.composer-action-bar-content {
|
2015-04-22 09:16:08 +08:00
|
|
|
display:flex;
|
2015-06-06 02:02:44 +08:00
|
|
|
margin: 0 auto;
|
2015-04-22 09:16:08 +08:00
|
|
|
flex-direction:row;
|
2015-06-06 02:02:44 +08:00
|
|
|
max-width: @compose-width;
|
2015-06-06 09:33:17 +08:00
|
|
|
padding: @spacing-standard (@spacing-standard + @spacing-standard / 2) @spacing-standard*1.1;
|
2015-03-04 10:09:57 +08:00
|
|
|
|
2015-04-22 09:16:08 +08:00
|
|
|
> * {
|
|
|
|
margin-left: @spacing-standard / 2;
|
|
|
|
margin-right: @spacing-standard / 2;
|
|
|
|
}
|
|
|
|
}
|
2015-03-03 07:33:58 +08:00
|
|
|
}
|
|
|
|
|
2015-03-06 05:31:11 +08:00
|
|
|
.composer-content-wrap {
|
2015-03-03 07:33:58 +08:00
|
|
|
position: relative;
|
2015-03-13 05:48:56 +08:00
|
|
|
z-index: 1;
|
2015-03-03 07:33:58 +08:00
|
|
|
|
2015-03-05 07:52:40 +08:00
|
|
|
width: 100%;
|
2015-03-06 05:31:11 +08:00
|
|
|
max-width: @compose-width;
|
2015-03-05 07:52:40 +08:00
|
|
|
margin: 0 auto;
|
2015-03-06 05:31:11 +08:00
|
|
|
margin-top: @spacing-standard;
|
2015-03-06 05:53:18 +08:00
|
|
|
padding: 0 @spacing-standard;
|
2015-03-05 07:52:40 +08:00
|
|
|
|
2015-03-07 08:08:34 +08:00
|
|
|
flex: 1;
|
2015-03-06 05:31:11 +08:00
|
|
|
display: flex;
|
|
|
|
flex-flow: column;
|
2015-03-03 07:33:58 +08:00
|
|
|
}
|
|
|
|
|
2015-03-06 05:31:11 +08:00
|
|
|
.text-actions {
|
|
|
|
text-align: right;
|
|
|
|
line-height: 1.4;
|
2015-03-05 07:52:40 +08:00
|
|
|
position: relative;
|
2015-03-06 05:31:11 +08:00
|
|
|
top: -3px;
|
2015-03-05 10:47:48 +08:00
|
|
|
}
|
fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
|
2015-03-05 10:47:48 +08:00
|
|
|
.header-action {
|
|
|
|
color: @text-color-very-subtle;
|
2015-06-06 02:40:44 +08:00
|
|
|
img.content-mask { background-color: @text-color-very-subtle; }
|
2015-03-05 10:47:48 +08:00
|
|
|
font-size: @font-size-small;
|
2015-03-06 05:31:11 +08:00
|
|
|
padding-left: 1em;
|
|
|
|
&:hover {
|
|
|
|
color: @text-color-link;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
2015-03-05 10:47:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.composer-participant-actions {
|
|
|
|
position: absolute;
|
|
|
|
z-index: 900;
|
2015-03-06 05:53:18 +08:00
|
|
|
right: @spacing-double;
|
fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
.header-action {
|
2015-03-05 10:47:48 +08:00
|
|
|
position: relative;
|
|
|
|
top: 1em;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-06 05:31:11 +08:00
|
|
|
.tokenizing-field.to {
|
2015-04-21 06:59:43 +08:00
|
|
|
padding-right: 160px;
|
fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
}
|
|
|
|
|
2015-02-07 06:46:30 +08:00
|
|
|
input, textarea, div[contenteditable] {
|
2015-06-06 02:40:44 +08:00
|
|
|
color: @text-color;
|
2015-03-03 07:33:58 +08:00
|
|
|
position: relative;
|
|
|
|
z-index: 1;
|
fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
display: block;
|
|
|
|
background: inherit;
|
|
|
|
width: 100%;
|
|
|
|
resize: none;
|
|
|
|
border: none;
|
|
|
|
}
|
|
|
|
|
2015-03-06 05:31:11 +08:00
|
|
|
.compose-subject-wrap {
|
2015-03-05 06:26:53 +08:00
|
|
|
position: relative;
|
|
|
|
z-index: 2;
|
2015-03-05 07:52:40 +08:00
|
|
|
padding: 5px @spacing-standard 0 0;
|
2015-03-06 05:31:11 +08:00
|
|
|
margin: 0 @spacing-standard;
|
2015-03-05 07:52:40 +08:00
|
|
|
border-bottom: 1px solid @border-color-divider;
|
feat(*): draft icon, misc fixes, and WorkspaceStore / custom toolbar in secondary windows
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
2015-06-04 07:02:19 +08:00
|
|
|
flex-shrink:0;
|
2015-06-06 02:02:44 +08:00
|
|
|
|
2015-03-05 07:52:40 +08:00
|
|
|
.subject-label {
|
|
|
|
color: @text-color-very-subtle;
|
|
|
|
float: left;
|
2015-03-06 05:31:11 +08:00
|
|
|
padding-top: 6px;
|
2015-03-05 07:52:40 +08:00
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
input.compose-field {
|
|
|
|
display: inline-block;
|
|
|
|
width: calc(~"100% - 61px");
|
|
|
|
padding: 6px 0 2px 0;
|
|
|
|
margin: 0 0 5px 5px;
|
|
|
|
min-width: 5em;
|
|
|
|
background-color: transparent;
|
|
|
|
border: none;
|
|
|
|
}
|
2015-03-20 07:57:41 +08:00
|
|
|
input.compose-field.compose-subject {
|
|
|
|
&::-webkit-input-placeholder {
|
|
|
|
color: @text-color-very-subtle;
|
|
|
|
}
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
2015-03-05 07:52:40 +08:00
|
|
|
}
|
|
|
|
|
fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
.compose-body {
|
|
|
|
flex: 1;
|
2015-03-05 06:26:53 +08:00
|
|
|
z-index: 1;
|
fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
cursor: text;
|
|
|
|
overflow: auto;
|
2015-02-19 06:24:16 +08:00
|
|
|
position: relative;
|
|
|
|
|
2015-03-03 07:33:58 +08:00
|
|
|
.quoted-text-control {
|
|
|
|
position: absolute;
|
2015-06-12 02:52:49 +08:00
|
|
|
bottom: -25px;
|
2015-03-03 07:33:58 +08:00
|
|
|
left: 15px;
|
|
|
|
margin: 0;
|
2015-02-19 06:24:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
div[contenteditable] {
|
2015-03-06 05:31:11 +08:00
|
|
|
font-size: @font-size-large;
|
|
|
|
line-height: 1.4;
|
2015-03-14 07:32:09 +08:00
|
|
|
min-height: @compose-min-height;
|
2015-03-05 10:47:48 +08:00
|
|
|
padding: @spacing-standard;
|
|
|
|
padding-top: @spacing-standard;
|
|
|
|
padding-bottom: 0;
|
2015-06-12 02:52:49 +08:00
|
|
|
margin-bottom: 30px;
|
2015-03-03 07:33:58 +08:00
|
|
|
}
|
|
|
|
.contenteditable-container {
|
|
|
|
width: 100%;
|
2015-06-12 02:52:49 +08:00
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.composer-footer-region {
|
|
|
|
cursor: default;
|
|
|
|
&:hover {
|
|
|
|
cursor: default;
|
2015-02-19 06:24:16 +08:00
|
|
|
}
|
fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// TODO FIXME DRY From stylesheets/message-list.less
|
|
|
|
.attachments-area {
|
2015-05-22 05:50:40 +08:00
|
|
|
padding: 0 15px 0 15px;
|
fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
}
|
2015-03-18 07:19:40 +08:00
|
|
|
|
|
|
|
.token {
|
|
|
|
background: transparent;
|
|
|
|
&.selected,
|
|
|
|
&.dragging {
|
|
|
|
.participant-secondary {
|
|
|
|
color: @text-color-inverse-very-subtle;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// &:hover {
|
|
|
|
// background: transparent;
|
|
|
|
// }
|
|
|
|
// &.selected,
|
|
|
|
// &.dragging {
|
|
|
|
// background: transparent;
|
|
|
|
// color: @text-color;
|
|
|
|
//
|
|
|
|
// .action { color: @text-color-subtle; }
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
|
|
|
|
// .btn.btn-send {
|
|
|
|
// font-weight: @font-weight-semi-bold;
|
|
|
|
// color: @accent-primary-dark;
|
|
|
|
// border-top: 1px solid fade(@accent-primary, 39%);
|
|
|
|
// border-right: 1px solid fade(@accent-primary, 39%);
|
|
|
|
// border-left: 1px solid fade(@accent-primary, 39%);
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
body.is-blurred .composer-inner-wrap .tokenizing-field .token {
|
|
|
|
background: transparent;
|
fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
}
|
|
|
|
|
2015-03-06 05:31:11 +08:00
|
|
|
// Overrides for the full-window popout composer
|
|
|
|
.composer-full-window {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
.composer-outer-wrap {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.composer-inner-wrap {
|
|
|
|
|
|
|
|
.composer-action-bar-wrap {
|
|
|
|
background: @background-secondary;
|
2015-06-09 08:27:09 +08:00
|
|
|
border-top:1px solid @border-color-divider;
|
2015-03-06 05:31:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.compose-body {
|
|
|
|
margin-bottom: 0;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
.contenteditable-container {
|
|
|
|
display: flex;
|
|
|
|
flex: 1;
|
|
|
|
width: 100%;
|
2015-06-12 02:52:49 +08:00
|
|
|
position: relative;
|
2015-03-06 05:31:11 +08:00
|
|
|
|
|
|
|
div[contenteditable] {
|
|
|
|
height: auto;
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Overrides for the composer in a message-list
|
|
|
|
#message-list {
|
|
|
|
.message-item-wrap.composer-outer-wrap {
|
2015-03-18 07:19:40 +08:00
|
|
|
padding-top: @spacing-standard;
|
2015-03-19 09:21:04 +08:00
|
|
|
background-image: -webkit-gradient(linear, left top, left bottom, from(@background-off-primary), to(@background-primary));
|
|
|
|
background-repeat:no-repeat;
|
|
|
|
-webkit-background-size:100% 150px;
|
2015-03-06 05:31:11 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////
|
|
|
|
// participants-text-field.cjsx //
|
|
|
|
//////////////////////////////////
|
|
|
|
.participants-text-field {
|
|
|
|
position: relative;
|
|
|
|
z-index: 2;
|
|
|
|
padding: 5px @spacing-standard 0 @spacing-standard;
|
feat(*): draft icon, misc fixes, and WorkspaceStore / custom toolbar in secondary windows
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
2015-06-04 07:02:19 +08:00
|
|
|
flex-shrink: 0;
|
2015-03-06 05:31:11 +08:00
|
|
|
|
|
|
|
.participant {
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
2015-04-21 06:59:43 +08:00
|
|
|
overflow: hidden;
|
|
|
|
|
2015-03-06 05:31:11 +08:00
|
|
|
.participant-primary {
|
|
|
|
font-weight: @font-weight-semi-bold;
|
|
|
|
}
|
|
|
|
.participant-secondary {
|
|
|
|
color: @text-color-very-subtle;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////
|
|
|
|
// floating-toolbar.cjsx //
|
|
|
|
///////////////////////////
|
|
|
|
.floating-toolbar {
|
|
|
|
z-index: 10;
|
|
|
|
position: absolute;
|
2015-03-18 07:19:40 +08:00
|
|
|
|
|
|
|
background: #fff;
|
2015-05-22 05:50:40 +08:00
|
|
|
box-shadow: 0 10px 20px rgba(0,0,0,0.19), inset 0 0 1px rgba(0,0,0,0.5);
|
2015-03-06 05:31:11 +08:00
|
|
|
border-radius: @border-radius-base;
|
2015-03-18 07:19:40 +08:00
|
|
|
color: @text-color;
|
2015-03-06 05:31:11 +08:00
|
|
|
|
2015-03-20 08:16:38 +08:00
|
|
|
transition-duration: .15s;
|
|
|
|
transition-property: opacity, margin;
|
|
|
|
opacity: 0;
|
|
|
|
visibility: hidden;
|
|
|
|
margin-top: 3px;
|
|
|
|
|
|
|
|
&.toolbar-visible {
|
|
|
|
opacity: 1;
|
|
|
|
visibility: visible;
|
2015-05-22 05:50:40 +08:00
|
|
|
margin-top: 0;
|
2015-03-20 08:16:38 +08:00
|
|
|
}
|
|
|
|
|
2015-03-06 05:31:11 +08:00
|
|
|
.toolbar-pointer {
|
|
|
|
position: absolute;
|
2015-03-18 07:19:40 +08:00
|
|
|
width: 22.5px;
|
|
|
|
height: 10px;
|
|
|
|
background: transparent url('images/tooltip/tooltip-bg-pointer@2x.png') no-repeat;
|
|
|
|
background-size: 22.5px 10.5px;
|
|
|
|
margin-left: -11.2px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.above {
|
|
|
|
.toolbar-pointer {
|
|
|
|
transform: rotate(0deg);
|
|
|
|
bottom: -9px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&.below {
|
|
|
|
.toolbar-pointer {
|
|
|
|
transform: rotate(180deg);
|
|
|
|
top: -9px;
|
|
|
|
}
|
2015-03-06 05:31:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.floating-toolbar-input {
|
|
|
|
display: inline;
|
2015-03-31 07:41:01 +08:00
|
|
|
// The hardcoded numbers here represent the widths of the various
|
|
|
|
// icons and buttons that surround the input. They are hardcoded here
|
|
|
|
// because CSS does the calculation for us that we'd otherwise have to
|
|
|
|
// do in React before the element renders to the page.
|
|
|
|
width: calc(~"100% - 62px");
|
|
|
|
&.with-remove {
|
|
|
|
width: calc(~"100% - 95px");
|
|
|
|
}
|
2015-03-18 07:19:40 +08:00
|
|
|
color: @text-color;
|
2015-03-06 05:31:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@padding: 0.5em;
|
|
|
|
.btn {
|
|
|
|
background: transparent;
|
|
|
|
font-size: 16px;
|
|
|
|
height: auto;
|
|
|
|
border-radius: 0;
|
|
|
|
padding: @padding*0.75 @padding;
|
|
|
|
margin: 0;
|
2015-03-18 07:19:40 +08:00
|
|
|
color: @text-color;
|
2015-03-06 05:31:11 +08:00
|
|
|
box-shadow: none;
|
|
|
|
&:first-child {
|
|
|
|
padding-left: 1.5*@padding;
|
|
|
|
}
|
|
|
|
&:last-child {
|
|
|
|
padding-right: 1.5*@padding;
|
|
|
|
}
|
|
|
|
&:hover, &:active {
|
|
|
|
color: lighten(@text-color-link, 10%);
|
|
|
|
background: transparent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.preview-btn-icon {
|
|
|
|
position: relative;
|
|
|
|
top: 1px;
|
|
|
|
padding: 0 @padding;
|
|
|
|
}
|
2015-03-18 07:19:40 +08:00
|
|
|
|
|
|
|
.toolbar-btn {
|
|
|
|
@padding-top: 4px;
|
|
|
|
@padding-left: 8px;
|
|
|
|
|
|
|
|
width: 12.5px + 2*@padding-left;
|
|
|
|
height: 12.5px + 2*@padding-top;
|
|
|
|
margin: 7.5px 0;
|
2015-06-12 09:45:48 +08:00
|
|
|
box-shadow: none;
|
2015-06-12 09:39:55 +08:00
|
|
|
border: 0;
|
2015-03-18 07:19:40 +08:00
|
|
|
border-right: 1px solid @border-color-divider;
|
|
|
|
&:last-child { border-right: 0 }
|
|
|
|
|
|
|
|
background: no-repeat;
|
|
|
|
background-size: 12.5px 12.5px;
|
|
|
|
background-position: @padding-left @padding-top;
|
|
|
|
&.btn-bold { background-image: url("images/composer/tooltip-bold-black@2x.png") }
|
|
|
|
&.btn-italic { background-image: url("images/composer/tooltip-italic-black@2x.png") }
|
|
|
|
&.btn-underline { background-image: url("images/composer/tooltip-underline-black@2x.png") }
|
|
|
|
&.btn-link { background-image: url("images/composer/tooltip-link-black@2x.png") }
|
|
|
|
&:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
background: no-repeat;
|
|
|
|
background-size: 12.5px 12.5px;
|
|
|
|
background-position: @padding-left @padding-top;
|
|
|
|
&.btn-bold { background-image: url("images/composer/tooltip-bold-blue@2x.png") }
|
|
|
|
&.btn-italic { background-image: url("images/composer/tooltip-italic-blue@2x.png") }
|
|
|
|
&.btn-underline { background-image: url("images/composer/tooltip-underline-blue@2x.png") }
|
|
|
|
&.btn-link { background-image: url("images/composer/tooltip-link-blue@2x.png") }
|
|
|
|
}
|
|
|
|
}
|
2015-03-06 05:31:11 +08:00
|
|
|
}
|