Show context bar always (not only when history exists)
히스토리 없어도 '0 / 200k' 형태로 항상 표시 → 클릭으로 최대값 재확인 가능. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+9
-13
@@ -3926,19 +3926,15 @@ function updateSessionPanel() {
|
||||
const ctxFill = document.getElementById('code-ai-ctx-fill');
|
||||
if (ctxWrap && ctxLabel && ctxFill) {
|
||||
const totalChars = codeAiHistory.reduce((s, m) => s + (m.content || '').length, 0);
|
||||
if (totalChars === 0) {
|
||||
ctxWrap.style.display = 'none';
|
||||
} else {
|
||||
const estTokens = Math.round(totalChars / 4);
|
||||
const maxTokens = _codeAiCtxMax();
|
||||
const pct = Math.min(100, Math.round(estTokens / maxTokens * 100));
|
||||
const kStr = estTokens >= 1000 ? `~${(estTokens/1000).toFixed(1)}k` : `~${estTokens}`;
|
||||
const maxKStr = maxTokens >= 1000 ? `${(maxTokens/1000).toFixed(0)}k` : `${maxTokens}`;
|
||||
ctxLabel.textContent = `${kStr} / ${maxKStr}`;
|
||||
ctxFill.style.width = pct + '%';
|
||||
ctxFill.style.background = pct >= 80 ? '#ef4444' : pct >= 50 ? '#f59e0b' : '#22c55e';
|
||||
ctxWrap.style.display = 'flex';
|
||||
}
|
||||
const estTokens = Math.round(totalChars / 4);
|
||||
const maxTokens = _codeAiCtxMax();
|
||||
const pct = Math.min(100, Math.round(estTokens / maxTokens * 100));
|
||||
const kStr = estTokens >= 1000 ? `~${(estTokens/1000).toFixed(1)}k` : `${estTokens}`;
|
||||
const maxKStr = maxTokens >= 1000 ? `${(maxTokens/1000).toFixed(0)}k` : `${maxTokens}`;
|
||||
ctxLabel.textContent = `${kStr} / ${maxKStr}`;
|
||||
ctxFill.style.width = pct + '%';
|
||||
ctxFill.style.background = pct >= 80 ? '#ef4444' : pct >= 50 ? '#f59e0b' : '#22c55e';
|
||||
ctxWrap.style.display = 'flex';
|
||||
}
|
||||
// 프로젝트 선택기 (항상 업데이트)
|
||||
const sel = document.getElementById('csb-session-project-sel');
|
||||
|
||||
Reference in New Issue
Block a user