+
@@ -221,26 +278,72 @@ export function StatusBar(props: {
{contextUsageLabel ? (
-
-
- {compactContextUsageLabel}
-
-
- {contextUsageLabel}{contextWarning ? ` · ${contextWarning.text}` : ''}
-
-
- ) : null}
- {cacheHitLabel ? (
-
- {cacheHitLabel}
-
+
+
+
+
+
+
+
+ {contextUsageDetails?.cacheRead ? (
+
+ {t('misc.contextCache', { value: contextUsageDetails.cacheRead })}
+
+ ) : null}
+
+ {contextUsageDetails?.usedPercentage === null
+ ? t('misc.contextUsedTokens', { value: contextUsageDetails.used })
+ : t('misc.contextUsed', {
+ value: contextUsageDetails?.used ?? '',
+ percent: contextUsageDetails?.usedPercentage ?? 0
+ })}
+
+ {contextUsageDetails?.remaining && contextUsageDetails.remainingPercentage !== null ? (
+
+ {t('misc.contextRemaining', {
+ value: contextUsageDetails.remaining,
+ percent: contextUsageDetails.remainingPercentage
+ })}
+
+ ) : null}
+
+
+
+
) : null}
+
{codexReasoningLabel ? (
- {codexReasoningLabel}
+ {compactCodexReasoningLabel}
+ {codexReasoningLabel}
) : null}
{codexFastMode ? (
diff --git a/web/src/lib/codexStatusLabels.test.ts b/web/src/lib/codexStatusLabels.test.ts
index 779f5a07..c6d69f62 100644
--- a/web/src/lib/codexStatusLabels.test.ts
+++ b/web/src/lib/codexStatusLabels.test.ts
@@ -1,5 +1,9 @@
import { describe, expect, it } from 'vitest'
-import { formatCodexReasoningLabel, shouldShowCodexReasoningLabel } from './codexStatusLabels'
+import {
+ formatCodexReasoningLabel,
+ formatCompactCodexReasoningLabel,
+ shouldShowCodexReasoningLabel
+} from './codexStatusLabels'
describe('codexStatusLabels', () => {
it('formats unset and default effort as reasoning default', () => {
@@ -14,6 +18,13 @@ describe('codexStatusLabels', () => {
expect(formatCodexReasoningLabel('Ultra')).toBe('reasoning ultra')
})
+ it('formats compact effort-only labels', () => {
+ expect(formatCompactCodexReasoningLabel(null)).toBe('default')
+ expect(formatCompactCodexReasoningLabel('default')).toBe('default')
+ expect(formatCompactCodexReasoningLabel('xhigh')).toBe('xhigh')
+ expect(formatCompactCodexReasoningLabel(' Ultra ')).toBe('ultra')
+ })
+
it('only shows the label for codex and opencode', () => {
expect(shouldShowCodexReasoningLabel('codex')).toBe(true)
expect(shouldShowCodexReasoningLabel('opencode')).toBe(true)
diff --git a/web/src/lib/codexStatusLabels.ts b/web/src/lib/codexStatusLabels.ts
index d4960c6b..02324289 100644
--- a/web/src/lib/codexStatusLabels.ts
+++ b/web/src/lib/codexStatusLabels.ts
@@ -1,9 +1,13 @@
/** Labels shared by SessionHeader and composer StatusBar for Codex/OpenCode. */
-export function formatCodexReasoningLabel(effort?: string | null): string {
+export function formatCompactCodexReasoningLabel(effort?: string | null): string {
const normalized = effort?.trim().toLowerCase()
- if (!normalized || normalized === 'default') return 'reasoning default'
- return `reasoning ${normalized}`
+ if (!normalized || normalized === 'default') return 'default'
+ return normalized
+}
+
+export function formatCodexReasoningLabel(effort?: string | null): string {
+ return `reasoning ${formatCompactCodexReasoningLabel(effort)}`
}
export function shouldShowCodexReasoningLabel(agentFlavor: string | null | undefined): boolean {
diff --git a/web/src/lib/locales/en.ts b/web/src/lib/locales/en.ts
index 83801eec..03b99c23 100644
--- a/web/src/lib/locales/en.ts
+++ b/web/src/lib/locales/en.ts
@@ -879,8 +879,12 @@ export default {
'misc.typeAMessage': 'Type a message...',
'misc.offline': 'offline',
'misc.permissionRequired': 'permission required',
- 'misc.percentLeft': '{percent}% left',
'misc.online': 'online',
+ 'misc.contextDetails': 'Context details',
+ 'misc.contextCache': 'Cache: {value}',
+ 'misc.contextUsed': 'Used: {value} ({percent}%)',
+ 'misc.contextUsedTokens': 'Used: {value}',
+ 'misc.contextRemaining': 'Remaining: {value} ({percent}%)',
// Web Share Target picker
'share.title': 'Share to HAPI',
diff --git a/web/src/lib/locales/zh-CN.ts b/web/src/lib/locales/zh-CN.ts
index b83f551c..94a598b3 100644
--- a/web/src/lib/locales/zh-CN.ts
+++ b/web/src/lib/locales/zh-CN.ts
@@ -881,10 +881,14 @@ export default {
'misc.releaseToLoadOlder': '松开加载',
'misc.typeMessage': "输入 'continue' 继续...",
'misc.typeAMessage': '输入消息...',
- 'misc.offline': '离线',
+ 'misc.offline': 'offline',
'misc.permissionRequired': '需要权限',
- 'misc.percentLeft': '剩余 {percent}%',
- 'misc.online': '在线',
+ 'misc.online': 'online',
+ 'misc.contextDetails': '上下文详情',
+ 'misc.contextCache': '缓存:{value}',
+ 'misc.contextUsed': '使用:{value}({percent}%)',
+ 'misc.contextUsedTokens': '使用:{value}',
+ 'misc.contextRemaining': '剩余:{value}({percent}%)',
// Web Share Target 分享面板
'share.title': '分享到 HAPI',