mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
This commit contains multiple changes to improve the composer behavior especially in the context of a thread: - Generally rename anything of the form `chatChannelThread...` to `chatThread...`` - Moves the textarea interactor instance inside the composer server - Improves the focus state and closing of panel related to the use of the Escape shortcut - Creates `Chat::ThreadList` as a component instead of having `Chat::Thread::ListItem` and others which could imply they were children of a the `Chat::Thread` component
61 lines
1.7 KiB
Handlebars
61 lines
1.7 KiB
Handlebars
<div
|
|
class={{concat-class
|
|
"chat-thread"
|
|
(if this.loading "loading")
|
|
(if @thread.staged "staged")
|
|
}}
|
|
data-id={{@thread.id}}
|
|
{{did-insert this.setUploadDropZone}}
|
|
{{did-insert this.didUpdateThread}}
|
|
{{did-update this.didUpdateThread @thread.id}}
|
|
{{will-destroy this.unsubscribeFromUpdates}}
|
|
>
|
|
{{#if @includeHeader}}
|
|
<Chat::Thread::Header @channel={{@thread.channel}} @thread={{@thread}} />
|
|
{{/if}}
|
|
|
|
<div
|
|
class="chat-thread__body popper-viewport"
|
|
{{did-insert this.setScrollable}}
|
|
{{on "scroll" this.computeScrollState passive=true}}
|
|
>
|
|
<div
|
|
class="chat-thread__messages chat-messages-scroll chat-messages-container"
|
|
{{chat/on-resize this.didResizePane (hash delay=10)}}
|
|
>
|
|
{{#each @thread.messages key="id" as |message|}}
|
|
<ChatMessage
|
|
@message={{message}}
|
|
@resendStagedMessage={{this.resendStagedMessage}}
|
|
@messageDidEnterViewport={{this.messageDidEnterViewport}}
|
|
@messageDidLeaveViewport={{this.messageDidLeaveViewport}}
|
|
@context="thread"
|
|
/>
|
|
{{/each}}
|
|
{{#if this.loading}}
|
|
<ChatSkeleton />
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
|
|
{{#if this.chatThreadPane.selectingMessages}}
|
|
<ChatSelectionManager
|
|
@selectedMessageIds={{this.chatThreadPane.selectedMessageIds}}
|
|
@chatChannel={{@channel}}
|
|
@cancelSelecting={{action
|
|
this.chatThreadPane.cancelSelecting
|
|
@channel.selectedMessages
|
|
}}
|
|
@context="thread"
|
|
/>
|
|
{{else}}
|
|
<Chat::Composer::Thread
|
|
@channel={{@channel}}
|
|
@thread={{@thread}}
|
|
@onSendMessage={{this.onSendMessage}}
|
|
@uploadDropZone={{this.uploadDropZone}}
|
|
/>
|
|
{{/if}}
|
|
|
|
<ChatUploadDropZone @model={{@thread}} />
|
|
</div> |