FIX: more consistent composer focus and replying indicator (#22443)

This commit is contained in:
Joffrey JAFFEUX 2023-07-05 22:24:53 +02:00 committed by GitHub
parent 2ce9364c08
commit 972e0f74ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 6 deletions

View File

@ -132,6 +132,8 @@ export default class ChatLivePane extends Component {
this.resetComposerMessage(); this.resetComposerMessage();
} }
this.composer.focus();
this.loadMessages(); this.loadMessages();
} }

View File

@ -65,7 +65,6 @@
{{on "focusin" (fn this.computeIsFocused true)}} {{on "focusin" (fn this.computeIsFocused true)}}
{{on "focusout" (fn this.computeIsFocused false)}} {{on "focusout" (fn this.computeIsFocused false)}}
{{did-insert this.setupAutocomplete}} {{did-insert this.setupAutocomplete}}
{{did-insert this.composer.focus}}
data-chat-composer-context={{this.context}} data-chat-composer-context={{this.context}}
/> />
</div> </div>

View File

@ -44,10 +44,6 @@ export default class ChatComposer extends Component {
@tracked inProgressUploadsCount = 0; @tracked inProgressUploadsCount = 0;
@tracked presenceChannelName; @tracked presenceChannelName;
get shouldRenderReplyingIndicator() {
return this.args.channel;
}
get shouldRenderMessageDetails() { get shouldRenderMessageDetails() {
return ( return (
this.currentMessage?.editing || this.currentMessage?.editing ||

View File

@ -45,6 +45,7 @@ export default class ChatThreadPanel extends Component {
@action @action
didUpdateThread() { didUpdateThread() {
this.subscribeToUpdates(); this.subscribeToUpdates();
this.chatThreadComposer.focus();
this.loadMessages(); this.loadMessages();
this.resetComposerMessage(); this.resetComposerMessage();
} }

View File

@ -14,6 +14,10 @@ export default class ChatComposerChannel extends ChatComposer {
composerId = "channel-composer"; composerId = "channel-composer";
get shouldRenderReplyingIndicator() {
return this.args.channel;
}
get presenceChannelName() { get presenceChannelName() {
const channel = this.args.channel; const channel = this.args.channel;
return `/chat-reply/${channel.id}`; return `/chat-reply/${channel.id}`;

View File

@ -18,6 +18,10 @@ export default class ChatComposerThread extends ChatComposer {
this.composer.reset(this.args.thread); this.composer.reset(this.args.thread);
} }
get shouldRenderReplyingIndicator() {
return this.args.thread;
}
get disabled() { get disabled() {
return ( return (
!this.chat.userCanInteractWithChat || !this.chat.userCanInteractWithChat ||

View File

@ -15,7 +15,7 @@ export default class ChatChannelComposer extends Service {
@action @action
focus(options = {}) { focus(options = {}) {
this.textarea.focus(options); this.textarea?.focus(options);
} }
@action @action