feat: add dedicated 402 budget limit error page#3052
Conversation
Replace generic error display for 402 responses with a dedicated budget limit error page. Includes a 'Go to billing' CTA when an organization is in context, and a 'Change organization' secondary action on both console-level and project-level error pages.
Greptile SummaryThis PR replaces the generic error display for HTTP 402 responses with a dedicated "billing limit reached" page in both the console-level and project-level error boundaries. Each page shows a styled badge, an error message, a conditional "Go to billing" CTA, and a "Change organization" fallback button.
Confidence Score: 5/5Safe to merge — the changes are additive UI-only modifications to error boundary pages with no shared state mutations or breaking contract changes. Both error pages add a straightforward conditional branch for 402 responses. The billing URL derivation logic is simple and fails safely (null → no button rendered). The console-level file correctly uses Svelte 5 runes; the project-level file's legacy syntax is a pre-existing concern already raised in a prior review thread. No data-layer or auth-path changes are present. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix: use backend error message on 402 bi..." | Re-trigger Greptile |
| $: orgId = $organization?.$id; | ||
| $: billingUrl = orgId ? `${base}/organization-${orgId}/billing` : null; | ||
| $: isPaymentError = page.status === 402; |
There was a problem hiding this comment.
Svelte 4 reactive declarations on a touched file
The three new reactive statements use legacy $: syntax (Svelte 4), but AGENTS.md requires migrating a file to Svelte 5 runes when it is modified ("When touching a file, migrate it to runes if practical. Don't mix syntaxes within a single component."). The sibling (console)/+error.svelte was already in runes mode and uses $derived for the equivalent variables; keeping this file on $: means the two error pages diverge in style unnecessarily. The existing $: statements for allOrgsHavePremiumSupport and hasPremiumSupport should also be converted as part of the same pass.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
402 can be triggered by various billing limits, not only budget caps. Update copy to reflect this.
Replace generic error display for 402 responses with a dedicated budget limit error page. Includes a 'Go to billing' CTA when an organization is in context, and a 'Change organization' secondary action on both console-level and project-level error pages.
What does this PR do?
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)