fix(frontend): keep billing limit banner above settings drawer and show plan exhausted card - #5693
fix(frontend): keep billing limit banner above settings drawer and show plan exhausted card#5693NicholasKissel wants to merge 2 commits into
Conversation
…ow plan exhausted card Amp-Thread-ID: https://ampcode.com/threads/T-01a08c94-38c3-73bc-b299-ca37f85109d4
|
🚅 Deployed to the actors-pr-5693 environment in rivet-frontend
|
| // metered metrics and the compute budget). Paid plans just bill overage, so | ||
| // only the free plan gets the call-out. The names list which allotments ran | ||
| // out so the user knows what to look at in the table below. | ||
| const planExhausted = plan === "free" && usage.highestPercent >= 100; |
There was a problem hiding this comment.
🟠 Medium · Keep the exhausted-plan card in sync after an upgrade
The plan picker invalidates only the billing-details query on a successful plan change; the usage query that supplies usage.plan is left cached. After a free project upgrades, the banner will disappear from the refreshed details response, but this new card continues rendering from the cached usage.plan === "free" (and old usage) until a later refetch such as focus.
Invalidate the current-project billing-usage query along with billing details after changing a plan, or drive this card from the refreshed plan state.
| root.style.removeProperty("--billing-banner-height"); | ||
| }; | ||
| }, [hidden]); | ||
| return { |
There was a problem hiding this comment.
instead of switching this back to be passed around as a business value, we should use useLayoutEffect, and fix the z-index issues, css property was fine since you're passing in on the CSS layer (its not part of the business logic, its translucent, do not need to be passed around)
There was a problem hiding this comment.
Done in 1ead3f8. Restored the CSS variable, set it from a useLayoutEffect, and moved the drawer to z-40 with the banner at z-[45] so the banner stacks above the drawer and below z-50 popovers and dialogs.
ReviewOverall a focused fix: the layering/timing issue (banner vs. drawer 1. Duplicate 2. 3. Missing Ladle story for 4. Minor: effect-based cross-component layering (pre-existing pattern, not newly introduced) Nit Testing 🤖 Generated with Claude Code |
… it above the settings drawer Amp-Thread-ID: https://ampcode.com/threads/T-01a08c94-38c3-73bc-b299-ca37f85109d4
Description
Type of change
How Has This Been Tested?
Loaded the dashboard with mocked billing responses at 85% and 477% usage and confirmed the banner sits above the drawer in both cases, the exhausted card only appears at 100% or more, and the OSS flavor without billing renders unchanged.
Checklist: