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

Commit 5705245

Browse files
DEV: Lint and update tooltips
1 parent 3ab9c6c commit 5705245

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

assets/javascripts/discourse/components/ai-spam.gjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { action } from "@ember/object";
66
import { LinkTo } from "@ember/routing";
77
import { service } from "@ember/service";
88
import DButton from "discourse/components/d-button";
9+
import DStatTiles from "discourse/components/d-stat-tiles";
910
import DToggleSwitch from "discourse/components/d-toggle-switch";
1011
import DTooltip from "discourse/components/d-tooltip";
1112
import withEventValue from "discourse/helpers/with-event-value";
@@ -17,7 +18,6 @@ import AdminConfigAreaCard from "admin/components/admin-config-area-card";
1718
import AdminPageSubheader from "admin/components/admin-page-subheader";
1819
import ComboBox from "select-kit/components/combo-box";
1920
import SpamTestModal from "./modal/spam-test-modal";
20-
import DStatTiles from "discourse/components/d-stat-tiles";
2121

2222
export default class AiSpam extends Component {
2323
@service siteSettings;
@@ -139,10 +139,12 @@ export default class AiSpam extends Component {
139139
{
140140
label: i18n("discourse_ai.spam.false_positives"),
141141
value: this.stats.false_positives,
142+
tooltip: i18n("discourse_ai.spam.stat_tooltips.incorrectly_flagged"),
142143
},
143144
{
144145
label: i18n("discourse_ai.spam.false_negatives"),
145146
value: this.stats.false_negatives,
147+
tooltip: i18n("discourse_ai.spam.stat_tooltips.missed_spam"),
146148
},
147149
];
148150
}
@@ -227,6 +229,7 @@ export default class AiSpam extends Component {
227229
@label={{metric.label}}
228230
@url={{metric.href}}
229231
@value={{metric.value}}
232+
@tooltip={{metric.tooltip}}
230233
/>
231234
{{/each}}
232235
</DStatTiles>

assets/javascripts/discourse/components/ai-usage.gjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Component from "@glimmer/component";
2-
import DStatTiles from "discourse/components/d-stat-tiles";
32
import { tracked } from "@glimmer/tracking";
43
import { fn, hash } from "@ember/helper";
54
import { action } from "@ember/object";
@@ -8,6 +7,7 @@ import { service } from "@ember/service";
87
import { eq, gt, lt } from "truth-helpers";
98
import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
109
import DButton from "discourse/components/d-button";
10+
import DStatTiles from "discourse/components/d-stat-tiles";
1111
import DateTimeInputRange from "discourse/components/date-time-input-range";
1212
import avatar from "discourse/helpers/avatar";
1313
import concatClass from "discourse/helpers/concat-class";
@@ -135,18 +135,22 @@ export default class AiUsage extends Component {
135135
{
136136
label: i18n("discourse_ai.usage.total_tokens"),
137137
value: this.data.summary.total_tokens,
138+
tooltip: i18n("discourse_ai.usage.stat_tooltips.total_tokens"),
138139
},
139140
{
140141
label: i18n("discourse_ai.usage.request_tokens"),
141142
value: this.data.summary.total_request_tokens,
143+
tooltip: i18n("discourse_ai.usage.stat_tooltips.request_tokens"),
142144
},
143145
{
144146
label: i18n("discourse_ai.usage.response_tokens"),
145147
value: this.data.summary.total_response_tokens,
148+
tooltip: i18n("discourse_ai.usage.stat_tooltips.response_tokens"),
146149
},
147150
{
148151
label: i18n("discourse_ai.usage.cached_tokens"),
149152
value: this.data.summary.total_cached_tokens,
153+
tooltip: i18n("discourse_ai.usage.stat_tooltips.cached_tokens"),
150154
},
151155
];
152156
}

config/locales/client.en.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ en:
157157
run: "Run test"
158158
spam: "Spam"
159159
not_spam: "Not spam"
160+
stat_tooltips:
161+
incorrectly_flagged: "Items that the AI bot flagged as spam where moderators disagreed"
162+
missed_spam: "Items flagged by the community as spam that were not detected by the AI bot, which moderators agreed with"
160163

161164
usage:
162165
short_title: "Usage"
@@ -183,7 +186,11 @@ en:
183186
no_features: "No feature usage data found"
184187
subheader_description: "Tokens are the basic units that LLMs use to understand and generate text, usage data may affect costs."
185188
stat_tooltips:
186-
total_requests: "These are all requests made to LLMs through Discourse"
189+
total_requests: "All requests made to LLMs through Discourse"
190+
total_tokens: "All the tokens used when prompting an LLM"
191+
request_tokens: "Tokens used when the LLM tries to understand what you are saying"
192+
response_tokens: "Tokens used when the LLM responds to your prompt"
193+
cached_tokens: "Previously processed request tokens that the LLM reuses to optimize performance and cost"
187194
periods:
188195
last_day: "Last 24 hours"
189196
last_week: "Last week"

0 commit comments

Comments
 (0)