2015-04-01 08:19:17 +08:00
|
|
|
Reflux = require 'reflux'
|
2015-05-20 07:06:59 +08:00
|
|
|
_ = require 'underscore'
|
2015-04-01 08:19:17 +08:00
|
|
|
|
|
|
|
{DatabaseStore,
|
2015-04-07 02:46:20 +08:00
|
|
|
DatabaseView,
|
2015-04-23 07:41:29 +08:00
|
|
|
SearchView,
|
2015-04-01 08:19:17 +08:00
|
|
|
NamespaceStore,
|
|
|
|
WorkspaceStore,
|
|
|
|
AddRemoveTagsTask,
|
|
|
|
FocusedTagStore,
|
2015-04-09 10:25:00 +08:00
|
|
|
FocusedContentStore,
|
2015-04-01 08:19:17 +08:00
|
|
|
Actions,
|
|
|
|
Utils,
|
|
|
|
Thread,
|
2015-05-15 08:08:30 +08:00
|
|
|
Message} = require 'nylas-exports'
|
2015-04-01 08:19:17 +08:00
|
|
|
|
2015-04-25 02:33:10 +08:00
|
|
|
# Public: A mutable text container with undo/redo support and the ability to
|
|
|
|
# annotate logical regions in the text.
|
|
|
|
#
|
2015-04-09 10:25:00 +08:00
|
|
|
module.exports =
|
|
|
|
ThreadListStore = Reflux.createStore
|
2015-04-01 08:19:17 +08:00
|
|
|
init: ->
|
|
|
|
@_resetInstanceVars()
|
2015-04-09 10:25:00 +08:00
|
|
|
@_afterViewUpdate = []
|
2015-04-01 08:19:17 +08:00
|
|
|
|
|
|
|
@listenTo Actions.searchQueryCommitted, @_onSearchCommitted
|
2015-04-09 10:25:00 +08:00
|
|
|
@listenTo Actions.selectLayoutMode, @_autofocusForLayoutMode
|
2015-04-01 08:19:17 +08:00
|
|
|
|
|
|
|
@listenTo Actions.archiveAndPrevious, @_onArchiveAndPrev
|
|
|
|
@listenTo Actions.archiveAndNext, @_onArchiveAndNext
|
refactor(*): Thread list fixes, flexible workspace store, multiple root sheets
Summary:
Remember to remove all the event listeners added to email frame
New files tab, queryable filename, not attribute
Rename ThreadSelectionBar to RootSelectionBar to go with RootCenterComponent, make it appear for draft selection and file selection as well
Initial file list and file list store, File Location
Remove unnecessary shouldComponentUpdate
Always track whether new requests have happened since ours to prevent out of order triggers
Always scroll to the current [focused/keyboard-cursor] in lists
So goodbye to the trash tag
Only scroll to current item if focus or keyboard has moved
Show message snippet in notification if no subject line
Make the RootSelectionBar pull items from Component Registry
New Archive button (prettier than the other one)
Refactor event additions to iframe so iframe can be used for file display also
Thread List is no longer the uber root package - drafts and files moved to separate packages
WorkspaceStore now allows packages to register sheets, "view" concept replaced with "root sheet" concept, "mode" may not be observed by all sheets, and is now called "preferred mode"
Don't animate transitions between two root sheets
Mode switch is only visible on root sheets that support multiple modes
Account sidebar now shows "Views" that have registered themselves: drafts and files for now
Model Selection Bar is now a component, just like ModelList. Meant to be in the toolbar above a Model List
Misc supporting changes
New files package which registers it's views and components
Rename files package to `file-list`
Move checkmark column down into model list
Don't throw exception if shift-down arrow and nothing selected
Takes a long time on login to fetch first page of threads, make pages smaller
Displaynames, spec fixes
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1412
2015-04-11 05:33:05 +08:00
|
|
|
@listenTo Actions.archiveSelection, @_onArchiveSelection
|
|
|
|
@listenTo Actions.archive, @_onArchive
|
2015-04-01 08:19:17 +08:00
|
|
|
|
2015-06-09 08:02:50 +08:00
|
|
|
@listenTo Actions.toggleStarSelection, @_onToggleStarSelection
|
|
|
|
|
2015-04-01 08:19:17 +08:00
|
|
|
@listenTo DatabaseStore, @_onDataChanged
|
2015-04-07 02:46:20 +08:00
|
|
|
@listenTo FocusedTagStore, @_onTagChanged
|
2015-04-01 08:19:17 +08:00
|
|
|
@listenTo NamespaceStore, @_onNamespaceChanged
|
|
|
|
|
2015-05-22 09:08:29 +08:00
|
|
|
@createView()
|
|
|
|
|
2015-04-01 08:19:17 +08:00
|
|
|
_resetInstanceVars: ->
|
2015-04-07 02:46:20 +08:00
|
|
|
@_lastQuery = null
|
2015-04-01 08:19:17 +08:00
|
|
|
@_searchQuery = null
|
|
|
|
|
2015-04-07 02:46:20 +08:00
|
|
|
view: ->
|
|
|
|
@_view
|
|
|
|
|
|
|
|
setView: (view) ->
|
|
|
|
@_viewUnlisten() if @_viewUnlisten
|
|
|
|
@_view = view
|
2015-04-01 08:19:17 +08:00
|
|
|
|
2015-04-09 10:25:00 +08:00
|
|
|
@_viewUnlisten = view.listen ->
|
2015-04-07 02:46:20 +08:00
|
|
|
@trigger(@)
|
2015-04-09 10:25:00 +08:00
|
|
|
fn() for fn in @_afterViewUpdate
|
|
|
|
@_afterViewUpdate = []
|
|
|
|
@_autofocusForLayoutMode()
|
2015-04-07 02:46:20 +08:00
|
|
|
,@
|
|
|
|
|
|
|
|
@trigger(@)
|
|
|
|
|
|
|
|
createView: ->
|
2015-04-01 08:19:17 +08:00
|
|
|
tagId = FocusedTagStore.tagId()
|
2015-04-07 02:46:20 +08:00
|
|
|
namespaceId = NamespaceStore.current()?.id
|
2015-04-01 08:19:17 +08:00
|
|
|
|
|
|
|
if @_searchQuery
|
2015-04-07 02:46:20 +08:00
|
|
|
@setView(new SearchView(@_searchQuery, namespaceId))
|
|
|
|
|
|
|
|
else if namespaceId and tagId
|
|
|
|
matchers = []
|
|
|
|
matchers.push Thread.attributes.namespaceId.equal(namespaceId)
|
|
|
|
matchers.push Thread.attributes.tags.contains(tagId) if tagId isnt "*"
|
|
|
|
@setView new DatabaseView Thread, {matchers}, (item) ->
|
|
|
|
DatabaseStore.findAll(Message, {threadId: item.id})
|
|
|
|
|
2015-06-12 09:00:40 +08:00
|
|
|
Actions.setFocus(collection: 'thread', item: null)
|
2015-04-01 08:19:17 +08:00
|
|
|
|
|
|
|
# Inbound Events
|
|
|
|
|
2015-04-07 02:46:20 +08:00
|
|
|
_onTagChanged: -> @createView()
|
2015-05-22 09:08:29 +08:00
|
|
|
_onNamespaceChanged: ->
|
|
|
|
namespaceId = NamespaceStore.current()?.id
|
|
|
|
namespaceMatcher = (m) ->
|
|
|
|
m.attribute() is Thread.attributes.namespaceId and m.value() is namespaceId
|
|
|
|
|
|
|
|
return if @view and _.find(@view.matchers, namespaceMatcher)
|
|
|
|
@createView()
|
2015-04-01 08:19:17 +08:00
|
|
|
|
2015-04-07 02:46:20 +08:00
|
|
|
_onSearchCommitted: (query) ->
|
2015-04-28 09:26:04 +08:00
|
|
|
return if @_searchQuery is query
|
2015-04-07 02:46:20 +08:00
|
|
|
@_searchQuery = query
|
|
|
|
@createView()
|
2015-04-01 08:19:17 +08:00
|
|
|
|
|
|
|
_onDataChanged: (change) ->
|
|
|
|
if change.objectClass is Thread.name
|
2015-04-09 10:25:00 +08:00
|
|
|
@_view.invalidate({changed: change.objects, shallow: true})
|
2015-04-01 08:19:17 +08:00
|
|
|
|
|
|
|
if change.objectClass is Message.name
|
2015-04-07 02:46:20 +08:00
|
|
|
threadIds = _.uniq _.map change.objects, (m) -> m.threadId
|
2015-04-09 10:25:00 +08:00
|
|
|
@_view.invalidateMetadataFor(threadIds)
|
2015-04-01 08:19:17 +08:00
|
|
|
|
2015-06-09 08:02:50 +08:00
|
|
|
_onToggleStarSelection: ->
|
|
|
|
selected = @_view.selection.items()
|
|
|
|
focusedId = FocusedContentStore.focusedId('thread')
|
|
|
|
keyboardId = FocusedContentStore.keyboardCursorId('thread')
|
|
|
|
|
|
|
|
oneAlreadyStarred = false
|
|
|
|
for thread in selected
|
|
|
|
if thread.hasTagId('starred')
|
|
|
|
oneAlreadyStarred = true
|
|
|
|
|
|
|
|
for thread in selected
|
|
|
|
if oneAlreadyStarred
|
|
|
|
task = new AddRemoveTagsTask(thread, [], ['starred'])
|
|
|
|
else
|
|
|
|
task = new AddRemoveTagsTask(thread, ['starred'], [])
|
|
|
|
Actions.queueTask(task)
|
|
|
|
|
2015-04-01 08:19:17 +08:00
|
|
|
_onArchive: ->
|
|
|
|
@_archiveAndShiftBy('auto')
|
|
|
|
|
refactor(*): Thread list fixes, flexible workspace store, multiple root sheets
Summary:
Remember to remove all the event listeners added to email frame
New files tab, queryable filename, not attribute
Rename ThreadSelectionBar to RootSelectionBar to go with RootCenterComponent, make it appear for draft selection and file selection as well
Initial file list and file list store, File Location
Remove unnecessary shouldComponentUpdate
Always track whether new requests have happened since ours to prevent out of order triggers
Always scroll to the current [focused/keyboard-cursor] in lists
So goodbye to the trash tag
Only scroll to current item if focus or keyboard has moved
Show message snippet in notification if no subject line
Make the RootSelectionBar pull items from Component Registry
New Archive button (prettier than the other one)
Refactor event additions to iframe so iframe can be used for file display also
Thread List is no longer the uber root package - drafts and files moved to separate packages
WorkspaceStore now allows packages to register sheets, "view" concept replaced with "root sheet" concept, "mode" may not be observed by all sheets, and is now called "preferred mode"
Don't animate transitions between two root sheets
Mode switch is only visible on root sheets that support multiple modes
Account sidebar now shows "Views" that have registered themselves: drafts and files for now
Model Selection Bar is now a component, just like ModelList. Meant to be in the toolbar above a Model List
Misc supporting changes
New files package which registers it's views and components
Rename files package to `file-list`
Move checkmark column down into model list
Don't throw exception if shift-down arrow and nothing selected
Takes a long time on login to fetch first page of threads, make pages smaller
Displaynames, spec fixes
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1412
2015-04-11 05:33:05 +08:00
|
|
|
_onArchiveSelection: ->
|
|
|
|
selected = @_view.selection.items()
|
|
|
|
focusedId = FocusedContentStore.focusedId('thread')
|
|
|
|
keyboardId = FocusedContentStore.keyboardCursorId('thread')
|
|
|
|
|
|
|
|
for thread in selected
|
|
|
|
task = new AddRemoveTagsTask(thread, ['archive'], ['inbox'])
|
|
|
|
Actions.queueTask(task)
|
|
|
|
if thread.id is focusedId
|
2015-06-12 09:00:40 +08:00
|
|
|
Actions.setFocus(collection: 'thread', item: null)
|
refactor(*): Thread list fixes, flexible workspace store, multiple root sheets
Summary:
Remember to remove all the event listeners added to email frame
New files tab, queryable filename, not attribute
Rename ThreadSelectionBar to RootSelectionBar to go with RootCenterComponent, make it appear for draft selection and file selection as well
Initial file list and file list store, File Location
Remove unnecessary shouldComponentUpdate
Always track whether new requests have happened since ours to prevent out of order triggers
Always scroll to the current [focused/keyboard-cursor] in lists
So goodbye to the trash tag
Only scroll to current item if focus or keyboard has moved
Show message snippet in notification if no subject line
Make the RootSelectionBar pull items from Component Registry
New Archive button (prettier than the other one)
Refactor event additions to iframe so iframe can be used for file display also
Thread List is no longer the uber root package - drafts and files moved to separate packages
WorkspaceStore now allows packages to register sheets, "view" concept replaced with "root sheet" concept, "mode" may not be observed by all sheets, and is now called "preferred mode"
Don't animate transitions between two root sheets
Mode switch is only visible on root sheets that support multiple modes
Account sidebar now shows "Views" that have registered themselves: drafts and files for now
Model Selection Bar is now a component, just like ModelList. Meant to be in the toolbar above a Model List
Misc supporting changes
New files package which registers it's views and components
Rename files package to `file-list`
Move checkmark column down into model list
Don't throw exception if shift-down arrow and nothing selected
Takes a long time on login to fetch first page of threads, make pages smaller
Displaynames, spec fixes
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1412
2015-04-11 05:33:05 +08:00
|
|
|
if thread.id is keyboardId
|
2015-06-12 09:00:40 +08:00
|
|
|
Actions.setCursorPosition(collection: 'thread', item: null)
|
refactor(*): Thread list fixes, flexible workspace store, multiple root sheets
Summary:
Remember to remove all the event listeners added to email frame
New files tab, queryable filename, not attribute
Rename ThreadSelectionBar to RootSelectionBar to go with RootCenterComponent, make it appear for draft selection and file selection as well
Initial file list and file list store, File Location
Remove unnecessary shouldComponentUpdate
Always track whether new requests have happened since ours to prevent out of order triggers
Always scroll to the current [focused/keyboard-cursor] in lists
So goodbye to the trash tag
Only scroll to current item if focus or keyboard has moved
Show message snippet in notification if no subject line
Make the RootSelectionBar pull items from Component Registry
New Archive button (prettier than the other one)
Refactor event additions to iframe so iframe can be used for file display also
Thread List is no longer the uber root package - drafts and files moved to separate packages
WorkspaceStore now allows packages to register sheets, "view" concept replaced with "root sheet" concept, "mode" may not be observed by all sheets, and is now called "preferred mode"
Don't animate transitions between two root sheets
Mode switch is only visible on root sheets that support multiple modes
Account sidebar now shows "Views" that have registered themselves: drafts and files for now
Model Selection Bar is now a component, just like ModelList. Meant to be in the toolbar above a Model List
Misc supporting changes
New files package which registers it's views and components
Rename files package to `file-list`
Move checkmark column down into model list
Don't throw exception if shift-down arrow and nothing selected
Takes a long time on login to fetch first page of threads, make pages smaller
Displaynames, spec fixes
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1412
2015-04-11 05:33:05 +08:00
|
|
|
|
|
|
|
@_view.selection.clear()
|
|
|
|
|
2015-04-01 08:19:17 +08:00
|
|
|
_onArchiveAndPrev: ->
|
|
|
|
@_archiveAndShiftBy(-1)
|
|
|
|
|
|
|
|
_onArchiveAndNext: ->
|
|
|
|
@_archiveAndShiftBy(1)
|
|
|
|
|
|
|
|
_archiveAndShiftBy: (offset) ->
|
refactor(*): Thread list fixes, flexible workspace store, multiple root sheets
Summary:
Remember to remove all the event listeners added to email frame
New files tab, queryable filename, not attribute
Rename ThreadSelectionBar to RootSelectionBar to go with RootCenterComponent, make it appear for draft selection and file selection as well
Initial file list and file list store, File Location
Remove unnecessary shouldComponentUpdate
Always track whether new requests have happened since ours to prevent out of order triggers
Always scroll to the current [focused/keyboard-cursor] in lists
So goodbye to the trash tag
Only scroll to current item if focus or keyboard has moved
Show message snippet in notification if no subject line
Make the RootSelectionBar pull items from Component Registry
New Archive button (prettier than the other one)
Refactor event additions to iframe so iframe can be used for file display also
Thread List is no longer the uber root package - drafts and files moved to separate packages
WorkspaceStore now allows packages to register sheets, "view" concept replaced with "root sheet" concept, "mode" may not be observed by all sheets, and is now called "preferred mode"
Don't animate transitions between two root sheets
Mode switch is only visible on root sheets that support multiple modes
Account sidebar now shows "Views" that have registered themselves: drafts and files for now
Model Selection Bar is now a component, just like ModelList. Meant to be in the toolbar above a Model List
Misc supporting changes
New files package which registers it's views and components
Rename files package to `file-list`
Move checkmark column down into model list
Don't throw exception if shift-down arrow and nothing selected
Takes a long time on login to fetch first page of threads, make pages smaller
Displaynames, spec fixes
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1412
2015-04-11 05:33:05 +08:00
|
|
|
layoutMode = WorkspaceStore.layoutMode()
|
|
|
|
focused = FocusedContentStore.focused('thread')
|
|
|
|
explicitOffset = if offset is "auto" then false else true
|
|
|
|
|
2015-05-20 10:23:34 +08:00
|
|
|
return unless focused
|
2015-04-01 08:19:17 +08:00
|
|
|
|
refactor(*): Thread list fixes, flexible workspace store, multiple root sheets
Summary:
Remember to remove all the event listeners added to email frame
New files tab, queryable filename, not attribute
Rename ThreadSelectionBar to RootSelectionBar to go with RootCenterComponent, make it appear for draft selection and file selection as well
Initial file list and file list store, File Location
Remove unnecessary shouldComponentUpdate
Always track whether new requests have happened since ours to prevent out of order triggers
Always scroll to the current [focused/keyboard-cursor] in lists
So goodbye to the trash tag
Only scroll to current item if focus or keyboard has moved
Show message snippet in notification if no subject line
Make the RootSelectionBar pull items from Component Registry
New Archive button (prettier than the other one)
Refactor event additions to iframe so iframe can be used for file display also
Thread List is no longer the uber root package - drafts and files moved to separate packages
WorkspaceStore now allows packages to register sheets, "view" concept replaced with "root sheet" concept, "mode" may not be observed by all sheets, and is now called "preferred mode"
Don't animate transitions between two root sheets
Mode switch is only visible on root sheets that support multiple modes
Account sidebar now shows "Views" that have registered themselves: drafts and files for now
Model Selection Bar is now a component, just like ModelList. Meant to be in the toolbar above a Model List
Misc supporting changes
New files package which registers it's views and components
Rename files package to `file-list`
Move checkmark column down into model list
Don't throw exception if shift-down arrow and nothing selected
Takes a long time on login to fetch first page of threads, make pages smaller
Displaynames, spec fixes
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1412
2015-04-11 05:33:05 +08:00
|
|
|
# Determine the current index
|
|
|
|
index = @_view.indexOfId(focused.id)
|
2015-04-01 08:19:17 +08:00
|
|
|
return if index is -1
|
|
|
|
|
refactor(*): Thread list fixes, flexible workspace store, multiple root sheets
Summary:
Remember to remove all the event listeners added to email frame
New files tab, queryable filename, not attribute
Rename ThreadSelectionBar to RootSelectionBar to go with RootCenterComponent, make it appear for draft selection and file selection as well
Initial file list and file list store, File Location
Remove unnecessary shouldComponentUpdate
Always track whether new requests have happened since ours to prevent out of order triggers
Always scroll to the current [focused/keyboard-cursor] in lists
So goodbye to the trash tag
Only scroll to current item if focus or keyboard has moved
Show message snippet in notification if no subject line
Make the RootSelectionBar pull items from Component Registry
New Archive button (prettier than the other one)
Refactor event additions to iframe so iframe can be used for file display also
Thread List is no longer the uber root package - drafts and files moved to separate packages
WorkspaceStore now allows packages to register sheets, "view" concept replaced with "root sheet" concept, "mode" may not be observed by all sheets, and is now called "preferred mode"
Don't animate transitions between two root sheets
Mode switch is only visible on root sheets that support multiple modes
Account sidebar now shows "Views" that have registered themselves: drafts and files for now
Model Selection Bar is now a component, just like ModelList. Meant to be in the toolbar above a Model List
Misc supporting changes
New files package which registers it's views and components
Rename files package to `file-list`
Move checkmark column down into model list
Don't throw exception if shift-down arrow and nothing selected
Takes a long time on login to fetch first page of threads, make pages smaller
Displaynames, spec fixes
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1412
2015-04-11 05:33:05 +08:00
|
|
|
# Determine the next index we want to move to
|
2015-04-01 08:19:17 +08:00
|
|
|
if offset is 'auto'
|
refactor(*): Thread list fixes, flexible workspace store, multiple root sheets
Summary:
Remember to remove all the event listeners added to email frame
New files tab, queryable filename, not attribute
Rename ThreadSelectionBar to RootSelectionBar to go with RootCenterComponent, make it appear for draft selection and file selection as well
Initial file list and file list store, File Location
Remove unnecessary shouldComponentUpdate
Always track whether new requests have happened since ours to prevent out of order triggers
Always scroll to the current [focused/keyboard-cursor] in lists
So goodbye to the trash tag
Only scroll to current item if focus or keyboard has moved
Show message snippet in notification if no subject line
Make the RootSelectionBar pull items from Component Registry
New Archive button (prettier than the other one)
Refactor event additions to iframe so iframe can be used for file display also
Thread List is no longer the uber root package - drafts and files moved to separate packages
WorkspaceStore now allows packages to register sheets, "view" concept replaced with "root sheet" concept, "mode" may not be observed by all sheets, and is now called "preferred mode"
Don't animate transitions between two root sheets
Mode switch is only visible on root sheets that support multiple modes
Account sidebar now shows "Views" that have registered themselves: drafts and files for now
Model Selection Bar is now a component, just like ModelList. Meant to be in the toolbar above a Model List
Misc supporting changes
New files package which registers it's views and components
Rename files package to `file-list`
Move checkmark column down into model list
Don't throw exception if shift-down arrow and nothing selected
Takes a long time on login to fetch first page of threads, make pages smaller
Displaynames, spec fixes
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1412
2015-04-11 05:33:05 +08:00
|
|
|
if @_view.get(index - 1)?.isUnread()
|
|
|
|
offset = -1
|
|
|
|
else
|
|
|
|
offset = 1
|
2015-04-01 08:19:17 +08:00
|
|
|
|
2015-04-07 02:46:20 +08:00
|
|
|
index = Math.min(Math.max(index + offset, 0), @_view.count() - 1)
|
refactor(*): Thread list fixes, flexible workspace store, multiple root sheets
Summary:
Remember to remove all the event listeners added to email frame
New files tab, queryable filename, not attribute
Rename ThreadSelectionBar to RootSelectionBar to go with RootCenterComponent, make it appear for draft selection and file selection as well
Initial file list and file list store, File Location
Remove unnecessary shouldComponentUpdate
Always track whether new requests have happened since ours to prevent out of order triggers
Always scroll to the current [focused/keyboard-cursor] in lists
So goodbye to the trash tag
Only scroll to current item if focus or keyboard has moved
Show message snippet in notification if no subject line
Make the RootSelectionBar pull items from Component Registry
New Archive button (prettier than the other one)
Refactor event additions to iframe so iframe can be used for file display also
Thread List is no longer the uber root package - drafts and files moved to separate packages
WorkspaceStore now allows packages to register sheets, "view" concept replaced with "root sheet" concept, "mode" may not be observed by all sheets, and is now called "preferred mode"
Don't animate transitions between two root sheets
Mode switch is only visible on root sheets that support multiple modes
Account sidebar now shows "Views" that have registered themselves: drafts and files for now
Model Selection Bar is now a component, just like ModelList. Meant to be in the toolbar above a Model List
Misc supporting changes
New files package which registers it's views and components
Rename files package to `file-list`
Move checkmark column down into model list
Don't throw exception if shift-down arrow and nothing selected
Takes a long time on login to fetch first page of threads, make pages smaller
Displaynames, spec fixes
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1412
2015-04-11 05:33:05 +08:00
|
|
|
nextKeyboard = nextFocus = @_view.get(index)
|
2015-04-09 10:25:00 +08:00
|
|
|
|
|
|
|
# Archive the current thread
|
refactor(*): Thread list fixes, flexible workspace store, multiple root sheets
Summary:
Remember to remove all the event listeners added to email frame
New files tab, queryable filename, not attribute
Rename ThreadSelectionBar to RootSelectionBar to go with RootCenterComponent, make it appear for draft selection and file selection as well
Initial file list and file list store, File Location
Remove unnecessary shouldComponentUpdate
Always track whether new requests have happened since ours to prevent out of order triggers
Always scroll to the current [focused/keyboard-cursor] in lists
So goodbye to the trash tag
Only scroll to current item if focus or keyboard has moved
Show message snippet in notification if no subject line
Make the RootSelectionBar pull items from Component Registry
New Archive button (prettier than the other one)
Refactor event additions to iframe so iframe can be used for file display also
Thread List is no longer the uber root package - drafts and files moved to separate packages
WorkspaceStore now allows packages to register sheets, "view" concept replaced with "root sheet" concept, "mode" may not be observed by all sheets, and is now called "preferred mode"
Don't animate transitions between two root sheets
Mode switch is only visible on root sheets that support multiple modes
Account sidebar now shows "Views" that have registered themselves: drafts and files for now
Model Selection Bar is now a component, just like ModelList. Meant to be in the toolbar above a Model List
Misc supporting changes
New files package which registers it's views and components
Rename files package to `file-list`
Move checkmark column down into model list
Don't throw exception if shift-down arrow and nothing selected
Takes a long time on login to fetch first page of threads, make pages smaller
Displaynames, spec fixes
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1412
2015-04-11 05:33:05 +08:00
|
|
|
task = new AddRemoveTagsTask(focused, ['archive'], ['inbox'])
|
2015-04-09 10:25:00 +08:00
|
|
|
Actions.queueTask(task)
|
2015-04-01 08:19:17 +08:00
|
|
|
|
refactor(*): Thread list fixes, flexible workspace store, multiple root sheets
Summary:
Remember to remove all the event listeners added to email frame
New files tab, queryable filename, not attribute
Rename ThreadSelectionBar to RootSelectionBar to go with RootCenterComponent, make it appear for draft selection and file selection as well
Initial file list and file list store, File Location
Remove unnecessary shouldComponentUpdate
Always track whether new requests have happened since ours to prevent out of order triggers
Always scroll to the current [focused/keyboard-cursor] in lists
So goodbye to the trash tag
Only scroll to current item if focus or keyboard has moved
Show message snippet in notification if no subject line
Make the RootSelectionBar pull items from Component Registry
New Archive button (prettier than the other one)
Refactor event additions to iframe so iframe can be used for file display also
Thread List is no longer the uber root package - drafts and files moved to separate packages
WorkspaceStore now allows packages to register sheets, "view" concept replaced with "root sheet" concept, "mode" may not be observed by all sheets, and is now called "preferred mode"
Don't animate transitions between two root sheets
Mode switch is only visible on root sheets that support multiple modes
Account sidebar now shows "Views" that have registered themselves: drafts and files for now
Model Selection Bar is now a component, just like ModelList. Meant to be in the toolbar above a Model List
Misc supporting changes
New files package which registers it's views and components
Rename files package to `file-list`
Move checkmark column down into model list
Don't throw exception if shift-down arrow and nothing selected
Takes a long time on login to fetch first page of threads, make pages smaller
Displaynames, spec fixes
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1412
2015-04-11 05:33:05 +08:00
|
|
|
# Remove the current thread from selection
|
|
|
|
@_view.selection.remove(focused)
|
|
|
|
|
|
|
|
# If the user is in list mode and archived without specifically saying
|
|
|
|
# "archive and next" or "archive and prev", return to the thread list
|
|
|
|
# instead of focusing on the next message.
|
|
|
|
if layoutMode is 'list' and not explicitOffset
|
|
|
|
nextFocus = null
|
|
|
|
|
2015-04-09 10:25:00 +08:00
|
|
|
@_afterViewUpdate.push ->
|
2015-06-12 09:00:40 +08:00
|
|
|
Actions.setFocus(collection: 'thread', item: nextFocus)
|
|
|
|
Actions.setCursorPosition(collection: 'thread', item: nextKeyboard)
|
2015-04-01 08:19:17 +08:00
|
|
|
|
2015-04-09 10:25:00 +08:00
|
|
|
_autofocusForLayoutMode: ->
|
2015-06-12 09:00:40 +08:00
|
|
|
layoutMode = WorkspaceStore.layoutMode()
|
|
|
|
focused = FocusedContentStore.focused('thread')
|
|
|
|
if layoutMode is 'split' and not focused and @_view.selection.count() is 0
|
|
|
|
item = @_view.get(0)
|
|
|
|
_.defer =>
|
|
|
|
Actions.setFocus({collection: 'thread', item: item})
|