Agentic UI: Add Usage tab - #4286
Conversation
📊 Performance Test ResultsComparing e2b0415 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
…ge-tab # Conflicts: # apps/ui/src/components/settings-view/index.tsx # apps/ui/src/components/settings-view/style.module.css # apps/ui/src/data/core/connectors/ipc/index.ts # apps/ui/src/data/core/types.ts # apps/ui/src/hooks/use-offline.ts
…udio into agentic-settings-usage-tab
…ge-tab # Conflicts: # apps/ui/src/components/settings-view/index.tsx
sejas
left a comment
There was a problem hiding this comment.
Thanks for adding the Usage tab and fixing the delete all preview sites. It works well.
I added a suggestion related to Offline mode and the Preview site action menu.
I also created a PR against this PR to add the AI credits usage bar which we already have in the classic UI. #4296
| <p> | ||
| { __( | ||
| 'AI credits are currently free while Studio Code is in Alpha. Build, iterate, and experiment, but know that credits will eventually have a cost.' | ||
| ) } | ||
| </p> |
There was a problem hiding this comment.
I created the PR to add it to the Agentic UI #4296 , we can merge it to this branch or as a follow-up to trunk.
|
|
||
| function getDeletePreviewSitesLabel( isOffline: boolean, isDeleting: boolean ): string { | ||
| if ( isOffline ) { | ||
| return __( 'Deleting preview sites requires an internet connection.' ); |
There was a problem hiding this comment.
This will rarely be displayed. We can consider not disabling the Action button (...) when is offline so users will be able to open the dropdown menu and see the message.
) ## Related issues - Related to the agentic Settings Usage tab work on `agentic-settings-usage-tab` ## How AI was used in this PR AI assisted with porting the quota logic from the legacy settings panel and with automated review passes (simplification + code review); all changes were verified with typecheck, lint, and unit tests. ## Proposed Changes - Add AI Usage progress bar to Usage tab ## Testing Instructions 1. `npm start` with the agentic UI enabled and log in to a WordPress.com account that has a Studio Code cost cap. 2. Open Settings → Usage: the AI credits section should show "X% of monthly limit used (resets on DATE)" with a progress bar reflecting the percentage. 3. Go offline (e.g. disable network): the section should show "You're currently offline". 5. Verify the legacy settings dialog (classic UI → Settings) still shows the same quota line — it now reads the schema from the shared module. | Before | After | |--------|--------| | <img width="1431" height="925" alt="Screenshot 2026-07-22 at 11 15 26" src="https://github.com/user-attachments/assets/c7242431-4cf9-4738-bde3-30d12bbf378a" /> | <img width="1431" height="925" alt="Screenshot 2026-07-22 at 11 48 10" src="https://github.com/user-attachments/assets/12ca74c1-6e3c-4574-9d05-6ab03f94baa0" /> | ## Pre-merge Checklist - [x] Have you checked for TypeScript, React or other console errors?
|
@sejas thanks for the review and for handling the usage PR! 🙇 |
…ge-tab # Conflicts: # apps/ui/src/components/settings-view/index.tsx
There was a problem hiding this comment.
@bcotrim Looks good! A final comment is the Loading state between AI Credits and preview sites. The first one doesn't display the progress bar while the second it does. Let's make both consistent. You can reproduce it by pressing cmd+r in the usage tab.
| Online | Offline | Logged out |
|---|---|---|
![]() |
![]() |
![]() |




Related issues
How AI was used in this PR
Implemented with Claude Code (connector contract, queries, panel UI, and tests), following the patterns established in #3979 and reviewed by the author.
Proposed Changes
Adds a Usage tab to the agentic UI settings so users can see what they're consuming without leaving Studio:
Testing Instructions
studio preview list.Pre-merge Checklist