Repository navigation
fix(ui): improve cache page header sizing and context - #835
Conversation
- Match CacheStatsCard header size with other card headers (text-sm) - Show request counts in cache hit rate label (116/359) for clarity - Add CacheStatsCard component to cache page for cumulative metrics Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Changes Verified
All changes implement the PR description correctly with no security, logic, or runtime issues detected. |
There was a problem hiding this comment.
Code Review
This pull request integrates the CacheStatsCard component into the cache dashboard and updates the display of cache hit rates to include request counts. Review feedback indicates that the addition of CacheStatsCard creates UI redundancy and state inconsistency because the dashboard already tracks similar metrics on a different refresh schedule. Furthermore, the component should be updated to use the translation system instead of hardcoded English strings to maintain internationalization standards.
| )} | ||
|
|
||
| {/* Prompt Cache Metrics (cumulative with reset) */} | ||
| <CacheStatsCard /> |
There was a problem hiding this comment.
Adding <CacheStatsCard /> here introduces redundant UI and inconsistent state management. The page already contains a 'Prompt Cache' section (lines 351-436) that displays similar metrics (requests, tokens, provider breakdown).
Furthermore, CacheStatsCard performs its own API fetch on mount and does not participate in the 10-second auto-refresh cycle defined in CachePage (line 163), which will lead to diverging data being displayed between the two sections over time.
Consider refactoring CacheStatsCard to accept metrics as an optional prop. If provided, it should use those metrics instead of fetching its own, allowing it to stay in sync with the page's refresh logic. You could then replace the existing inline prompt cache section with this unified component.
- Add 10s auto-refresh interval matching cache page pattern - Replace all hardcoded English strings with translation keys - Add 13 new i18n keys to cache namespace for metrics display - Reorganize header layout with auto-refresh indicator and reset button Addresses Gemini Code Assist feedback on PR cheaper-inference#835: - Fixed internationalization (all text now uses t()) - Maintains distinct metrics (cumulative/resettable vs real-time rolling) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add 10s auto-refresh interval matching cache page pattern - Replace all hardcoded English strings with translation keys - Add 13 new i18n keys to cache namespace for metrics display - Reorganize header layout with auto-refresh indicator and reset button Addresses Gemini Code Assist feedback on PR cheaper-inference#835: - Fixed internationalization (all text now uses t()) - Maintains distinct metrics (cumulative/resettable vs real-time rolling) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…i-polish fix(ui): improve cache page header sizing and context
- Add 10s auto-refresh interval matching cache page pattern - Replace all hardcoded English strings with translation keys - Add 13 new i18n keys to cache namespace for metrics display - Reorganize header layout with auto-refresh indicator and reset button Addresses Gemini Code Assist feedback on PR cheaper-inference#835: - Fixed internationalization (all text now uses t()) - Maintains distinct metrics (cumulative/resettable vs real-time rolling) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…i-polish fix(ui): improve cache page header sizing and context
Summary
32.3% (116/359)) for clarityContext
Follow-up to #822. After merging, noticed the CacheStatsCard header was larger than other section headers, and the cache hit rate percentage lacked context about the total requests.
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com