From fe37dd2953d8312cdecfb7de513903e32c73dc71 Mon Sep 17 00:00:00 2001 From: rngus2344 Date: Wed, 28 May 2025 13:13:20 -0500 Subject: [PATCH 1/2] DEV: Add appEvents trigger for AI New Question button --- .../discourse/components/ai-bot-sidebar-new-conversation.gjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assets/javascripts/discourse/components/ai-bot-sidebar-new-conversation.gjs b/assets/javascripts/discourse/components/ai-bot-sidebar-new-conversation.gjs index 6f2131929..f9b56386b 100644 --- a/assets/javascripts/discourse/components/ai-bot-sidebar-new-conversation.gjs +++ b/assets/javascripts/discourse/components/ai-bot-sidebar-new-conversation.gjs @@ -5,6 +5,7 @@ import DButton from "discourse/components/d-button"; import { AI_CONVERSATIONS_PANEL } from "../services/ai-conversations-sidebar-manager"; export default class AiBotSidebarNewConversation extends Component { + @service appEvents; @service router; @service sidebarState; @@ -14,6 +15,8 @@ export default class AiBotSidebarNewConversation extends Component { @action routeTo() { + this.appEvents.trigger("discourse-ai:ai-bot-new-conversation"); + if (this.router.currentRouteName !== "discourse-ai-bot-conversations") { this.router.transitionTo("/discourse-ai/ai-bot/conversations"); } From 46375e6387233f31259114e3e53c50512c361fb7 Mon Sep 17 00:00:00 2001 From: rngus2344 Date: Wed, 28 May 2025 13:18:16 -0500 Subject: [PATCH 2/2] appEvent name update --- .../discourse/components/ai-bot-sidebar-new-conversation.gjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/javascripts/discourse/components/ai-bot-sidebar-new-conversation.gjs b/assets/javascripts/discourse/components/ai-bot-sidebar-new-conversation.gjs index f9b56386b..3af91803f 100644 --- a/assets/javascripts/discourse/components/ai-bot-sidebar-new-conversation.gjs +++ b/assets/javascripts/discourse/components/ai-bot-sidebar-new-conversation.gjs @@ -15,7 +15,7 @@ export default class AiBotSidebarNewConversation extends Component { @action routeTo() { - this.appEvents.trigger("discourse-ai:ai-bot-new-conversation"); + this.appEvents.trigger("discourse-ai:new-conversation-btn-clicked"); if (this.router.currentRouteName !== "discourse-ai-bot-conversations") { this.router.transitionTo("/discourse-ai/ai-bot/conversations");