Repository navigation
fix(billing): show the AI usage breakdown by what was used: quality checks under the Content Editor, no empty rows, "<0.1%" for a small share - #1629
Merged
Conversation
…hecks under the Content Editor, no empty rows, "<0.1%" for a small share The AI usage breakdown listed every feature at 0% (the Action Center's task writing is off on the cloud, quality checks cost a fraction of a cent), which read as hardly using the product. getAiUsage folds quality checks into the Content Editor row and returns only features that spent something; a listed feature whose share rounds to 0 shows "<0.1%". With no spend yet, the card and the header meter say so in one line. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nge the new way An older API lists every feature, unused ones at 0, and the quality checks in a row of their own. The web now adds that row into the Content Editor's and drops the unused rows, so no unused feature reads as "<0.1%" and a workspace that used nothing reads "No AI usage yet" until the API is deployed.
Contributor
|
I took the review's before-merge item over (50fd906): |
gkhngyk
approved these changes
Oct 28, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good with 50fd906: the web reads an older API's answer (a separate quality row, unused features at 0) the way the new one reads, for the Billing card and the header meter, so it can ship before the API. The remaining follow-ups from the review stay open.
8 of 12 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
What changes:
getAiUsagefolds the quality checks into the Content Editor row, now "Content Editor (briefs, Content Agent, quality checks)". The separate quality row is gone.percentUsedis unchanged.featurePercentLabel) instead of "0%". The server keeps the true rounded value, so the rows never add up to more than the total.Related issue
None. Ansvisor's decision (2026-10-28): the breakdown read as "you hardly use it". The Action Center's task writing is off on the cloud (
ACTION_TASKS_AI), and quality checks cost a fraction of a cent, so most rows sat at 0%.Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd server && npx vitest run src/lib/plan-guard-ai-usage.test.jscd web && yarn vitest run src/components/settings/ai-usage-card.test.tsx src/components/ai-usage/ai-usage-meter.test.tsxChecklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Checked together with the other PRs from the same test (one integration tree of all eleven on main 3f6a4d4):
server/:npm run format,npm run lintandnpm test(3,349 tests).web/:yarn format,yarn lint(0 errors, the 7 earlier warnings),yarn typecheck,yarn test(4,385 tests) andyarn build.Checked in the browser at 1024 px, light and dark, against the dev DB with the API and web in cloud mode.
For you, @gkhngyk: "Other" is rows from before 00242 whose prompt, draft or action was deleted, so it fades out as periods pass. The total "0% used" line is unchanged, as asked.
🤖 Generated with Claude Code