refactor: remove color coding from token counter

Keep simple clean format: '2.5k / 200k tokens' without color changes
This commit is contained in:
2025-10-16 22:16:25 -07:00
parent 41437e1751
commit e47bd3bf87

View File

@@ -1661,24 +1661,14 @@ async function updateTokenCount() {
currentInput currentInput
}); });
// Update total display with color coding // Update total display
const tokenCounter = document.getElementById('token-counter'); const tokenCounter = document.getElementById('token-counter');
const tokenCountTotal = document.getElementById('token-count-total'); const tokenCountTotal = document.getElementById('token-count-total');
const contextLimit = 200000; // Claude 200k context const contextLimit = 200000; // Claude 200k context
const percentage = (tokenData.total / contextLimit) * 100;
// Format: "2.5k / 200k tokens" // Format: "2.5k / 200k tokens"
tokenCountTotal.textContent = `${formatTokenCount(tokenData.total)} / ${formatTokenCount(contextLimit)} tokens`; tokenCountTotal.textContent = `${formatTokenCount(tokenData.total)} / ${formatTokenCount(contextLimit)} tokens`;
// Apply color coding based on usage
if (percentage < 50) {
tokenCountTotal.style.color = '#4ade80'; // Green
} else if (percentage < 80) {
tokenCountTotal.style.color = '#facc15'; // Yellow
} else {
tokenCountTotal.style.color = '#f87171'; // Red
}
// Update breakdown // Update breakdown
document.getElementById('token-system').textContent = tokenData.system_prompt; document.getElementById('token-system').textContent = tokenData.system_prompt;
document.getElementById('token-preset').textContent = tokenData.preset_instructions; document.getElementById('token-preset').textContent = tokenData.preset_instructions;
@@ -1694,7 +1684,6 @@ async function updateTokenCount() {
// Keep counter visible, just show 0 // Keep counter visible, just show 0
const tokenCountTotal = document.getElementById('token-count-total'); const tokenCountTotal = document.getElementById('token-count-total');
tokenCountTotal.textContent = '0 / 200k tokens'; tokenCountTotal.textContent = '0 / 200k tokens';
tokenCountTotal.style.color = 'var(--text-secondary)';
} }
}, 300); // Update after 300ms of no typing }, 300); // Update after 300ms of no typing
} }