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.
This commit is contained in:
David Taylor 2025-05-30 21:47:30 +01:00 committed by GitHub
parent 34c98de864
commit 4ce8973e56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -144,11 +144,11 @@ export default class DebugAiModal extends Component {
>{{i18n "discourse_ai.ai_bot.debug_ai_modal.response"}}</a></li>
</ul>
<div class="ai-debug-modal__tokens">
<span>
<span class="ai-debug-modal__tokens__count">
{{i18n "discourse_ai.ai_bot.debug_ai_modal.request_tokens"}}
{{this.info.request_tokens}}
</span>
<span>
<span class="ai-debug-modal__tokens__count">
{{i18n "discourse_ai.ai_bot.debug_ai_modal.response_tokens"}}
{{this.info.response_tokens}}
</span>

View File

@ -139,7 +139,7 @@ span.onebox-ai-llm-title {
}
}
.ai-debug-modal__tokens span {
.ai-debug-modal__tokens__count {
display: block;
}