Skip to content

feat: enforce custom domain plan limits in UI#2974

Merged
HarshMN2345 merged 3 commits intomainfrom
feat-custom-domain-limits-enforcement
Apr 15, 2026
Merged

feat: enforce custom domain plan limits in UI#2974
HarshMN2345 merged 3 commits intomainfrom
feat-custom-domain-limits-enforcement

Conversation

@HarshMN2345
Copy link
Copy Markdown
Member

What does this PR do?

(Provide a description of what this PR does.)

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.)

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 13, 2026

Greptile Summary

This PR enforces custom domain plan limits in the UI by adding domains to the PlanServices type, wiring up isServiceLimited checks, and wrapping "Add domain" buttons in Tooltip/disabled states across four pages. It also migrates the org-level domains page to Svelte 5 runes and improves the planComparisonBox to surface domain limits.

  • The functions (function-[function]/domains) and sites (site-[site]/domains) pages both pass data.proxyRules.total — scoped to the current resource only — to isServiceLimited, while checkForProjectLimitation classifies domains as a per-project limit. A user can bypass the cap by distributing domains across multiple functions or sites within the same project.

Confidence Score: 4/5

Not safe to merge until the per-resource vs. per-project count mismatch in the functions and sites domain pages is resolved.

One P1 logic defect: both the function and site domain pages pass a per-resource proxy rule count to a per-project limit check, meaning the cap can be silently bypassed by distributing domains across multiple resources. All other changes (billing.ts type extension, planComparisonBox, settings/domains, org/domains rune migration) are clean.

src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/+page.svelte and src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.svelte

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/functions/function-[function]/domains/+page.svelte Adds domain limit enforcement with Tooltip + disabled Button, but uses per-function proxy rule count against a per-project limit, allowing the limit to be bypassed across multiple functions/sites.
src/routes/(console)/project-[region]-[project]/sites/site-[site]/domains/+page.svelte Same per-resource count vs. per-project limit mismatch as the functions domains page — data.proxyRules.total is scoped to the current site only.
src/routes/(console)/project-[region]-[project]/settings/domains/+page.svelte Correctly adds domain limit enforcement using project-wide API-type rule count; Svelte 5 runes syntax already in use.
src/routes/(console)/organization-[organization]/domains/+page.svelte Migrates state declarations to Svelte 5 runes ($props, $state); correctly omits domain limit enforcement at the org level to avoid cross-project scope issues raised in prior review.
src/lib/stores/billing.ts Adds 'domains' to PlanServices union and checkForProjectLimitation switch — straightforward and correct.
src/lib/components/billing/planComparisonBox.svelte Adds domain limit/unlimited display to both list styles; logic is internally consistent with the existing pattern.

Reviews (2): Last reviewed commit: "fix: greptile comments" | Re-trigger Greptile

Comment thread src/routes/(console)/organization-[organization]/domains/+page.svelte Outdated
Comment thread src/routes/(console)/organization-[organization]/domains/+page.svelte Outdated
@HarshMN2345 HarshMN2345 requested a review from Meldiron April 13, 2026 07:10
@HarshMN2345 HarshMN2345 merged commit b2c12f8 into main Apr 15, 2026
4 of 5 checks passed
@HarshMN2345 HarshMN2345 deleted the feat-custom-domain-limits-enforcement branch April 15, 2026 10:51
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