2015-05-20 07:06:59 +08:00
|
|
|
_ = require 'underscore'
|
2015-03-10 09:25:53 +08:00
|
|
|
React = require 'react'
|
2015-04-25 02:33:10 +08:00
|
|
|
classNames = require 'classnames'
|
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
|
|
|
{ListTabular, MultiselectList, RetinaImg} = require 'nylas-component-kit'
|
2015-03-10 09:25:53 +08:00
|
|
|
{timestamp, subject} = require './formatting-utils'
|
2015-03-26 02:17:57 +08:00
|
|
|
{Actions,
|
2015-03-26 03:41:48 +08:00
|
|
|
Utils,
|
2015-04-07 02:46:20 +08:00
|
|
|
Thread,
|
2015-03-26 02:17:57 +08:00
|
|
|
WorkspaceStore,
|
2015-05-15 08:08:30 +08:00
|
|
|
NamespaceStore} = require 'nylas-exports'
|
2015-03-26 03:41:48 +08:00
|
|
|
|
|
|
|
ThreadListParticipants = require './thread-list-participants'
|
2015-06-12 09:38:57 +08:00
|
|
|
ThreadListQuickActions = require './thread-list-quick-actions'
|
2015-04-09 10:25:00 +08:00
|
|
|
ThreadListStore = require './thread-list-store'
|
2015-06-09 08:02:50 +08:00
|
|
|
ThreadListIcon = require './thread-list-icon'
|
2015-03-10 09:25:53 +08:00
|
|
|
|
2015-06-18 04:14:45 +08:00
|
|
|
EmptyState = require './empty-state'
|
|
|
|
|
2015-06-06 02:50:55 +08:00
|
|
|
class ThreadListScrollTooltip extends React.Component
|
|
|
|
@displayName: 'ThreadListScrollTooltip'
|
|
|
|
@propTypes:
|
|
|
|
viewportCenter: React.PropTypes.number.isRequired
|
|
|
|
totalHeight: React.PropTypes.number.isRequired
|
|
|
|
|
|
|
|
componentWillMount: =>
|
|
|
|
@setupForProps(@props)
|
|
|
|
|
|
|
|
componentWillReceiveProps: (newProps) =>
|
|
|
|
@setupForProps(newProps)
|
|
|
|
|
|
|
|
shouldComponentUpdate: (newProps, newState) =>
|
|
|
|
@state?.idx isnt newState.idx
|
|
|
|
|
|
|
|
setupForProps: (props) ->
|
|
|
|
idx = Math.floor(ThreadListStore.view().count() / @props.totalHeight * @props.viewportCenter)
|
|
|
|
@setState
|
|
|
|
idx: idx
|
|
|
|
item: ThreadListStore.view().get(idx)
|
|
|
|
|
|
|
|
render: ->
|
perf(thread-list): Tailored SQLite indexes, ListTabular / ScrollRegion optimizations galore
Summary:
Allow Database models to create indexes, but don't autocreate bad ones
fix minor bug in error-reporter
Fix index on message list to make thread list lookups use proper index
Developer bar ignores state changes unless it's open
DatabaseView now asks for metadata for a set of items rather than calling a function for every item. Promise.props was cute but we really needed to make a single database query for all message metadata.
New "in" matcher so you can say `thread_id IN (1,2,3)`
Add .scroll-region-content-inner which is larger than the viewport by 1 page size, and uses transform(0,0,0) trick
ScrollRegion exposes `onScrollEnd` so listTabular, et al don't need to re-implement it with more timers. Also removing requestAnimationFrame which was causing us to request scrollTop when it was not ready, and caching the values of...
...clientHeight/scrollHeight while scrolling is in-flight
Updating rendered content 10 rows at a time (RangeChunkSize) was a bad idea. Instead, add every row in a render: pass as it comes in (less work all the time vs more work intermittently). Also remove bad requestAnimationFrame, and prevent calls to...
...updateRangeState from triggering additional calls to updateRangeState by removing `componentDidUpdate => updateRangeState `
Turning off hover (pointer-events:none) is now standard in ScrollRegion
Loading text in the scroll tooltip, instead of random date shown
Handle query parse errors by catching error and throwing a better more explanatory error
Replace "quick action" retina images with background images to make React render easier
Replace hasTagId with a faster implementation which doesn't call functions and doesn't build a temporary array
Print query durations when printing to console instead of only in metadata
Remove headers from support from ListTabular, we'll never use it
Making columns part of state was a good idea but changing the array causes the entire ListTabular to re-render. To avoid this, be smarter about updating columns. This logic could potentially go in `componentDidReceiveProps` too.
Fix specs and add 6 more for new database store functionality
Test Plan: Run 6 new specs. More in the works?
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1651
2015-06-18 11:12:48 +08:00
|
|
|
if @state.item
|
|
|
|
content = timestamp(@state.item.lastMessageTimestamp)
|
|
|
|
else
|
|
|
|
content = "Loading..."
|
2015-06-06 02:50:55 +08:00
|
|
|
<div className="scroll-tooltip">
|
perf(thread-list): Tailored SQLite indexes, ListTabular / ScrollRegion optimizations galore
Summary:
Allow Database models to create indexes, but don't autocreate bad ones
fix minor bug in error-reporter
Fix index on message list to make thread list lookups use proper index
Developer bar ignores state changes unless it's open
DatabaseView now asks for metadata for a set of items rather than calling a function for every item. Promise.props was cute but we really needed to make a single database query for all message metadata.
New "in" matcher so you can say `thread_id IN (1,2,3)`
Add .scroll-region-content-inner which is larger than the viewport by 1 page size, and uses transform(0,0,0) trick
ScrollRegion exposes `onScrollEnd` so listTabular, et al don't need to re-implement it with more timers. Also removing requestAnimationFrame which was causing us to request scrollTop when it was not ready, and caching the values of...
...clientHeight/scrollHeight while scrolling is in-flight
Updating rendered content 10 rows at a time (RangeChunkSize) was a bad idea. Instead, add every row in a render: pass as it comes in (less work all the time vs more work intermittently). Also remove bad requestAnimationFrame, and prevent calls to...
...updateRangeState from triggering additional calls to updateRangeState by removing `componentDidUpdate => updateRangeState `
Turning off hover (pointer-events:none) is now standard in ScrollRegion
Loading text in the scroll tooltip, instead of random date shown
Handle query parse errors by catching error and throwing a better more explanatory error
Replace "quick action" retina images with background images to make React render easier
Replace hasTagId with a faster implementation which doesn't call functions and doesn't build a temporary array
Print query durations when printing to console instead of only in metadata
Remove headers from support from ListTabular, we'll never use it
Making columns part of state was a good idea but changing the array causes the entire ListTabular to re-render. To avoid this, be smarter about updating columns. This logic could potentially go in `componentDidReceiveProps` too.
Fix specs and add 6 more for new database store functionality
Test Plan: Run 6 new specs. More in the works?
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1651
2015-06-18 11:12:48 +08:00
|
|
|
{content}
|
2015-06-06 02:50:55 +08:00
|
|
|
</div>
|
|
|
|
|
2015-05-01 04:08:29 +08:00
|
|
|
class ThreadList extends React.Component
|
|
|
|
@displayName: 'ThreadList'
|
2015-05-09 10:55:32 +08:00
|
|
|
|
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
|
|
|
@containerRequired: false
|
2015-03-10 09:25:53 +08:00
|
|
|
|
2015-06-12 09:00:40 +08:00
|
|
|
constructor: (@props) ->
|
|
|
|
@state =
|
|
|
|
style: 'unknown'
|
|
|
|
|
2015-05-01 04:08:29 +08:00
|
|
|
componentWillMount: =>
|
2015-03-10 09:25:53 +08:00
|
|
|
labelComponents = (thread) =>
|
|
|
|
for label in @state.threadLabelComponents
|
|
|
|
LabelComponent = label.view
|
|
|
|
<LabelComponent thread={thread} />
|
|
|
|
|
2015-03-26 03:41:48 +08:00
|
|
|
c1 = new ListTabular.Column
|
2015-03-10 09:25:53 +08:00
|
|
|
name: "★"
|
2015-05-01 04:08:29 +08:00
|
|
|
resolver: (thread) =>
|
2015-06-09 08:02:50 +08:00
|
|
|
<ThreadListIcon thread={thread} />
|
2015-03-10 09:25:53 +08:00
|
|
|
|
2015-03-26 03:41:48 +08:00
|
|
|
c2 = new ListTabular.Column
|
2015-03-10 09:25:53 +08:00
|
|
|
name: "Name"
|
2015-03-26 09:22:52 +08:00
|
|
|
width: 200
|
2015-05-01 04:08:29 +08:00
|
|
|
resolver: (thread) =>
|
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
|
|
|
hasDraft = _.find (thread.metadata ? []), (m) -> m.draft
|
|
|
|
if hasDraft
|
|
|
|
<div style={display: 'flex'}>
|
|
|
|
<ThreadListParticipants thread={thread} />
|
2015-06-06 02:40:44 +08:00
|
|
|
<RetinaImg name="icon-draft-pencil.png"
|
|
|
|
className="draft-icon"
|
|
|
|
mode={RetinaImg.Mode.ContentPreserve} />
|
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
|
|
|
</div>
|
|
|
|
else
|
|
|
|
<ThreadListParticipants thread={thread} />
|
2015-03-10 09:25:53 +08:00
|
|
|
|
|
|
|
c3 = new ListTabular.Column
|
2015-03-26 03:41:48 +08:00
|
|
|
name: "Message"
|
2015-03-10 09:25:53 +08:00
|
|
|
flex: 4
|
2015-05-01 04:08:29 +08:00
|
|
|
resolver: (thread) =>
|
2015-03-26 03:41:48 +08:00
|
|
|
attachments = []
|
|
|
|
if thread.hasTagId('attachment')
|
|
|
|
attachments = <div className="thread-icon thread-icon-attachment"></div>
|
|
|
|
<span className="details">
|
|
|
|
<span className="subject">{subject(thread.subject)}</span>
|
|
|
|
<span className="snippet">{thread.snippet}</span>
|
|
|
|
{attachments}
|
|
|
|
</span>
|
2015-03-10 09:25:53 +08:00
|
|
|
|
|
|
|
c4 = new ListTabular.Column
|
|
|
|
name: "Date"
|
2015-05-01 04:08:29 +08:00
|
|
|
resolver: (thread) =>
|
2015-03-10 09:25:53 +08:00
|
|
|
<span className="timestamp">{timestamp(thread.lastMessageTimestamp)}</span>
|
|
|
|
|
2015-06-12 09:38:57 +08:00
|
|
|
c5 = new ListTabular.Column
|
|
|
|
name: "HoverActions"
|
|
|
|
resolver: (thread) =>
|
|
|
|
<ThreadListQuickActions thread={thread}/>
|
|
|
|
|
|
|
|
@wideColumns = [c1, c2, c3, c4, c5]
|
2015-06-12 09:00:40 +08:00
|
|
|
|
|
|
|
cNarrow = new ListTabular.Column
|
|
|
|
name: "Item"
|
2015-06-18 13:38:55 +08:00
|
|
|
flex: 1
|
2015-06-12 09:00:40 +08:00
|
|
|
resolver: (thread) =>
|
|
|
|
pencil = []
|
|
|
|
hasDraft = _.find (thread.metadata ? []), (m) -> m.draft
|
|
|
|
if hasDraft
|
|
|
|
pencil = <RetinaImg name="icon-draft-pencil.png" className="draft-icon" mode={RetinaImg.Mode.ContentPreserve} />
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<div style={display: 'flex'}>
|
|
|
|
<ThreadListIcon thread={thread} />
|
|
|
|
<ThreadListParticipants thread={thread} />
|
|
|
|
<span className="timestamp">{timestamp(thread.lastMessageTimestamp)}</span>
|
|
|
|
{pencil}
|
|
|
|
</div>
|
|
|
|
<div className="subject">{subject(thread.subject)}</div>
|
|
|
|
<div className="snippet">{thread.snippet}</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@narrowColumns = [cNarrow]
|
|
|
|
|
2015-04-09 10:25:00 +08:00
|
|
|
@commands =
|
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
|
|
|
'core:remove-item': @_onArchive
|
2015-04-09 10:25:00 +08:00
|
|
|
'core:remove-and-previous': -> Actions.archiveAndPrevious()
|
|
|
|
'core:remove-and-next': -> Actions.archiveAndNext()
|
|
|
|
'application:reply': @_onReply
|
|
|
|
'application:reply-all': @_onReplyAll
|
|
|
|
'application:forward': @_onForward
|
2015-06-18 04:14:45 +08:00
|
|
|
|
2015-04-23 07:41:29 +08:00
|
|
|
@itemPropsProvider = (item) ->
|
2015-04-25 02:33:10 +08:00
|
|
|
className: classNames
|
2015-04-09 10:25:00 +08:00
|
|
|
'unread': item.isUnread()
|
|
|
|
|
2015-06-12 09:00:40 +08:00
|
|
|
componentDidMount: =>
|
|
|
|
window.addEventListener('resize', @_onResize, true)
|
|
|
|
@_onResize()
|
|
|
|
|
|
|
|
componentWillUnmount: =>
|
|
|
|
window.removeEventListener('resize', @_onResize)
|
|
|
|
|
2015-05-01 04:08:29 +08:00
|
|
|
render: =>
|
2015-06-12 09:00:40 +08:00
|
|
|
if @state.style is 'wide'
|
|
|
|
<MultiselectList
|
|
|
|
dataStore={ThreadListStore}
|
|
|
|
columns={@wideColumns}
|
|
|
|
commands={@commands}
|
|
|
|
itemPropsProvider={@itemPropsProvider}
|
|
|
|
itemHeight={39}
|
|
|
|
className="thread-list"
|
|
|
|
scrollTooltipComponent={ThreadListScrollTooltip}
|
2015-06-18 04:14:45 +08:00
|
|
|
emptyComponent={EmptyState}
|
2015-06-12 09:00:40 +08:00
|
|
|
collection="thread" />
|
|
|
|
else if @state.style is 'narrow'
|
|
|
|
<MultiselectList
|
|
|
|
dataStore={ThreadListStore}
|
|
|
|
columns={@narrowColumns}
|
|
|
|
commands={@commands}
|
|
|
|
itemPropsProvider={@itemPropsProvider}
|
|
|
|
itemHeight={90}
|
|
|
|
className="thread-list thread-list-narrow"
|
|
|
|
scrollTooltipComponent={ThreadListScrollTooltip}
|
2015-06-18 04:14:45 +08:00
|
|
|
emptyComponent={EmptyState}
|
2015-06-12 09:00:40 +08:00
|
|
|
collection="thread" />
|
|
|
|
else
|
|
|
|
<div></div>
|
|
|
|
|
|
|
|
_onResize: (event) =>
|
|
|
|
current = @state.style
|
|
|
|
desired = if React.findDOMNode(@).offsetWidth < 540 then 'narrow' else 'wide'
|
|
|
|
if current isnt desired
|
|
|
|
@setState(style: desired)
|
2015-03-10 09:25:53 +08:00
|
|
|
|
2015-04-09 10:25:00 +08:00
|
|
|
# Additional Commands
|
2015-03-21 01:23:50 +08:00
|
|
|
|
2015-05-01 04:08:29 +08:00
|
|
|
_onArchive: =>
|
2015-06-20 07:07:24 +08:00
|
|
|
if ThreadListStore.view().selection.count() is 0
|
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
|
|
|
Actions.archive()
|
|
|
|
else
|
|
|
|
Actions.archiveSelection()
|
|
|
|
|
2015-05-01 04:08:29 +08:00
|
|
|
_onReply: ({focusedId}) =>
|
2015-04-09 10:25:00 +08:00
|
|
|
return unless focusedId? and @_viewingFocusedThread()
|
|
|
|
Actions.composeReply(threadId: focusedId)
|
2015-03-10 09:25:53 +08:00
|
|
|
|
2015-05-01 04:08:29 +08:00
|
|
|
_onReplyAll: ({focusedId}) =>
|
2015-04-09 10:25:00 +08:00
|
|
|
return unless focusedId? and @_viewingFocusedThread()
|
|
|
|
Actions.composeReplyAll(threadId: focusedId)
|
2015-03-10 09:25:53 +08:00
|
|
|
|
2015-05-01 04:08:29 +08:00
|
|
|
_onForward: ({focusedId}) =>
|
2015-04-09 10:25:00 +08:00
|
|
|
return unless focusedId? and @_viewingFocusedThread()
|
|
|
|
Actions.composeForward(threadId: focusedId)
|
2015-03-10 09:25:53 +08:00
|
|
|
|
2015-04-09 10:25:00 +08:00
|
|
|
# Helpers
|
2015-03-26 02:17:57 +08:00
|
|
|
|
2015-05-01 04:08:29 +08:00
|
|
|
_viewingFocusedThread: =>
|
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 WorkspaceStore.layoutMode() is "list"
|
|
|
|
WorkspaceStore.topSheet() is WorkspaceStore.Sheet.Thread
|
2015-04-01 08:19:17 +08:00
|
|
|
else
|
|
|
|
true
|
2015-05-01 04:08:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
module.exports = ThreadList
|