improve readability of context usage display calculation (#111)
This commit is contained in:
committed by
GitHub
parent
e1d3c2b76e
commit
488f080883
@@ -186,12 +186,13 @@ 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}`;
|
||||||
if (contextPercentValue > 90) {
|
if (contextPercentValue > 90) {
|
||||||
contextPercentStr = theme.fg("error", `${contextPercent}%${autoIndicator}`);
|
contextPercentStr = theme.fg("error", contextPercentDisplay);
|
||||||
} else if (contextPercentValue > 70) {
|
} else if (contextPercentValue > 70) {
|
||||||
contextPercentStr = theme.fg("warning", `${contextPercent}%${autoIndicator}`);
|
contextPercentStr = theme.fg("warning", contextPercentDisplay);
|
||||||
} else {
|
} else {
|
||||||
contextPercentStr = `${contextPercent}%${autoIndicator}`;
|
contextPercentStr = contextPercentDisplay;
|
||||||
}
|
}
|
||||||
statsParts.push(contextPercentStr);
|
statsParts.push(contextPercentStr);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user