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

Commit 4ce8973

Browse files
PERF: Optimize .ai-debug-modal__tokens selector (#1390)
This is showing as the most expensive CSS selector in Discourse at the moment. Adding specific classes and dropping the general `span` selector will make this much cheaper.
1 parent 34c98de commit 4ce8973

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

assets/javascripts/discourse/components/modal/debug-ai-modal.gjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ export default class DebugAiModal extends Component {
144144
>{{i18n "discourse_ai.ai_bot.debug_ai_modal.response"}}</a></li>
145145
</ul>
146146
<div class="ai-debug-modal__tokens">
147-
<span>
147+
<span class="ai-debug-modal__tokens__count">
148148
{{i18n "discourse_ai.ai_bot.debug_ai_modal.request_tokens"}}
149149
{{this.info.request_tokens}}
150150
</span>
151-
<span>
151+
<span class="ai-debug-modal__tokens__count">
152152
{{i18n "discourse_ai.ai_bot.debug_ai_modal.response_tokens"}}
153153
{{this.info.response_tokens}}
154154
</span>

assets/stylesheets/modules/ai-bot/common/bot-replies.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ span.onebox-ai-llm-title {
139139
}
140140
}
141141

142-
.ai-debug-modal__tokens span {
142+
.ai-debug-modal__tokens__count {
143143
display: block;
144144
}
145145

0 commit comments

Comments
 (0)