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

Commit dffe504

Browse files
committed
FIX: Make sure that topic gists are displayed ONLY on the hot list.
1 parent c479b17 commit dffe504

File tree

4 files changed

+36
-15
lines changed

4 files changed

+36
-15
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import Component from "@glimmer/component";
2+
import { service } from "@ember/service";
3+
4+
export default class AiTopicGist extends Component {
5+
@service router;
6+
7+
get showGist() {
8+
return this.router.currentRoute.attributes?.filterType === "hot"
9+
&& this.args.topic?.ai_topic_gist
10+
&& !this.args.topic?.excerpt;
11+
}
12+
13+
<template>
14+
{{#if this.showGist}}
15+
<div class="ai-topic-gist">
16+
<div class="ai-topic-gist__text">
17+
{{@topic.ai_topic_gist}}
18+
</div>
19+
</div>
20+
{{/if}}
21+
</template>
22+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Component from "@glimmer/component";
2+
import AiTopicGist from "../../components/ai-topic-gist";
3+
4+
export default class AiTopicGistPlacement extends Component {
5+
static shouldRender(_outletArgs, helper) {
6+
const settings = helper.siteSettings;
7+
return settings.discourse_ai_enabled && settings.ai_summarization_enabled;
8+
}
9+
10+
<template>
11+
<AiTopicGist @topic={{@outletArgs.topic}} />
12+
</template>
13+
}

assets/javascripts/discourse/connectors/topic-list-before-category/ai-topic-gist.gjs

Lines changed: 0 additions & 15 deletions
This file was deleted.

config/settings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ discourse_ai:
351351
hidden: true
352352
ai_summarization_enabled:
353353
default: false
354+
client: true
354355
validator: "DiscourseAi::Configuration::LlmDependencyValidator"
355356
ai_summarization_model:
356357
default: ""

0 commit comments

Comments
 (0)