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
|
|
|
@import "ui-variables";
|
|
|
|
@import "ui-mixins";
|
|
|
|
|
|
|
|
*:focus, input:focus {
|
|
|
|
outline:none;
|
|
|
|
}
|
|
|
|
|
2015-05-16 04:16:34 +08:00
|
|
|
.thread-list, .draft-list {
|
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
|
|
|
order: 3;
|
|
|
|
flex: 1;
|
2015-06-06 02:50:55 +08:00
|
|
|
position:absolute;
|
|
|
|
width:100%;
|
|
|
|
height:100%;
|
2015-03-26 09:22:52 +08:00
|
|
|
-webkit-font-smoothing: subpixel-antialiased;
|
2015-03-04 04:00:04 +08:00
|
|
|
|
2015-03-26 03:41:48 +08:00
|
|
|
.list-item {
|
2015-03-26 09:22:52 +08:00
|
|
|
background-color: darken(@background-primary, 3%);
|
|
|
|
}
|
2015-04-09 10:25:00 +08:00
|
|
|
|
2015-03-26 09:22:52 +08:00
|
|
|
.list-column {
|
|
|
|
border-bottom: 1px solid fade(@list-border, 60%);
|
2015-03-26 03:41:48 +08:00
|
|
|
}
|
|
|
|
|
2015-03-04 04:00:04 +08:00
|
|
|
.message-count {
|
|
|
|
color: @text-color-inverse;
|
|
|
|
background: @background-tertiary;
|
2015-03-04 10:09:57 +08:00
|
|
|
padding: 4px 6px 2px 6px;
|
|
|
|
margin-left: 1em;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
.draft-icon {
|
|
|
|
margin-top:8px;
|
|
|
|
margin-left:10px;
|
|
|
|
flex-shrink: 0;
|
|
|
|
object-fit: contain;
|
|
|
|
}
|
|
|
|
|
2015-03-04 10:09:57 +08:00
|
|
|
.participants {
|
2015-03-26 03:41:48 +08:00
|
|
|
font-size: @font-size-small;
|
2015-03-10 09:25:53 +08:00
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
2015-03-26 03:41:48 +08:00
|
|
|
.unread-true {
|
|
|
|
font-weight: @font-weight-semi-bold;
|
|
|
|
}
|
|
|
|
position: relative;
|
|
|
|
top:2px;
|
2015-03-04 10:09:57 +08:00
|
|
|
}
|
2015-03-10 09:25:53 +08:00
|
|
|
|
2015-03-26 03:41:48 +08:00
|
|
|
.details {
|
|
|
|
display:flex;
|
|
|
|
.subject {
|
|
|
|
font-size: @font-size-small;
|
|
|
|
font-weight: @font-weight-normal;
|
|
|
|
padding-right: @padding-base-horizontal;
|
|
|
|
position: relative;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
flex-shrink:0;
|
|
|
|
top:2px;
|
|
|
|
}
|
|
|
|
.snippet {
|
|
|
|
font-size: @font-size-small;
|
|
|
|
font-weight: @font-weight-normal;
|
|
|
|
color: @text-color-very-subtle;
|
|
|
|
position: relative;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
top:2px;
|
|
|
|
}
|
|
|
|
.thread-icon {
|
|
|
|
flex-shrink:0;
|
|
|
|
margin-right:@padding-base-horizontal;
|
|
|
|
margin-left:@padding-base-horizontal;
|
|
|
|
}
|
2015-03-04 10:09:57 +08:00
|
|
|
}
|
2015-03-26 03:41:48 +08:00
|
|
|
|
|
|
|
.timestamp {
|
2015-03-04 10:09:57 +08:00
|
|
|
font-size: @font-size-small;
|
|
|
|
font-weight: @font-weight-normal;
|
2015-03-26 03:41:48 +08:00
|
|
|
color: @text-color-very-subtle;
|
|
|
|
position: relative;
|
|
|
|
top:2px;
|
2015-03-04 10:09:57 +08:00
|
|
|
}
|
2015-03-10 09:25:53 +08:00
|
|
|
|
2015-04-09 10:25:00 +08:00
|
|
|
.unread:not(.focused):not(.selected) {
|
2015-03-26 09:22:52 +08:00
|
|
|
background-color: @background-primary;
|
|
|
|
&:hover {
|
|
|
|
background: darken(@background-primary, 2%);
|
|
|
|
}
|
|
|
|
.list-column {
|
|
|
|
border-bottom: 1px solid @list-border;
|
|
|
|
}
|
2015-04-09 10:25:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.unread:not(.focused) {
|
|
|
|
// Never show any unread styles when the thread is focused.
|
|
|
|
// It will be marked as read and the delay from focus=>read
|
|
|
|
// is noticeable.
|
2015-03-10 09:25:53 +08:00
|
|
|
.subject {
|
2015-03-26 03:41:48 +08:00
|
|
|
font-weight: @font-weight-semi-bold;
|
2015-03-10 09:25:53 +08:00
|
|
|
}
|
2015-03-26 09:22:52 +08:00
|
|
|
.snippet {
|
|
|
|
color: @text-color-subtle;
|
|
|
|
}
|
2015-03-10 09:25:53 +08:00
|
|
|
}
|
|
|
|
|
2015-04-09 10:25:00 +08:00
|
|
|
.focused {
|
2015-03-26 09:22:52 +08:00
|
|
|
// subpixel antialiasing looks awful against dark background colors
|
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
|
|
2015-03-04 10:09:57 +08:00
|
|
|
.participants {
|
|
|
|
color: @text-color-inverse;
|
2015-03-26 03:41:48 +08:00
|
|
|
.unread-true {
|
|
|
|
font-weight: @font-weight-normal;
|
|
|
|
}
|
2015-03-04 10:09:57 +08:00
|
|
|
}
|
|
|
|
.subject {
|
|
|
|
color: @text-color-inverse;
|
2015-03-26 03:41:48 +08:00
|
|
|
font-weight: @font-weight-normal;
|
2015-03-04 10:09:57 +08:00
|
|
|
}
|
|
|
|
.snippet, .timestamp {
|
|
|
|
color: @text-color-inverse-subtle;
|
|
|
|
}
|
2015-04-09 10:25:00 +08:00
|
|
|
|
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
|
|
|
.thread-icon, .draft-icon {
|
|
|
|
-webkit-filter: brightness(600%) grayscale(100%);
|
2015-04-09 10:25:00 +08:00
|
|
|
}
|
2015-03-04 04:00:04 +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-26 03:41:48 +08:00
|
|
|
.thread-icon {
|
|
|
|
display:inline-block;
|
|
|
|
width:15px;
|
|
|
|
height:15px;
|
|
|
|
background-size: 100%;
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
position: relative;
|
2015-06-04 02:07:59 +08:00
|
|
|
top: 5px;
|
|
|
|
vertical-align: top;
|
2015-03-26 03:41:48 +08:00
|
|
|
}
|
|
|
|
.thread-icon-attachment {
|
|
|
|
background-image:url(../static/images/thread-list/icon-attachment-@2x.png);
|
|
|
|
}
|
|
|
|
.thread-icon-unread {
|
|
|
|
background-image:url(../static/images/thread-list/icon-unread-@2x.png);
|
|
|
|
}
|
|
|
|
.thread-icon-replied {
|
|
|
|
background-image:url(../static/images/thread-list/icon-replied-@2x.png);
|
|
|
|
}
|
|
|
|
.thread-icon-forwarded {
|
|
|
|
background-image:url(../static/images/thread-list/icon-forwarded-@2x.png);
|
|
|
|
}
|
feat(unsafe-components): Wrap injected components, catch exceptions, clean up ComponentRegistry
Summary:
This diff gives the ComponentRegistry a cleaner, smaller API. Instead of querying by name, location or role,
it's now just location and role, and you can register components for one or more location and one or more
roles without assigning the entries in the registry separate names.
When you register with the ComponentRegistry, the syntax is also cleaner and uses the component's displayName
instead of requiring you to provide a name. You also provide the actual component when unregistering, ensuring
that you can't unregister someone else's component.
InjectedComponent and InjectedComponentSet now wrap their children in UnsafeComponent, which prevents
render/component lifecycle problems from propogating.
Existing components have been updated:
1. maxWidth / minWidth are now containerStyles.maxWidth/minWidth
2. displayName is now required to use the CR.
3. containerRequired = false can be provided to exempt a component from being wrapped in an UnsafeComponent.
This is useful because it's slightly faster and keeps DOM flat.
This diff also makes the "Show Component Regions" more awesome. It displays column regions, since they now
use the InjectedComponentSet, and also shows for InjectedComponent as well as InjectedComponentSet.
Change ComponentRegistry syntax, lots more work on safely wrapping items. See description.
Fix for inline flexbox scenarios (message actions)
Allow ~/.inbox/packages to be symlinked to a github repo
Test Plan: Run tests!
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1457
2015-05-01 07:10:15 +08:00
|
|
|
|
2015-02-05 10:22:23 +08:00
|
|
|
.star-button {
|
|
|
|
font-size: 16px;
|
|
|
|
.fa-star {
|
|
|
|
color: rgb(239, 209, 0);
|
|
|
|
&:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
color: rgb(220,220,220);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.fa-star-o {
|
|
|
|
color: rgb(220,220,220);
|
|
|
|
&:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
color: rgb(239, 209, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|