Skip to content

Commit 22b24d9

Browse files
committed
fix(dashboard): remove unknownEventCount display and utility scripts
- Remove 'X API calls with unknown cache data' label from DashboardSummary - Remove add_i18n_key.py and commit-shell-int-fix.ps1 utility scripts - Clean up unknownEventCount i18n keys from all 18 dashboard locale files
1 parent 0601728 commit 22b24d9

22 files changed

Lines changed: 20 additions & 121 deletions

add_i18n_key.py

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

commit-shell-int-fix.ps1

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

webview-ui/src/components/dashboard/DashboardSummary.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ interface SummaryCardProps {
1212
label: string
1313
value: string
1414
exactValue: string
15-
unknownCount?: number
1615
}
1716

18-
const SummaryCard = memo(({ label, value, exactValue, unknownCount }: SummaryCardProps) => {
19-
const { t } = useAppTranslation()
17+
const SummaryCard = memo(({ label, value, exactValue }: SummaryCardProps) => {
2018
return (
2119
<div className="flex flex-col gap-1 rounded-md border border-vscode-panel-border bg-vscode-editor-background p-3">
2220
<span className="text-xs text-vscode-descriptionForeground">{label}</span>
@@ -25,11 +23,6 @@ const SummaryCard = memo(({ label, value, exactValue, unknownCount }: SummaryCar
2523
{value}
2624
</span>
2725
</StandardTooltip>
28-
{unknownCount !== undefined && unknownCount > 0 && (
29-
<span className="text-xs text-vscode-descriptionForeground">
30-
({t("dashboard:summary.unknownEventCount", { count: unknownCount })})
31-
</span>
32-
)}
3326
</div>
3427
)
3528
})
@@ -53,7 +46,6 @@ const DashboardSummary = memo(({ totals }: DashboardSummaryProps) => {
5346
label={t("dashboard:summary.totalTokens")}
5447
value={formatCompact(totals.totalTokens)}
5548
exactValue={totals.totalTokens.toLocaleString()}
56-
unknownCount={totals.unknownEventCount}
5749
/>
5850
<SummaryCard
5951
label={t("dashboard:summary.inputTokens")}

webview-ui/src/components/dashboard/__tests__/DashboardSummary.spec.tsx

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import DashboardSummary from "../DashboardSummary"
99

1010
// Mock i18n — DashboardSummary uses useAppTranslation from TranslationContext,
1111
// which wraps i18next's t(). We mock the context directly.
12-
const mockT = (key: string, opts?: Record<string, unknown>) => {
13-
if (key === "dashboard:summary.unknownEventCount" && typeof opts?.count === "number") {
14-
return `${opts.count} uncertain`
15-
}
12+
const mockT = (key: string) => {
1613
return key
1714
}
1815

@@ -91,18 +88,6 @@ describe("DashboardSummary", () => {
9188
expect(summary?.textContent).toContain("$0.00")
9289
})
9390

94-
it("shows unknown event count when > 0", () => {
95-
const { container } = render(<DashboardSummary totals={makeBucket({ unknownEventCount: 3 })} />)
96-
const summary = container.querySelector('[data-testid="dashboard-summary"]')
97-
expect(summary?.textContent).toContain("3 uncertain")
98-
})
99-
100-
it("does not show unknown event count when 0", () => {
101-
const { container } = render(<DashboardSummary totals={makeBucket({ unknownEventCount: 0 })} />)
102-
const summary = container.querySelector('[data-testid="dashboard-summary"]')
103-
expect(summary?.textContent).not.toContain("uncertain")
104-
})
105-
10691
it("computes cache total from read + write", () => {
10792
const { container } = render(<DashboardSummary totals={makeBucket({
10893
cacheReadTokens: 2000,

webview-ui/src/i18n/locales/ca/dashboard.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/de/dashboard.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/en/dashboard.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"inputTokens": "Input Tokens",
1414
"outputTokens": "Output Tokens",
1515
"cacheTokens": "Cache Tokens",
16-
"cost": "Cost",
17-
"unknownEventCount": "{{count}} API calls with unknown cache data"
16+
"cost": "Cost"
1817
},
1918
"states": {
2019
"loading": "Loading...",

webview-ui/src/i18n/locales/es/dashboard.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/fr/dashboard.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/hi/dashboard.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)