mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-20 21:02:02 +00:00
improve readability of context usage display calculation (#111)
This commit is contained in:
parent
e1d3c2b76e
commit
488f080883
1 changed files with 4 additions and 3 deletions
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue