Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions assets/javascripts/discourse/components/ai-gist-disclosure.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import Component from "@glimmer/component";
import { service } from "@ember/service";
import icon from "discourse-common/helpers/d-icon";
import i18n from "discourse-common/helpers/i18n";

export default class AiGistDisclosure extends Component {
@service router;

get shouldShow() {
return this.router.currentRoute.attributes.list?.topics?.some(
(topic) => topic.ai_topic_gist
);
}

<template>
{{#if this.shouldShow}}
<span class="ai-topic-gist__disclosure">
{{icon "discourse-sparkles"}}
{{i18n "discourse_ai.summarization.disclosure"}}
</span>
{{/if}}
</template>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Component from "@glimmer/component";
import AiGistDisclosure from "../../components/ai-gist-disclosure";

export default class AiTopicGistDisclosure extends Component {
static shouldRender(outletArgs, helper) {
const isMobileView = helper.site.mobileView;
return isMobileView;
}

<template>
<AiGistDisclosure />
</template>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Component from "@glimmer/component";
import AiGistDisclosure from "../../components/ai-gist-disclosure";

export default class AiTopicGist extends Component {
static shouldRender(outletArgs) {
return (
// "default" can be removed after the glimmer topic list is rolled out
(outletArgs?.name === "default" || outletArgs?.name === "topic.title") &&
!outletArgs.bulkSelectEnabled
);
}

<template>
<AiGistDisclosure />
</template>
}
18 changes: 18 additions & 0 deletions assets/stylesheets/modules/summarization/common/ai-summary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,22 @@
color: var(--primary-medium);
}
}

&__disclosure {
font-size: var(--font-down-1);
color: var(--primary-600);
.desktop-view & {
margin-left: 0.5em;
}
.mobile-view & {
display: block;
margin-top: -0.5em;
margin-bottom: 0.5em;
}
.d-icon {
font-size: var(--font-down-1);
position: relative;
top: -0.05em; // improve vertical alignment
}
}
}
1 change: 1 addition & 0 deletions config/locales/client.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ en:
topic:
title: "Topic summary"
close: "Close summary panel"
disclosure: "Summaries generated by AI"
review:
types:
reviewable_ai_post:
Expand Down