refactor(cli): code review cleanup fix for tab+tab (#18967)

This commit is contained in:
Jacob Richman
2026-02-17 07:16:37 -08:00
committed by GitHub
parent e5ff2023ad
commit 366f1df120
14 changed files with 334 additions and 197 deletions

View File

@@ -6,7 +6,7 @@
import { Text } from 'ink';
import { theme } from '../semantic-colors.js';
import { tokenLimit } from '@google/gemini-cli-core';
import { getContextUsagePercentage } from '../utils/contextUsage.js';
export const ContextUsageDisplay = ({
promptTokenCount,
@@ -17,7 +17,7 @@ export const ContextUsageDisplay = ({
model: string;
terminalWidth: number;
}) => {
const percentage = promptTokenCount / tokenLimit(model);
const percentage = getContextUsagePercentage(promptTokenCount, model);
const percentageLeft = ((1 - percentage) * 100).toFixed(0);
const label = terminalWidth < 100 ? '%' : '% context left';