A platform for community discussion. Free, open, simple.
UX: opens side panel early to avoid jitter (#21516)
Joffrey JAFFEUXc8eb1a275ccc
diff --git a/plugins/chat/assets/javascripts/discourse/routes/chat-channel-thread.js b/plugins/chat/assets/javascripts/discourse/routes/chat-channel-thread.jsindex 362c385417e..2d0afb11038 100644--- a/plugins/chat/assets/javascripts/discourse/routes/chat-channel-thread.js+++ b/plugins/chat/assets/javascripts/discourse/routes/chat-channel-thread.js@@ -59,5 +59,7 @@ export default class ChatChannelThread extends DiscourseRoute {return;}}++ this.chatStateManager.openSidePanel();}}diff --git a/plugins/chat/assets/javascripts/discourse/routes/chat-channel-threads.js b/plugins/chat/assets/javascripts/discourse/routes/chat-channel-threads.jsindex aca770abcd2..7f742b9cc38 100644--- a/plugins/chat/assets/javascripts/discourse/routes/chat-channel-threads.js+++ b/plugins/chat/assets/javascripts/discourse/routes/chat-channel-threads.js@@ -1,9 +1,11 @@import DiscourseRoute from "discourse/routes/discourse";import { inject as service } from "@ember/service";import { action } from "@ember/object";+export default class ChatChannelThreads extends DiscourseRoute {@service router;@service chatChannelThreadListPane;+ @service chatStateManager;beforeModel(transition) {const channel = this.modelFor("chat.channel");@@ -13,11 +15,15 @@ export default class ChatChannelThreads extends DiscourseRoute {this.router.transitionTo("chat.channel", ...channel.routeModels);return;}++ this.chatStateManager.openSidePanel();}@action- willTransition() {- this.chatChannelThreadListPane.close();+ willTransition(transition) {+ if (transition.targetName !== "chat.channel.thread") {+ this.chatChannelThreadListPane.close();+ }}activate() {