Skip to content

feat(billing): say in the free trial that starting the plan gives more AI usage, on the meter and banners (AI usage display, part 6) - #1436

Merged
gkhngyk merged 4 commits into
ansvisor:mainfrom
cihan-gyk:feature/ai-usage-trial-meter
Oct 24, 2026
Merged

gkhngyk merged 4 commits into
ansvisor:mainfrom
cihan-gyk:feature/ai-usage-trial-meter

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

AI usage display, part 6: in the free trial, the header meter, the 80% / 100% banners and the 80% toast say that more AI usage comes with starting the plan, not with a bigger one.

Stacked on #1431 (banners, on #1430). It reads the trial flag #1435 adds to GET /api/billing/ai-usage; until that deploys, trial is absent and everything reads as before. Web only.

Where it changes (with usage.trial):

  • The meter's popover:
    • the title reads "AI usage this month · Growth free trial";
    • used up, it reads "The free trial's AI usage is used up. Starting the plan gives its full monthly allowance; Agent Chat on your own AI key keeps working."
  • The banners:
    • amber: "You've used 84% of the free trial's AI usage. Starting the plan gives its full monthly allowance.";
    • red: "You've used the free trial's AI usage. Starting the plan gives its full monthly allowance; Agent Chat on your own AI key keeps working."
  • The toast at 80% uses the amber banner's words. Its once-a-period mark keeps the trial apart (…:growth:trial), so a plan started within the trial's period warns again.
  • AiUsageGetMore (admins): the plan link reads Start your plan and leads to Billing, where the trial's admin finds Buy {plan} now. Members who aren't admins still read "ask an admin", with no links.

The words describe rather than tell, as only an admin can start the plan. They match #1435's Billing card ("Starting the plan below gives its full monthly allowance.") and its 429.

AiUsage.trial is added with the same line as #1435's, so the two merge cleanly (checked with git merge-tree against #1435 and #1434).

Pre-push review: no high findings. Fixed:

Follow-up after #1433 and #1435 merge: the editor's used-up reason on agent buttons ("…It resets on {date}.") should say the same in a trial.

Related issue

Drive spec AI Usage (approved 2026-10-23); trial decision 2026-10-24. No GitHub issue.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation

How to test

  1. With feat(billing): one AI budget of $5 / $25 / $50 a month, $1 in the free trial (AI usage display, part 5) #1435's server and a trialing Growth workspace (its AI budget is $1), spend 84%, then 100%.
  2. The meter's popover title says "Growth free trial", and the banners and the toast say starting the plan gives the full allowance.
  3. As an admin, the link reads Start your plan and opens Billing; as a manager, "ask an admin" with no links.
  4. A paid workspace reads as before.

Checklist

  • web/: yarn format:check, yarn lint (0 errors; 6 existing warnings elsewhere), yarn typecheck, yarn test (366 files, 3,316 tests) and yarn build pass
  • Tests:
    • ai-usage-banner.test.tsx: the trial's amber and red words, Start your plan for an admin, "ask an admin" and no links for others.
    • ai-usage-meter.test.tsx:
      • the popover's trial title and used-up line;
      • Start your plan, and no Get more;
      • the trial's toast words and mark.
    • lib/billing/ai-usage.test.ts: the trial's mark, and a plan started in its period warning again.
  • UI text in messages/en.json

🤖 Generated with Claude Code

cihan-gyk and others added 4 commits October 24, 2026 01:06
… 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]>
…e AI usage, on the meter and banners (AI usage display, part 6)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@gkhngyk gkhngyk left a comment

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.

Looks good.

@gkhngyk
gkhngyk merged commit d632ae4 into ansvisor:main Oct 24, 2026
4 of 5 checks passed
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]>
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 24, 2026
ansvisor#1432 is on main (squash-merged), with ansvisor#1429–ansvisor#1436 around it; this
branch's own changes (part 5 and its follow-up) are applied on top.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 24, 2026
ansvisor#1433 is on main (squash-merged), with ansvisor#1429–ansvisor#1436 and ansvisor#1442/ansvisor#1444; this
branch's own change (Send to CMS part 2) is applied on top.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 24, 2026
…library

ansvisor#1438's branch now has main (ansvisor#1429–ansvisor#1436, ansvisor#1442, ansvisor#1444); this branch's own
changes (Send to CMS part 3a) are applied on top.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 24, 2026
…-bulk

ansvisor#1439's branch now has main (ansvisor#1429–ansvisor#1436, ansvisor#1442, ansvisor#1444); this branch's own
change (Send to CMS part 3b) is applied on top.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

2 participants