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
This commit is contained in:
@@ -145,7 +145,9 @@ export class FooterComponent implements Component {
|
|||||||
const formatTokens = (count: number): string => {
|
const formatTokens = (count: number): string => {
|
||||||
if (count < 1000) return count.toString();
|
if (count < 1000) return count.toString();
|
||||||
if (count < 10000) return (count / 1000).toFixed(1) + "k";
|
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 ~
|
// Replace home directory with ~
|
||||||
@@ -186,7 +188,7 @@ export class FooterComponent implements Component {
|
|||||||
// Colorize context percentage based on usage
|
// Colorize context percentage based on usage
|
||||||
let contextPercentStr: string;
|
let contextPercentStr: string;
|
||||||
const autoIndicator = this.autoCompactEnabled ? " (auto)" : "";
|
const autoIndicator = this.autoCompactEnabled ? " (auto)" : "";
|
||||||
const contextPercentDisplay = `${contextPercent}% of ${formatTokens(contextWindow)}${autoIndicator}`;
|
const contextPercentDisplay = `${contextPercent}%/${formatTokens(contextWindow)}${autoIndicator}`;
|
||||||
if (contextPercentValue > 90) {
|
if (contextPercentValue > 90) {
|
||||||
contextPercentStr = theme.fg("error", contextPercentDisplay);
|
contextPercentStr = theme.fg("error", contextPercentDisplay);
|
||||||
} else if (contextPercentValue > 70) {
|
} else if (contextPercentValue > 70) {
|
||||||
|
|||||||
Reference in New Issue
Block a user