feat(ui): Display token usage in the loading/progress indicator #2445
feat(ui): Display token usage in the loading/progress indicator #2445qqqys merged 5 commits intoQwenLM:mainfrom
Conversation
…e formatting - Added candidatesTokens prop to LoadingIndicator for displaying token counts. - Updated formatting to show elapsed time and token counts inline. - Refactored tests to validate new token display functionality and formatting changes. - Introduced formatTokenCount utility for consistent token count representation. This improves user feedback during loading states by providing clearer information on token usage.
📋 Review SummaryThis PR enhances the LoadingIndicator component to display real-time output token counts during AI responses, along with improved status line formatting. The implementation is well-structured with comprehensive test coverage, but there are several issues that should be addressed before merging. 🔍 General Feedback
🎯 Specific Feedback🔴 Critical
🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
TLDR
This PR enhances the LoadingIndicator component to display real-time output token counts during AI responses, providing users with visibility into token usage. Also improves the status line formatting for better readability.
Dive Deeper
Token Display Feature:
candidatesTokensprop toLoadingIndicatorcomponentsessionStats.metrics.modelsin the Composer componentformatTokenCountutility function formats tokens intelligently:Formatting Improvements:
(esc to cancel, 5s)to(5s · ↓ 847 tokens · esc to cancel)·for better visual hierarchyReviewer Test Plan
npm startto launch the CLInpm run test -- LoadingIndicatorTesting Matrix
Linked issues / bugs
No linked issues
Resolves #2013