Repository navigation
feat(billing): warn under each page's header from 80% of the month's AI usage, and once it's used up (AI usage display, part 2) - #1431
Merged
Conversation
… pages (AI usage display, part 1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…AI usage, and once it's used up (AI usage display, part 2) Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 23, 2026
Merged
cihan-gyk
added a commit
to cihan-gyk/ansvisor
that referenced
this pull request
Oct 24, 2026
ansvisor#1430 and ansvisor#1431 are on main (squash-merged), with ansvisor#1433 and ansvisor#1436; this branch's own change (part 4) is applied on top of them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
AI usage display, part 2: the warnings at 80% and 100% of the month's AI allowance (Drive › AI Usage ›
AI-USAGE-spec.md§4).Banner under each page's header row.
HeaderWithAiUsage(#1430) now puts it right after the row, so it shows on every page that has the meter, in the same place.AiUsageGetMore, which the meter's popover now uses too.dark:variants.Toast, once a period in a browser, on reaching 80%, with the banner's words (spec §4). A used-up allowance has its red banner and no toast.
aiUsageToastDue(lib/billing/ai-usage.ts) decides from the last toast the browser showed. It keeps "{periodStart}:{plan}" inlocalStorageunderaeo:ai-usage-toast.From the spec, changed here:
space-y-6(24 px), not the mockup's 12 px, so the banner sits like the page's other parts.Next (same spec, §4 and §3.1): the Content Editor's meter with "This page so far", its banner, and the agent buttons saying why they can't run (stacked on #1429), then the detail pages. Chat gets its banner with the Chat work.
Pre-push review: no high findings. Fixed:
Related issue
Drive spec AI Usage (approved 2026-10-23). No GitHub issue.
Type of change
How to test
prompt_improve_usage) and open any page:Checked locally on the demo workspace, temporarily on Growth with test usage rows (restored and removed afterwards):
MutationObserver).Checklist
web/:yarn format:check,yarn lint(0 errors; 6 existing warnings elsewhere),yarn typecheck,yarn test(366 files, 3,312 tests) andyarn buildpassai-usage-banner.test.tsx:lib/billing/ai-usage.test.ts: the toast is due once a period from 80%, again in a new period or on a changed plan, and not below 80%, once used up, or unmetered.ai-usage-meter.test.tsx:messages/en.json🤖 Generated with Claude Code