Skip to content

Commit 0a660d3

Browse files
committed
Move cache information from header to footer to be consistent with cost/token data
1 parent 43d847a commit 0a660d3

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

webview-ui/src/components/history/TaskItemFooter.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ const TaskItemFooter: React.FC<TaskItemFooterProps> = ({ item, variant, isSelect
3333
})}>
3434
{isCompact ? (
3535
<>
36+
{/* Compact Cache */}
37+
{!!item.cacheWrites && (
38+
<span className="flex items-center gap-px" data-testid="cache-compact">
39+
<i className="codicon codicon-database" style={metadataIconWithTextAdjustStyle} />
40+
{formatLargeNumber(item.cacheWrites || 0)}
41+
<i className="codicon codicon-arrow-right" style={metadataIconWithTextAdjustStyle} />
42+
{formatLargeNumber(item.cacheReads || 0)}
43+
</span>
44+
)}
45+
3646
{/* Compact Tokens */}
3747
{(item.tokensIn || item.tokensOut) && (
3848
<>
@@ -55,6 +65,21 @@ const TaskItemFooter: React.FC<TaskItemFooterProps> = ({ item, variant, isSelect
5565
) : (
5666
<>
5767
<div className="flex flex-col gap-1">
68+
{/* Cache Info */}
69+
{!!item.cacheWrites && (
70+
<div className="flex items-center flex-wrap gap-x-1">
71+
<span className="font-medium">{t("history:cacheLabel")}</span>
72+
<span className="flex items-center gap-px" data-testid="cache-writes">
73+
<i className="codicon codicon-database" style={metadataIconWithTextAdjustStyle} />
74+
<span className="font-medium">{formatLargeNumber(item.cacheWrites || 0)}</span>
75+
</span>
76+
<span className="flex items-center gap-px" data-testid="cache-reads">
77+
<i className="codicon codicon-arrow-right" style={metadataIconWithTextAdjustStyle} />
78+
<span className="font-medium">{formatLargeNumber(item.cacheReads || 0)}</span>
79+
</span>
80+
</div>
81+
)}
82+
5883
{/* Full Tokens */}
5984
{(item.tokensIn || item.tokensOut) && (
6085
<div className="flex items-center flex-wrap gap-x-1">

webview-ui/src/components/history/TaskItemHeader.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,6 @@ const TaskItemHeader: React.FC<TaskItemHeaderProps> = ({ item, variant, isSelect
5050
<span className="text-vscode-descriptionForeground font-medium text-sm uppercase">
5151
{formatDate(item.ts)}
5252
</span>
53-
54-
{/* Cache Info */}
55-
{!!item.cacheWrites && (
56-
<span className="text-vscode-descriptionForeground flex items-center gap-px">
57-
<i className="codicon codicon-database" style={metadataIconWithTextAdjustStyle} />
58-
<span data-testid="cache-writes">{formatLargeNumber(item.cacheWrites || 0)}</span>
59-
<i className="codicon codicon-arrow-right" style={metadataIconWithTextAdjustStyle} />
60-
<span data-testid="cache-reads">{formatLargeNumber(item.cacheReads || 0)}</span>
61-
</span>
62-
)}
6353
</div>
6454

6555
{/* Action Buttons */}

0 commit comments

Comments
 (0)