[FEATURE]: Use K/M compact notation instead of locale myriad units (e.g. "67万") for token counts in Desktop/Web UI

Offen Anfängerfreundlich
#68,437 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
78/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript

Rechercherichtung

Lies die kompakte Formatierung in packages/gui-plugins/src/context/indicator.tsx (Zeilen 67–71) und packages/app/src/providers/models/details.tsx (Zeilen 157–161) und vergleiche sie anschließend mit packages/tui/src/feature-plugins/system/stats-data.ts. Aktualisiere die UI-Formatierung, sodass Tokenzahlen und Kontextlimits in allen Gebietsschemata die K/M-Notation verwenden. Das Ziel ist erreicht, wenn chinesische, japanische und koreanische Gebietsschemata an beiden UI-Stellen durchgängig K/M-Werte anzeigen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area/desktop type/feature version/v2
Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

In the Desktop / Web UI, when the language is set to Chinese (zh-CN, and similarly zh-TW / ja / ko), compact token counts in the header context indicator are formatted with locale myriad units—e.g. 359,427 tokens shows as 36万 instead of 360k / 359K.

The header context indicator:
image

Total Tokens:
image

In LLM and developer contexts, CJK users universally expect K / M notation for token counts and context windows (128K, 200K, 330K, 1M), matching model specs and other AI coding tools. Seeing 67万 forces a mental ×10 conversion every time and loses precision at 10k boundaries (e.g. 128,000 becomes 12万).

This happens because Intl.NumberFormat passes the UI locale with notation: "compact":

  • packages/gui-plugins/src/context/indicator.tsx (lines 67–71)
  • packages/app/src/providers/models/details.tsx (lines 157–161)

Using "en-US" (as already done in packages/tui/src/feature-plugins/system/stats-data.ts) for compact token / context-limit formatting would keep K / M consistent across all locales.

Vorherrschende Sprache
TypeScript
Sterne
230k
Forks
31.3k
Ø Merge
5 Std. 44 Min.
Gemergte PRs (30 T.)
529

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus anomalyco/opencode

Alle Issues in anomalyco/opencode

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.