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:
Ben Gotow 2015-04-20 15:59:43 -07:00
parent d9ee12cf81
commit 8bd14602c3
7 changed files with 34 additions and 17 deletions

View file

@ -89,7 +89,7 @@ AccountSidebarStore = Reflux.createStore
return unless namespace
DatabaseStore.count(Message, draft: true).then (count) =>
@localDraftsTag.unreadCount = count
# Todo: Display Draft Unread Count
@trigger(@)
_refetchFromAPI: ->

View file

@ -87,7 +87,7 @@
}
.tokenizing-field.to {
padding-right: 120px;
padding-right: 160px;
}
input, textarea, div[contenteditable] {
@ -282,6 +282,8 @@ body.is-blurred .composer-inner-wrap .tokenizing-field .token {
.participant {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
.participant-primary {
font-weight: @font-weight-semi-bold;
}

View file

@ -6,7 +6,7 @@
.template-picker .menu {
.content-container {
height:150px;
overflow:scroll;
overflow-y:scroll;
}
}

View file

@ -23,12 +23,17 @@ ThreadList = React.createClass
lastMessageType = (thread) ->
myEmail = NamespaceStore.current()?.emailAddress
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]
return 'unknown' unless msgs.length > 0
if thread.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'
else if Utils.isForwardedMessage(msg)
return 'forwarded'

View file

@ -4,7 +4,6 @@ NamespaceStore = require './namespace-store'
WorkspaceStore = require './workspace-store'
Actions = require '../actions'
Thread = require '../models/thread'
MarkThreadReadTask = require '../tasks/mark-thread-read'
AddRemoveTagsTask = require '../tasks/add-remove-tags'
module.exports =
@ -42,11 +41,8 @@ FocusedContentStore = Reflux.createStore
@_focused[collection] = item
@_keyboardCursor[collection] = item if item
if item && item instanceof Thread && item.isUnread()
Actions.queueTask(new MarkThreadReadTask(item))
@trigger({ impactsCollection: (c) -> c is collection })
_onWorkspaceChange: ->
keyboardCursorEnabled = WorkspaceStore.layoutMode() is 'list'

View file

@ -1,9 +1,11 @@
Reflux = require "reflux"
Actions = require "../actions"
Message = require "../models/message"
Thread = require "../models/thread"
DatabaseStore = require "./database-store"
NamespaceStore = require "./namespace-store"
FocusedContentStore = require "./focused-content-store"
MarkThreadReadTask = require '../tasks/mark-thread-read'
async = require 'async'
_ = require 'underscore-plus'
@ -19,7 +21,7 @@ MessageStore = Reflux.createStore
@_items
threadId: -> @_thread?.id
thread: -> @_thread
itemsExpandedState: ->
@ -49,12 +51,18 @@ MessageStore = Reflux.createStore
@listenTo Actions.toggleMessageIdExpanded, @_onToggleMessageIdExpanded
_onDataChanged: (change) ->
return unless change.objectClass == Message.name
return unless @_thread
inDisplayedThread = _.some change.objects, (obj) =>
obj.threadId == @_thread.id
return unless inDisplayedThread
@_fetchFromCache()
if change.objectClass is Message.name
inDisplayedThread = _.some change.objects, (obj) => obj.threadId is @_thread.id
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) ->
focused = FocusedContentStore.focused('thread')
@ -79,10 +87,16 @@ MessageStore = Reflux.createStore
@trigger()
_markAsReadIfNecessary: ->
if @_thread && @_thread.isUnread()
Actions.queueTask(new MarkThreadReadTask(@_thread))
_fetchFromCache: (options = {}) ->
return unless @_thread
loadedThreadId = @_thread.id
@_markAsReadIfNecessary()
query = DatabaseStore.findAll(Message, threadId: loadedThreadId)
query.include(Message.attributes.body)
query.evaluateImmediately()

View file

@ -71,7 +71,7 @@
position: absolute;
height: 100%;
width: 100%;
overflow: scroll;
overflow-y: scroll;
.list-item {
font-size: @font-size-base;