Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 476ab50

Browse files
committed
Review feedback
1 parent 62a5576 commit 476ab50

File tree

3 files changed

+7
-21
lines changed

3 files changed

+7
-21
lines changed

assets/javascripts/discourse/components/ai-bot-sidebar-new-conversation.gjs

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,19 @@ export default class AiBotSidebarNewConversation extends Component {
1212
return this.sidebarState.isCurrentPanel(AI_CONVERSATIONS_PANEL);
1313
}
1414

15-
get disabled() {
16-
return this.router.currentRouteName === "discourse-ai-bot-conversations";
17-
}
18-
19-
get label() {
20-
return this.disabled
21-
? "discourse_ai.ai_bot.conversations.enter_question"
22-
: "discourse_ai.ai_bot.conversations.new";
23-
}
24-
25-
get icon() {
26-
return this.disabled ? "keyboard" : "plus";
27-
}
28-
2915
@action
3016
routeTo() {
31-
this.router.transitionTo("/discourse-ai/ai-bot/conversations");
17+
if (this.router.currentRouteName !== "discourse-ai-bot-conversations") {
18+
this.router.transitionTo("/discourse-ai/ai-bot/conversations");
19+
}
3220
this.args.outletArgs?.toggleNavigationMenu?.();
3321
}
3422

3523
<template>
3624
{{#if this.shouldRender}}
3725
<DButton
38-
@label={{this.label}}
39-
@icon={{this.icon}}
40-
@disabled={{this.disabled}}
26+
@label="discourse_ai.ai_bot.conversations.new"
27+
@icon="plus"
4128
@action={{this.routeTo}}
4229
class="ai-new-question-button btn-default"
4330
/>

config/locales/client.en.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,6 @@ en:
726726
disclaimer: "Generative AI can make mistakes. Verify important information."
727727
placeholder: "Ask a question..."
728728
new: "New Question"
729-
enter_question: "Enter Question"
730729
min_input_length_message: "Message must be longer than 10 characters"
731730
messages_sidebar_title: "Conversations"
732731
today: "Today"

spec/system/ai_bot/homepage_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@
208208
)
209209
end
210210

211-
it "displays 'enter question' button on conversations homepage" do
211+
it "displays 'new question' button on the topic page" do
212212
ai_pm_homepage.visit
213213
expect(sidebar).to have_css(
214214
"button.ai-new-question-button",
215-
text: I18n.t("js.discourse_ai.ai_bot.conversations.enter_question"),
215+
text: I18n.t("js.discourse_ai.ai_bot.conversations.new"),
216216
)
217217
end
218218

0 commit comments

Comments
 (0)