mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-08 21:55:54 +08:00
fix(*): Small patches for thread icons, marking as read, scrollbars
Summary: fix(scrollbars): overflow-y, not overflow fix(participants): Overflow not set correctly on participants fix(thread-list): Don't show reply or fw icon for unsent drafts Remove bad code for updating sidebar drafts Mark as read in MessageStore so that receiving new messages while viewing a thread re-marks it as read Don't show messages I send with the "Reply" icon Test Plan: Run tests Reviewers: evan Reviewed By: evan Differential Revision: https://review.inboxapp.com/D1418
This commit is contained in:
parent
d9ee12cf81
commit
8bd14602c3
7 changed files with 34 additions and 17 deletions
|
@ -89,7 +89,7 @@ AccountSidebarStore = Reflux.createStore
|
||||||
return unless namespace
|
return unless namespace
|
||||||
|
|
||||||
DatabaseStore.count(Message, draft: true).then (count) =>
|
DatabaseStore.count(Message, draft: true).then (count) =>
|
||||||
@localDraftsTag.unreadCount = count
|
# Todo: Display Draft Unread Count
|
||||||
@trigger(@)
|
@trigger(@)
|
||||||
|
|
||||||
_refetchFromAPI: ->
|
_refetchFromAPI: ->
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.tokenizing-field.to {
|
.tokenizing-field.to {
|
||||||
padding-right: 120px;
|
padding-right: 160px;
|
||||||
}
|
}
|
||||||
|
|
||||||
input, textarea, div[contenteditable] {
|
input, textarea, div[contenteditable] {
|
||||||
|
@ -282,6 +282,8 @@ body.is-blurred .composer-inner-wrap .tokenizing-field .token {
|
||||||
.participant {
|
.participant {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
.participant-primary {
|
.participant-primary {
|
||||||
font-weight: @font-weight-semi-bold;
|
font-weight: @font-weight-semi-bold;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
.template-picker .menu {
|
.template-picker .menu {
|
||||||
.content-container {
|
.content-container {
|
||||||
height:150px;
|
height:150px;
|
||||||
overflow:scroll;
|
overflow-y:scroll;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,12 +23,17 @@ ThreadList = React.createClass
|
||||||
|
|
||||||
lastMessageType = (thread) ->
|
lastMessageType = (thread) ->
|
||||||
myEmail = NamespaceStore.current()?.emailAddress
|
myEmail = NamespaceStore.current()?.emailAddress
|
||||||
|
|
||||||
msgs = thread.metadata
|
msgs = thread.metadata
|
||||||
return 'unknown' unless msgs and msgs instanceof Array and msgs.length > 0
|
return 'unknown' unless msgs and msgs instanceof Array
|
||||||
|
|
||||||
|
msgs = _.filter msgs, (m) -> m.isSaved()
|
||||||
msg = msgs[msgs.length - 1]
|
msg = msgs[msgs.length - 1]
|
||||||
|
return 'unknown' unless msgs.length > 0
|
||||||
|
|
||||||
if thread.unread
|
if thread.unread
|
||||||
return 'unread'
|
return 'unread'
|
||||||
else if msg.from[0].email isnt myEmail
|
else if msg.from[0].email isnt myEmail or msgs.length is 1
|
||||||
return 'other'
|
return 'other'
|
||||||
else if Utils.isForwardedMessage(msg)
|
else if Utils.isForwardedMessage(msg)
|
||||||
return 'forwarded'
|
return 'forwarded'
|
||||||
|
|
|
@ -4,7 +4,6 @@ NamespaceStore = require './namespace-store'
|
||||||
WorkspaceStore = require './workspace-store'
|
WorkspaceStore = require './workspace-store'
|
||||||
Actions = require '../actions'
|
Actions = require '../actions'
|
||||||
Thread = require '../models/thread'
|
Thread = require '../models/thread'
|
||||||
MarkThreadReadTask = require '../tasks/mark-thread-read'
|
|
||||||
AddRemoveTagsTask = require '../tasks/add-remove-tags'
|
AddRemoveTagsTask = require '../tasks/add-remove-tags'
|
||||||
|
|
||||||
module.exports =
|
module.exports =
|
||||||
|
@ -42,11 +41,8 @@ FocusedContentStore = Reflux.createStore
|
||||||
@_focused[collection] = item
|
@_focused[collection] = item
|
||||||
@_keyboardCursor[collection] = item if item
|
@_keyboardCursor[collection] = item if item
|
||||||
|
|
||||||
if item && item instanceof Thread && item.isUnread()
|
|
||||||
Actions.queueTask(new MarkThreadReadTask(item))
|
|
||||||
|
|
||||||
@trigger({ impactsCollection: (c) -> c is collection })
|
@trigger({ impactsCollection: (c) -> c is collection })
|
||||||
|
|
||||||
_onWorkspaceChange: ->
|
_onWorkspaceChange: ->
|
||||||
keyboardCursorEnabled = WorkspaceStore.layoutMode() is 'list'
|
keyboardCursorEnabled = WorkspaceStore.layoutMode() is 'list'
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
Reflux = require "reflux"
|
Reflux = require "reflux"
|
||||||
Actions = require "../actions"
|
Actions = require "../actions"
|
||||||
Message = require "../models/message"
|
Message = require "../models/message"
|
||||||
|
Thread = require "../models/thread"
|
||||||
DatabaseStore = require "./database-store"
|
DatabaseStore = require "./database-store"
|
||||||
NamespaceStore = require "./namespace-store"
|
NamespaceStore = require "./namespace-store"
|
||||||
FocusedContentStore = require "./focused-content-store"
|
FocusedContentStore = require "./focused-content-store"
|
||||||
|
MarkThreadReadTask = require '../tasks/mark-thread-read'
|
||||||
async = require 'async'
|
async = require 'async'
|
||||||
_ = require 'underscore-plus'
|
_ = require 'underscore-plus'
|
||||||
|
|
||||||
|
@ -19,7 +21,7 @@ MessageStore = Reflux.createStore
|
||||||
@_items
|
@_items
|
||||||
|
|
||||||
threadId: -> @_thread?.id
|
threadId: -> @_thread?.id
|
||||||
|
|
||||||
thread: -> @_thread
|
thread: -> @_thread
|
||||||
|
|
||||||
itemsExpandedState: ->
|
itemsExpandedState: ->
|
||||||
|
@ -49,12 +51,18 @@ MessageStore = Reflux.createStore
|
||||||
@listenTo Actions.toggleMessageIdExpanded, @_onToggleMessageIdExpanded
|
@listenTo Actions.toggleMessageIdExpanded, @_onToggleMessageIdExpanded
|
||||||
|
|
||||||
_onDataChanged: (change) ->
|
_onDataChanged: (change) ->
|
||||||
return unless change.objectClass == Message.name
|
|
||||||
return unless @_thread
|
return unless @_thread
|
||||||
inDisplayedThread = _.some change.objects, (obj) =>
|
|
||||||
obj.threadId == @_thread.id
|
if change.objectClass is Message.name
|
||||||
return unless inDisplayedThread
|
inDisplayedThread = _.some change.objects, (obj) => obj.threadId is @_thread.id
|
||||||
@_fetchFromCache()
|
if inDisplayedThread
|
||||||
|
@_fetchFromCache()
|
||||||
|
|
||||||
|
if change.objectClass is Thread.name
|
||||||
|
updatedThread = _.find change.objects, (obj) => obj.id is @_thread.id
|
||||||
|
if updatedThread
|
||||||
|
@_thread = updatedThread
|
||||||
|
@_fetchFromCache()
|
||||||
|
|
||||||
_onFocusChanged: (change) ->
|
_onFocusChanged: (change) ->
|
||||||
focused = FocusedContentStore.focused('thread')
|
focused = FocusedContentStore.focused('thread')
|
||||||
|
@ -79,10 +87,16 @@ MessageStore = Reflux.createStore
|
||||||
|
|
||||||
@trigger()
|
@trigger()
|
||||||
|
|
||||||
|
_markAsReadIfNecessary: ->
|
||||||
|
if @_thread && @_thread.isUnread()
|
||||||
|
Actions.queueTask(new MarkThreadReadTask(@_thread))
|
||||||
|
|
||||||
_fetchFromCache: (options = {}) ->
|
_fetchFromCache: (options = {}) ->
|
||||||
return unless @_thread
|
return unless @_thread
|
||||||
loadedThreadId = @_thread.id
|
loadedThreadId = @_thread.id
|
||||||
|
|
||||||
|
@_markAsReadIfNecessary()
|
||||||
|
|
||||||
query = DatabaseStore.findAll(Message, threadId: loadedThreadId)
|
query = DatabaseStore.findAll(Message, threadId: loadedThreadId)
|
||||||
query.include(Message.attributes.body)
|
query.include(Message.attributes.body)
|
||||||
query.evaluateImmediately()
|
query.evaluateImmediately()
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: scroll;
|
overflow-y: scroll;
|
||||||
|
|
||||||
.list-item {
|
.list-item {
|
||||||
font-size: @font-size-base;
|
font-size: @font-size-base;
|
||||||
|
|
Loading…
Add table
Reference in a new issue