Merge branch 'main' into feature/add-context-window-size-config

Resolved conflicts in:
- packages/cli/src/ui/components/ContextUsageDisplay.tsx
- packages/cli/src/ui/components/Footer.tsx
- packages/cli/src/ui/components/Footer.test.tsx
- docs/users/configuration/settings.md

Changes:
- Merged main branch UI improvements with rightItems architecture
- Updated contextWindowSize documentation to be more concise
- Preserved all main branch features and functionality
This commit is contained in:
xwj02155382 2026-01-23 14:41:59 +08:00
commit 4ad4aab3fd
320 changed files with 21383 additions and 10420 deletions

View file

@ -19,17 +19,21 @@ export const ContextUsageDisplay = ({
terminalWidth: number;
config: Config;
}) => {
if (promptTokenCount === 0) {
return null;
}
const contentGeneratorConfig = config.getContentGeneratorConfig();
const contextLimit = tokenLimit(model, 'input', contentGeneratorConfig);
const percentage = promptTokenCount / contextLimit;
const percentageLeft = ((1 - percentage) * 100).toFixed(0);
const percentageUsed = (percentage * 100).toFixed(1);
const label = terminalWidth < 100 ? '%' : '% context left';
const label = terminalWidth < 100 ? '% used' : '% context used';
return (
<Text color={theme.text.secondary}>
({percentageLeft}
{label})
{percentageUsed}
{label}
</Text>
);
};