refactor(ui): revamp exit stats display (#2771)

This commit is contained in:
Abhi
2025-06-30 20:28:49 -04:00
committed by GitHub
parent 3587054d32
commit f91927569c
9 changed files with 123 additions and 424 deletions

View File

@@ -1,45 +1,24 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`<SessionSummaryDisplay /> > correctly sums and displays stats from multiple models 1`] = `
"╭─────────────────────────────────────╮
│ │
│ Agent powering down. Goodbye! │
│ │
│ │
Cumulative Stats (15 API calls)
│ │
Input Tokens 1,500
Output Tokens 3,000
Tool Use Tokens 220
Thoughts Tokens 350
Cached Tokens 600 (12.0%)
│ ───────────────────────────────── │
Total Tokens 5,000 │
│ │
Total duration (API) 1m 2s
Total duration (Tools) 0s
Total duration (wall) 1h 23m 45s
│ │
╰─────────────────────────────────────╯"
`;
exports[`<SessionSummaryDisplay /> > renders zero state correctly 1`] = `
"╭─────────────────────────────────────╮
│ │
│ Agent powering down. Goodbye! │
│ │
│ │
│ Cumulative Stats (0 API calls) │
│ │
│ Input Tokens 0 │
│ Output Tokens 0 │
│ Thoughts Tokens 0 │
│ ───────────────────────────────── │
│ Total Tokens 0 │
│ │
│ Total duration (API) 0s │
│ Total duration (Tools) 0s │
│ Total duration (wall) 1h 23m 45s │
│ │
╰─────────────────────────────────────╯"
exports[`<SessionSummaryDisplay /> > renders the summary display with a title 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────
│ Agent powering down. Goodbye!
Performance
Wall Time: 1h 23m 45s
Agent Active: 50.2s
» API Time: 50.2s (100.0%)
» Tool Time: 0s (0.0%)
Model Usage Reqs Input Tokens Output Tokens
│ ───────────────────────────────────────────────────────────────
gemini-2.5-pro 10 1,000 2,000
Savings Highlight: 500 (50.0%) of input tokens were served from the cache, reducing costs.
» Tip: For a full token breakdown, run \`/stats model\`.
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;

View File

@@ -1,49 +0,0 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`<DurationColumn /> > renders a duration column 1`] = `
"Duration
API Time 5s
Wall Time 10s"
`;
exports[`<StatRow /> > renders a label and value 1`] = `"Test Label Test Value"`;
exports[`<StatRow /> > renders with a specific value color 1`] = `"Test Label Test Value"`;
exports[`<StatsColumn /> > renders a cumulative stats column with percentages 1`] = `
"Cumulative Stats
Input Tokens 100
Output Tokens 200
Tool Use Tokens 50
Thoughts Tokens 25
Cached Tokens 10 (2.6%)
────────────────────────────────────────────────────────────────────────────────────────────────────
Total Tokens 385"
`;
exports[`<StatsColumn /> > renders a stats column with a specific width 1`] = `
"Test Stats
Input Tokens 100
Output Tokens 200
Tool Use Tokens 50
Thoughts Tokens 25
Cached Tokens 10
──────────────────────────────────────────────────
Total Tokens 385"
`;
exports[`<StatsColumn /> > renders a stats column with children 1`] = `
"Test Stats
Input Tokens 100
Output Tokens 200
Tool Use Tokens 50
Thoughts Tokens 25
Cached Tokens 10
────────────────────────────────────────────────────────────────────────────────────────────────────
Total Tokens 385
Child Prop Child Value"
`;

View File

@@ -95,6 +95,36 @@ exports[`<StatsDisplay /> > Conditional Rendering Tests > hides User Agreement w
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;
exports[`<StatsDisplay /> > Title Rendering > renders the custom title when a title prop is provided 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Agent powering down. Goodbye! │
│ │
│ Performance │
│ Wall Time: 1s │
│ Agent Active: 0s │
│ » API Time: 0s (0.0%) │
│ » Tool Time: 0s (0.0%) │
│ │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;
exports[`<StatsDisplay /> > Title Rendering > renders the default title when no title prop is provided 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Session Stats │
│ │
│ Performance │
│ Wall Time: 1s │
│ Agent Active: 0s │
│ » API Time: 0s (0.0%) │
│ » Tool Time: 0s (0.0%) │
│ │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯"
`;
exports[`<StatsDisplay /> > renders a table with two models correctly 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │