mirror of
https://github.com/codewhale-hq/Codewhale.git
synced 2026-11-12 18:18:10 -10:00
feat(phase_strip): show cache hit rate percentage after cost
This commit is contained in:
1 parent
9606fa5bbb
commit
a376f88ecf
1 file changed
+12
@@ -216,6 +216,18 @@ pub fn render(area: Rect, buf: &mut Buffer, app: &mut App) {
|
||||
));
|
||||
}
|
||||
|
||||
// Cache hit percentage right after cost, e.g. "(98%)"
|
||||
let total = app.session.total_cache_hit_tokens
|
||||
.saturating_add(app.session.total_cache_miss_tokens);
|
||||
if total > 0 {
|
||||
let pct = (app.session.total_cache_hit_tokens as f64 * 100.0
|
||||
/ total as f64).round() as u8;
|
||||
left.push(Span::styled(
|
||||
format!(" ({pct}%)"),
|
||||
Style::default().fg(app.ui_theme.text_dim),
|
||||
));
|
||||
}
|
||||
|
||||
// Live phases keep the strip quiet: no detail-key chorus competing with
|
||||
// the ledger. Idle/typing may advertise keys on the quiet footer.
|
||||
// Hints come from shell_key_routing so advertised chords match handlers;
|
||||
|
||||
Reference in new issue
Block a user