From 488f0808839fabc4234e5e73021ad01dc8460b3f Mon Sep 17 00:00:00 2001 From: Markus Ylisiurunen <8409947+markusylisiurunen@users.noreply.github.com> Date: Fri, 5 Dec 2025 02:38:31 +0200 Subject: [PATCH] improve readability of context usage display calculation (#111) --- packages/coding-agent/src/tui/footer.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/coding-agent/src/tui/footer.ts b/packages/coding-agent/src/tui/footer.ts index d9861d0d..b38f8936 100644 --- a/packages/coding-agent/src/tui/footer.ts +++ b/packages/coding-agent/src/tui/footer.ts @@ -186,12 +186,13 @@ 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}`; if (contextPercentValue > 90) { - contextPercentStr = theme.fg("error", `${contextPercent}%${autoIndicator}`); + contextPercentStr = theme.fg("error", contextPercentDisplay); } else if (contextPercentValue > 70) { - contextPercentStr = theme.fg("warning", `${contextPercent}%${autoIndicator}`); + contextPercentStr = theme.fg("warning", contextPercentDisplay); } else { - contextPercentStr = `${contextPercent}%${autoIndicator}`; + contextPercentStr = contextPercentDisplay; } statsParts.push(contextPercentStr);