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

Commit f7e9077

Browse files
committed
UX: no-text style being incorrectly added to tag suggester
In the tag suggester menu we use `DButton` as a wrapper element and use the `discourseTag` helper to render the text inside the element. So visually there is text content inside the button. However, since `DButton` assumes that no `label`/`translatedLabel` inside an element means `.no-text` CSS style should be applied to the button's element, it was resulting in some incorrect styling being applied to this menu. This PR resolves that by programmatically adding the tag as a `translatedLabel` and then visually hiding it with CSS.
1 parent c533634 commit f7e9077

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

assets/javascripts/discourse/components/suggestion-menus/ai-tag-suggester.gjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ export default class AiTagSuggester extends Component {
198198
data-name={{suggestion.name}}
199199
data-value={{index}}
200200
title={{suggestion.name}}
201+
@translatedLabel={{suggestion.name}}
201202
@disabled={{this.isDisabled suggestion}}
202203
@action={{fn this.applySuggestion suggestion}}
203204
>

assets/stylesheets/modules/ai-helper/common/ai-helper.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@
266266
.discourse-tag-count {
267267
margin-left: 5px;
268268
}
269+
270+
.d-button-label {
271+
display: none;
272+
}
269273
}
270274
}
271275

0 commit comments

Comments
 (0)