Skip to content

fix: make project limit alert program-aware#2850

Merged
HarshMN2345 merged 1 commit intomainfrom
fix-project-limit-alert-not-hidden-for-special-programs
Feb 11, 2026
Merged

fix: make project limit alert program-aware#2850
HarshMN2345 merged 1 commit intomainfrom
fix-project-limit-alert-not-hidden-for-special-programs

Conversation

@HarshMN2345
Copy link
Member

@HarshMN2345 HarshMN2345 commented Feb 11, 2026

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

Summary by CodeRabbit

  • Bug Fixes
    • Refined free-plan alert display logic to show under more specific conditions and now dynamically displays the correct project limit for the user's plan instead of a hard-coded value.

@appwrite
Copy link

appwrite bot commented Feb 11, 2026

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

SSR frameworks are fully supported with configurable build runtimes

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Walkthrough

A Svelte component for an organization console page is modified to refine the free-plan alert display logic. An additional guard condition is added that checks if data.program is falsy before rendering the alert, further restricting its visibility. The alert message is updated to dynamically display the project limit from data.currentPlan?.projects rather than a hard-coded value. Alert actions and dismissal behavior remain unchanged. The net change spans 3 additions and 3 removals across the single file.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding program awareness to the project limit alert logic to determine when it displays.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-project-limit-alert-not-hidden-for-special-programs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/routes/`(console)/organization-[organization]/+page.svelte:
- Around line 222-226: The conditional renders an alert when data.currentPlan
may be undefined because `data.currentPlan?.projects !== 0` is true for
undefined; change the guard to ensure projects is present and non-zero (e.g.,
check `data.currentPlan?.projects` truthiness or explicitly
`data.currentPlan?.projects > 0`) so the Alert.Inline/Tyography.Text never shows
"up to undefined projects"; update the condition in the same expression that
uses isCloud, data.currentPlan?.projects, projectsToArchive.length,
freePlanAlertDismissed and keep dismissFreePlanAlert behavior unchanged.

Comment on lines +222 to +226
{#if isCloud && !data.program && data.currentPlan?.projects !== 0 && projectsToArchive.length === 0 && !freePlanAlertDismissed}
<Alert.Inline dismissible on:dismiss={dismissFreePlanAlert}>
<Typography.Text
>Your Free plan includes up to 2 projects and limited resources. Upgrade to unlock
more capacity and features.</Typography.Text>
>Your Free plan includes up to {data.currentPlan?.projects} projects and limited resources.
Upgrade to unlock more capacity and features.</Typography.Text>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Minor: undefined !== 0 is true — the guard doesn't protect against a missing currentPlan.

If data.currentPlan were ever null/undefined, the check data.currentPlan?.projects !== 0 evaluates to undefined !== 0true, so the alert would render with the text "up to undefined projects". This is likely safe in practice (cloud layouts should always load currentPlan), but a small tweak makes it more robust:

Suggested defensive tweak
-    {`#if` isCloud && !data.program && data.currentPlan?.projects !== 0 && projectsToArchive.length === 0 && !freePlanAlertDismissed}
+    {`#if` isCloud && !data.program && data.currentPlan?.projects && projectsToArchive.length === 0 && !freePlanAlertDismissed}

Using truthiness (data.currentPlan?.projects is falsy for both 0 and undefined/null) collapses the two failure modes into one check and avoids rendering "undefined" in the message.

🤖 Prompt for AI Agents
In `@src/routes/`(console)/organization-[organization]/+page.svelte around lines
222 - 226, The conditional renders an alert when data.currentPlan may be
undefined because `data.currentPlan?.projects !== 0` is true for undefined;
change the guard to ensure projects is present and non-zero (e.g., check
`data.currentPlan?.projects` truthiness or explicitly
`data.currentPlan?.projects > 0`) so the Alert.Inline/Tyography.Text never shows
"up to undefined projects"; update the condition in the same expression that
uses isCloud, data.currentPlan?.projects, projectsToArchive.length,
freePlanAlertDismissed and keep dismissFreePlanAlert behavior unchanged.

@HarshMN2345 HarshMN2345 merged commit 7070a0a into main Feb 11, 2026
4 checks passed
@HarshMN2345 HarshMN2345 deleted the fix-project-limit-alert-not-hidden-for-special-programs branch February 11, 2026 09:36
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