From 5c388c0a7767acc6e21fdf31bce677e585497480 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Fri, 5 Dec 2025 12:21:44 +0100 Subject: [PATCH] fix: make footer token counts more compact - Use M suffix for millions (e.g., 10.2M instead of 10184k) - Change '% of' to '%/' for context display --- packages/coding-agent/src/tui/footer.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/coding-agent/src/tui/footer.ts b/packages/coding-agent/src/tui/footer.ts index 3f1e1986..cbd08656 100644 --- a/packages/coding-agent/src/tui/footer.ts +++ b/packages/coding-agent/src/tui/footer.ts @@ -145,7 +145,9 @@ export class FooterComponent implements Component { const formatTokens = (count: number): string => { if (count < 1000) return count.toString(); if (count < 10000) return (count / 1000).toFixed(1) + "k"; - return Math.round(count / 1000) + "k"; + if (count < 1000000) return Math.round(count / 1000) + "k"; + if (count < 10000000) return (count / 1000000).toFixed(1) + "M"; + return Math.round(count / 1000000) + "M"; }; // Replace home directory with ~ @@ -186,7 +188,7 @@ export class FooterComponent implements Component { // Colorize context percentage based on usage let contextPercentStr: string; const autoIndicator = this.autoCompactEnabled ? " (auto)" : ""; - const contextPercentDisplay = `${contextPercent}% of ${formatTokens(contextWindow)}${autoIndicator}`; + const contextPercentDisplay = `${contextPercent}%/${formatTokens(contextWindow)}${autoIndicator}`; if (contextPercentValue > 90) { contextPercentStr = theme.fg("error", contextPercentDisplay); } else if (contextPercentValue > 70) {