diff --git a/assets/javascripts/discourse/connectors/full-page-search-below-search-header/semantic-search.gjs b/assets/javascripts/discourse/connectors/full-page-search-below-search-header/semantic-search.gjs index 06c04632..b4787004 100644 --- a/assets/javascripts/discourse/connectors/full-page-search-below-search-header/semantic-search.gjs +++ b/assets/javascripts/discourse/connectors/full-page-search-below-search-header/semantic-search.gjs @@ -112,7 +112,11 @@ export default class SemanticSearch extends Component { @action toggleAIResults() { - document.body.classList.toggle("showing-ai-results"); + if (this.showingAIResults) { + this.args.outletArgs.addSearchResults([], "topic_id"); + } else { + this.args.outletArgs.addSearchResults(this.AIResults, "topic_id"); + } this.showingAIResults = !this.showingAIResults; } @@ -120,7 +124,6 @@ export default class SemanticSearch extends Component { resetAIResults() { this.AIResults = []; this.showingAIResults = false; - document.body.classList.remove("showing-ai-results"); } @action @@ -149,7 +152,6 @@ export default class SemanticSearch extends Component { post.generatedByAI = true; }); - this.args.outletArgs.addSearchResults(model.posts, "topic_id"); this.AIResults = model.posts; }) .catch(popupAjaxError) diff --git a/assets/stylesheets/modules/embeddings/common/semantic-search.scss b/assets/stylesheets/modules/embeddings/common/semantic-search.scss index dcb04a1b..3ba771de 100644 --- a/assets/stylesheets/modules/embeddings/common/semantic-search.scss +++ b/assets/stylesheets/modules/embeddings/common/semantic-search.scss @@ -61,7 +61,6 @@ } .ai-result { - display: none; border-radius: var(--d-border-radius); .ai-result__icon { @@ -73,9 +72,3 @@ } } } - -.showing-ai-results { - .ai-result { - display: flex; - } -}