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

Commit 95f8032

Browse files
authored
DEV: Prevent close of summary from outside clicks (#808)
Often it is helpful to have the summary box open while composing a reply to the topic. However, the summary box currently gets closed each time you click outside the box. In this PR we add `closeOnClickOutside: false` attribute to the `DMenu` options for summary box to prevent that from occurring.
1 parent e666266 commit 95f8032

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

assets/javascripts/discourse/connectors/topic-map-expanded-after/ai-summary-box.gjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ export default class AiSummaryBox extends Component {
196196
@title={{i18n "summary.buttons.generate"}}
197197
@icon="discourse-sparkles"
198198
@triggerClass="ai-topic-summarization"
199+
@closeOnClickOutside={{false}}
199200
>
200201
<:content>
201202
<div class="ai-summary-container">

test/javascripts/acceptance/topic-summary-test.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { click, visit } from "@ember/test-helpers";
2-
import { skip } from "qunit";
2+
import { skip, test } from "qunit";
33
import topicFixtures from "discourse/tests/fixtures/topic";
44
import {
55
acceptance,
@@ -125,7 +125,7 @@ acceptance("Topic - Summary - Anon", function (needs) {
125125
});
126126
});
127127

128-
skip("displays cached summary immediately", async function (assert) {
128+
test("displays cached summary immediately", async function (assert) {
129129
await visit("/t/-/1");
130130

131131
await click(".ai-topic-summarization");
@@ -138,4 +138,11 @@ acceptance("Topic - Summary - Anon", function (needs) {
138138
.dom(".ai-summary-box .summarized-on")
139139
.exists("summary metadata exists");
140140
});
141+
142+
test("clicking outside of summary should not close the summary box", async function (assert) {
143+
await visit("/t/-/1");
144+
await click(".ai-topic-summarization");
145+
await click("#main-outlet-wrapper");
146+
assert.dom(".ai-summary-box").exists();
147+
});
141148
});

0 commit comments

Comments
 (0)