This repository was archived by the owner on Jul 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
assets/javascripts/discourse Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { composeAiBotMessage } from "../lib/ai-bot-helper";
1010import { AI_CONVERSATIONS_PANEL } from " ../services/ai-conversations-sidebar-manager" ;
1111
1212export default class AiBotHeaderIcon extends Component {
13+ @service appEvents;
1314 @service composer;
1415 @service currentUser;
1516 @service navigationMenu;
@@ -51,6 +52,7 @@ export default class AiBotHeaderIcon extends Component {
5152 }
5253
5354 if (this .siteSettings .ai_bot_enable_dedicated_ux ) {
55+ this .appEvents .trigger (" discourse-ai:bot-header-icon-clicked" );
5456 return this .router .transitionTo (" discourse-ai-bot-conversations" );
5557 }
5658
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { ADMIN_PANEL, MAIN_PANEL } from "discourse/lib/sidebar/panels";
55export const AI_CONVERSATIONS_PANEL = "ai-conversations" ;
66
77export default class AiConversationsSidebarManager extends Service {
8+ @service appEvents ;
89 @service sidebarState ;
910
1011 @tracked newTopicForceSidebar = false ;
@@ -26,6 +27,7 @@ export default class AiConversationsSidebarManager extends Service {
2627
2728 this . sidebarState . isForcingSidebar = true ;
2829 document . body . classList . add ( "has-ai-conversations-sidebar" ) ;
30+ this . appEvents . trigger ( "discourse-ai:force-conversations-sidebar" ) ;
2931 return true ;
3032 }
3133
@@ -41,5 +43,7 @@ export default class AiConversationsSidebarManager extends Service {
4143 this . sidebarState . setPanel ( MAIN_PANEL ) ; // Return to main sidebar panel
4244 this . sidebarState . isForcingSidebar = false ;
4345 }
46+
47+ this . appEvents . trigger ( "discourse-ai:stop-forcing-conversations-sidebar" ) ;
4448 }
4549}
You can’t perform that action at this time.
0 commit comments