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

Commit 37b6461

Browse files
authored
FIX: Make sure that topic gists are displayed ONLY on the hot list. (#873)
1 parent 820b506 commit 37b6461

File tree

4 files changed

+38
-15
lines changed

4 files changed

+38
-15
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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 (
9+
this.router.currentRoute.attributes?.filterType === "hot" &&
10+
this.args.topic?.ai_topic_gist &&
11+
!this.args.topic?.excerpt
12+
);
13+
}
14+
15+
<template>
16+
{{#if this.showGist}}
17+
<div class="ai-topic-gist">
18+
<div class="ai-topic-gist__text">
19+
{{@topic.ai_topic_gist}}
20+
</div>
21+
</div>
22+
{{/if}}
23+
</template>
24+
}
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
@@ -354,6 +354,7 @@ discourse_ai:
354354
hidden: true
355355
ai_summarization_enabled:
356356
default: false
357+
client: true
357358
validator: "DiscourseAi::Configuration::LlmDependencyValidator"
358359
ai_summarization_model:
359360
default: ""

0 commit comments

Comments
 (0)