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

Commit 6b7d7c1

Browse files
authored
REFACTOR: Helper suggestions (#914)
This PR adds some updates to the Helper suggestions to improve it's functionality and modernize some of the codebase.
1 parent 0d3e6b2 commit 6b7d7c1

File tree

17 files changed

+709
-319
lines changed

17 files changed

+709
-319
lines changed

assets/javascripts/discourse/components/ai-split-topic-suggester.gjs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,13 @@ export default class AiSplitTopicSuggester extends Component {
5454
suggestions.includes(item.name.toLowerCase())
5555
);
5656
this.suggestions = suggestedCategories;
57-
} else {
58-
this.suggestions = result.assistant.map((s) => s.name);
57+
} else if (this.args.mode === this.SUGGESTION_TYPES.tag) {
58+
this.suggestions = result.assistant.map((s) => {
59+
return {
60+
name: s.name,
61+
count: s.count,
62+
};
63+
});
5964
}
6065
})
6166
.catch(popupAjaxError)
@@ -132,6 +137,17 @@ export default class AiSplitTopicSuggester extends Component {
132137
{{on "click" (fn this.applySuggestion suggestion menu)}}
133138
>
134139
{{categoryBadge suggestion}}
140+
<span class="topic-count">x
141+
{{suggestion.totalTopicCount}}</span>
142+
</li>
143+
{{else if (eq @mode "suggest_tags")}}
144+
<li data-name={{suggestion.name}} data-value={{index}}>
145+
<DButton
146+
@translatedLabel={{suggestion.name}}
147+
@action={{fn this.applySuggestion suggestion.name menu}}
148+
>
149+
<span class="topic-count">x{{suggestion.count}}</span>
150+
</DButton>
135151
</li>
136152
{{else}}
137153
<li data-name={{suggestion}} data-value={{index}}>

assets/javascripts/discourse/components/ai-suggestion-dropdown.gjs

Lines changed: 0 additions & 249 deletions
This file was deleted.

0 commit comments

Comments
 (0)