feat(tui): add verbose turn token usage (#39281)

This commit is contained in:
Simon Klee 2026-07-28 13:57:19 +02:00 committed by GitHub
commit 4d59b059ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 70 additions and 6 deletions

View file

@ -77,6 +77,7 @@ export function DevToolsBar() {
const runtime = createMemo(() => runtimeStatus(frontendSamples()))
const timing = () => config.data.debug?.timing ?? false
const turnTokens = () => config.data.debug?.turn_tokens ?? false
const verboseTurnTokens = () => turnTokens() === "verbose"
const offEscape = keymap.intercept(
"key",
@ -380,6 +381,16 @@ export function DevToolsBar() {
>
{turnTokens() ? "[x]" : "[ ]"} Turn token usage
</Action>
<Action
onClick={() =>
void config.update((draft) => {
draft.debug = { ...draft.debug, turn_tokens: verboseTurnTokens() ? true : "verbose" }
})
}
hoverBackground
>
{verboseTurnTokens() ? "[x]" : "[ ]"} Turn token usage (verbose)
</Action>
</box>
<For each={groups()}>
{(group) => (

View file

@ -254,8 +254,8 @@ export const settings: Setting[] = [
category: "Debug",
path: ["debug", "turn_tokens"],
default: false,
values: [false, true],
labels: ["off", "on"],
values: [false, true, "verbose"],
labels: ["off", "on", "verbose"],
keywords: ["tokens", "usage", "debug"],
},
]