feat(ui): add usage analytics dashboard with time-series charts#2028
Closed
rom1504 wants to merge 7 commits intoopenclaw:mainfrom
Closed
feat(ui): add usage analytics dashboard with time-series charts#2028rom1504 wants to merge 7 commits intoopenclaw:mainfrom
rom1504 wants to merge 7 commits intoopenclaw:mainfrom
Conversation
3ef9a49 to
a37871f
Compare
Author
|
WIP not ready |
Add a new Analytics tab to the Control UI that displays: - Summary stats: total tokens, input/output, cache read/write, estimated cost - Daily token usage bar chart - Daily cost bar chart - Configurable time period (7/14/30/90 days) Uses existing usage.cost gateway endpoint which returns daily aggregated data from session transcripts. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add analytics view helper function tests - Add analytics controller state tests - Add data type validation tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
a37871f to
6abd372
Compare
- Fix analytics loading bug where client.request returns payload directly - Add plan quota section showing usage against plan limits (5h, weekly windows) - Display provider errors when OAuth token lacks required scopes - Add helpful message when no quota data is available - Add screenshot script with dynamic Playwright chromium detection - Update tests for quota state and parallel data fetching Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When using Claude Code OAuth tokens (which lack user:profile scope), display a helpful message directing users to check their usage at claude.ai instead of showing an error. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
f7ef4fa to
36523e7
Compare
- Add Analytics section to Control UI docs explaining quota and usage features - Add screenshot script with dynamic token loading from config - Update screenshot showing the analytics dashboard Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move screenshot to standard docs/images location - Update control-ui.md to reference correct image path - Improve screenshot script with better click fallbacks - Remove duplicate screenshot from docs/gateway/images Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Author
|
Ok it works now, ready for review. |
Member
|
Closing due to merge conflicts. Please rebase on |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new Analytics tab to the Control UI dashboard that visualizes token usage and plan quota:
Plan Quota Section
user:profilescope required for programmatic quota access)Usage Summary Section
Uses the existing
usage.costandusage.statusgateway endpoints.Screenshot
Changes
New Files
ui/src/ui/views/analytics.ts- View with quota bars and usage charts (pure CSS, no charting library)ui/src/ui/controllers/analytics.ts- Data fetching controllerscripts/analytics-screenshot.mjs- Screenshot script for docsdocs/images/control-ui-analytics.png- ScreenshotModified Files
ui/src/ui/navigation.ts- Add analytics tabui/src/ui/app.ts- Add analytics state propertiesui/src/ui/app-view-state.ts- Add analytics state typesui/src/ui/app-render.ts- Wire up analytics view renderingui/src/ui/app-settings.ts- Load analytics data on tab switchdocs/web/control-ui.md- Add analytics documentationTest Plan
🤖 Generated with Claude Code