Skip to content

A platform for community discussion. Free, open, simple.

FIX: Topic summary UI fixes. (#23085)

Roman Rizzi5bb231675695
diff --git a/app/assets/javascripts/discourse/app/components/summary-box.hbs b/app/assets/javascripts/discourse/app/components/summary-box.hbs
index 828575c1cc0..be2ddba53c9 100644
--- a/app/assets/javascripts/discourse/app/components/summary-box.hbs
+++ b/app/assets/javascripts/discourse/app/components/summary-box.hbs
@@ -11,7 +11,7 @@
{{#if this.canCollapseSummary}}
<DButton
@class="btn-primary topic-strategy-summarization"
- @action={{this.toggleSummary}}
+ @action={{this.collapseSummary}}
@title="summary.buttons.hide"
@label="summary.buttons.hide"
@icon="chevron-up"
@@ -41,7 +41,7 @@
{{#if this.showSummaryBox}}
<article class="summary-box">
- {{#if this.loadingSummary}}
+ {{#if (and this.loadingSummary (not this.summary))}}
<AiSummarySkeleton />
{{else}}
<div class="generated-summary">{{this.summary}}</div>
diff --git a/app/assets/javascripts/discourse/app/components/summary-box.js b/app/assets/javascripts/discourse/app/components/summary-box.js
index 28e59e12ef8..766262ddc4d 100644
--- a/app/assets/javascripts/discourse/app/components/summary-box.js
+++ b/app/assets/javascripts/discourse/app/components/summary-box.js
@@ -45,7 +45,6 @@ export default class SummaryBox extends Component {
if (topicSummary.summarized_text) {
cookAsync(topicSummary.summarized_text).then((cooked) => {
this.summary = cooked;
- this.loadingSummary = false;
});
}
@@ -58,6 +57,7 @@ export default class SummaryBox extends Component {
this.canRegenerate = topicSummary.outdated && topicSummary.can_regenerate;
this.canCollapseSummary = !this.canRegenerate;
+ this.loadingSummary = false;
}
}