diff --git a/assets/javascripts/discourse/components/ai-topic-gist.gjs b/assets/javascripts/discourse/components/ai-topic-gist.gjs new file mode 100644 index 00000000..9e68e816 --- /dev/null +++ b/assets/javascripts/discourse/components/ai-topic-gist.gjs @@ -0,0 +1,24 @@ +import Component from "@glimmer/component"; +import { service } from "@ember/service"; + +export default class AiTopicGist extends Component { + @service router; + + get showGist() { + return ( + this.router.currentRoute.attributes?.filterType === "hot" && + this.args.topic?.ai_topic_gist && + !this.args.topic?.excerpt + ); + } + + +} diff --git a/assets/javascripts/discourse/connectors/topic-list-before-category/ai-topic-gist-placement.gjs b/assets/javascripts/discourse/connectors/topic-list-before-category/ai-topic-gist-placement.gjs new file mode 100644 index 00000000..70ca74aa --- /dev/null +++ b/assets/javascripts/discourse/connectors/topic-list-before-category/ai-topic-gist-placement.gjs @@ -0,0 +1,13 @@ +import Component from "@glimmer/component"; +import AiTopicGist from "../../components/ai-topic-gist"; + +export default class AiTopicGistPlacement extends Component { + static shouldRender(_outletArgs, helper) { + const settings = helper.siteSettings; + return settings.discourse_ai_enabled && settings.ai_summarization_enabled; + } + + +} diff --git a/assets/javascripts/discourse/connectors/topic-list-before-category/ai-topic-gist.gjs b/assets/javascripts/discourse/connectors/topic-list-before-category/ai-topic-gist.gjs deleted file mode 100644 index 5548f3f1..00000000 --- a/assets/javascripts/discourse/connectors/topic-list-before-category/ai-topic-gist.gjs +++ /dev/null @@ -1,15 +0,0 @@ -import Component from "@glimmer/component"; - -export default class AiTopicGist extends Component { - static shouldRender(outletArgs) { - return outletArgs?.topic?.ai_topic_gist && !outletArgs.topic.excerpt; - } - - -} diff --git a/config/settings.yml b/config/settings.yml index a3589abe..01705470 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -354,6 +354,7 @@ discourse_ai: hidden: true ai_summarization_enabled: default: false + client: true validator: "DiscourseAi::Configuration::LlmDependencyValidator" ai_summarization_model: default: ""