Skip to content

Improve AI credit balance meter - #4681

Open
shaunandrews wants to merge 4 commits into
trunkfrom
improve-ai-credits-meter
Open

Improve AI credit balance meter#4681
shaunandrews wants to merge 4 commits into
trunkfrom
improve-ai-credits-meter

Conversation

@shaunandrews

@shaunandrews shaunandrews commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Related issues

Fixes STU-2334

How AI was used in this PR

Assisted

Proposed Changes

With this PR we are adding AI credits balance meter to composer, which reflects the state from Settings -> Usage

Testing Instructions

  1. Follow the steps from this PR Show an AI credits usage meter in Settings → Usage #4692
  2. Assert that the state of the usage meter in "Settings -> Usage" is reflected in the composer

@shaunandrews
shaunandrews marked this pull request as ready for review August 25, 2026 14:56
@shaunandrews
shaunandrews requested review from a team and nightnei August 25, 2026 14:56
}

const remaining = ( quota.allowanceRemaining ?? 0 ) + ( quota.purchasedRemaining ?? 0 );
const usedFraction = quota.costCap > 0 ? quota.costUsage / quota.costCap : 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

costCap and costUsage - store info only about free allowance. We don't have functionality on the backend yet to return info costCapFOR_PURCHASED_CREDITS and costUsageFOR_PURCHASED_CREDITS.

Also, I remember you wanted to have this p1787155322763389/1787154068.417469-slack-C0BM2EL2Q7Q, which may even require effort from the Shilling team.

That's why I didn't include it in the initial release, since it's not a quick feature, it requires more effort than UI changes.

I propose closing this branch, and I will work on it later.

@wpmobilebot

wpmobilebot commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 5bfc5c3 vs trunk

app-size

Metric trunk 5bfc5c3 Diff Change
App Size (Mac) 1425.05 MB 1425.05 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 5bfc5c3 Diff Change
load 1196 ms 1188 ms 8 ms ⚪ 0.0%

site-startup

Metric trunk 5bfc5c3 Diff Change
siteCreation 7493 ms 7498 ms +5 ms ⚪ 0.0%
siteStartup 3372 ms 3376 ms +4 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@nightnei nightnei assigned nightnei and unassigned shaunandrews Aug 26, 2026
@nightnei
nightnei force-pushed the improve-ai-credits-meter branch from f7dba99 to ba8ca13 Compare August 31, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants