Conversation
update: redirect to org page when the project is not active.
Console (appwrite/console)Project ID: Tip Global CDN and DDoS protection come free with every Sites deployment |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThis PR removes the project-archival feature and related UI/alerts: deleted components src/lib/components/archiveProject.svelte, src/lib/components/billing/alerts/projectsLimit.svelte, and src/lib/components/billing/alerts/selectProjectCloud.svelte; removed checkForProjectsLimit from src/lib/stores/billing.ts and its usage in the console layout; renamed archive-related variables/messages to “delete” in organizationUsageLimits and updated the downgrade/change-plan flow to delete excess projects instead of archiving; simplified organization page loader/UI to fetch and display only active projects (removed archived paging and UI); updated imports/resolve usage and added an early redirect for non-active projects to their organization page. Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/lib/components/organizationUsageLimits.svelte (1)
17-24:⚠️ Potential issue | 🟡 MinorUnused
organizationprop in Props type.The
organizationproperty is declared in thePropstype (line 21) but not destructured from$props()on line 24. The component uses$organizationfrom the store (line 268) instead of the prop.Either remove the unused prop from the type definition, or destructure and use it if it was intended to override the store value.
🧹 Option 1: Remove unused prop from type
type Props = { storageUsage?: number; projects?: Models.Project[]; members?: Models.Membership[]; - organization: Models.Organization; }; - const { projects = [], members = [], storageUsage = 0 }: Props = $props(); + const { projects = [], members = [], storageUsage = 0 } = $props<Props>();
🧹 Nitpick comments (2)
src/routes/(console)/organization-[organization]/+page.svelte (1)
121-121: Consider consistency in optional chaining usage.This line uses
data?.projects.totalwith optional chaining, while lines 52 and 60 accessdata.projects.totaldirectly. Sincedata.projectsis guaranteed from the page loader, the optional chaining here is defensive but inconsistent with nearby usage.♻️ Optional: Align optional chaining usage
- const activeProjectsTotal = $derived(data?.projects.total); + const activeProjectsTotal = $derived(data.projects.total);src/lib/components/organizationUsageLimits.svelte (1)
122-122: Minor grammar improvement."Projects selected for deleting" reads awkwardly. Consider using "deletion" for better grammar.
📝 Suggested fix
- addNotification({ type: 'success', message: `Projects selected for deleting` }); + addNotification({ type: 'success', message: `Projects selected for deletion` });
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/lib/components/organizationUsageLimits.svelte`:
- Around line 57-61: The excessUsage.projects calculation is missing subtraction
of the free plan limit; update the derived value for projects inside the
$derived block (excessUsage) to compute Math.max(0, currentUsage.projects -
freePlanLimits.projects) so it mirrors the logic used for members and storage
and only shows projects exceeding the limit.
- Around line 307-313: The Alert.Inline title currently contains raw HTML tags
which will render literally; update the Alert.Inline usage so the title prop
contains plain text only (e.g., remove the <b> tags and any HTML around
toLocaleDate($organization.billingNextInvoiceDate) and messagePrefix) and move
any bold/HTML formatting into the component body/default slot where you can use
Svelte markup to wrap formatProjectsToDelete() and the date in <b> or other
styling; specifically modify the Alert.Inline instance (title prop,
toLocaleDate, $organization.billingNextInvoiceDate, and
formatProjectsToDelete()) so the title is plain text and the formatted content
is rendered inside the Alert.Inline children.
🧹 Nitpick comments (1)
src/lib/components/organizationUsageLimits.svelte (1)
17-24: Unusedorganizationprop in type definition.The
organizationproperty is defined inPropsbut never destructured from$props(). The component uses the$organizationstore instead (lines 271, 309). Consider removing it from the Props type to avoid confusion for consumers of this component.♻️ Proposed fix
type Props = { storageUsage?: number; projects?: Models.Project[]; members?: Models.Membership[]; - organization: Models.Organization; };
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/lib/components/organizationUsageLimits.svelte (1)
95-101:⚠️ Potential issue | 🔴 CriticalBug:
validateOrAlertblocks downgrade even when project limit is not exceeded.When the user has fewer projects than
allowedProjectsToKeep,selectedProjectsis empty (length 0), sofilteredSelection.length === allowedProjectsToKeepisfalse, and the function returnsfalse. This would prevent the parent from proceeding with the downgrade even though no project selection is needed.The validation should short-circuit when there's no excess:
🐛 Proposed fix
export function validateOrAlert(): boolean { + if (!isLimitExceeded.projects) return true; const filteredSelection = selectedProjects.filter((id) => projects.some((p) => p.$id === id) ); const isValid = filteredSelection.length === allowedProjectsToKeep; showSelectionReminder = !isValid && isLimitExceeded.projects; return isValid; }
🧹 Nitpick comments (1)
src/lib/components/organizationUsageLimits.svelte (1)
122-122: Nit: "deleting" → "deletion" for grammatical correctness.- addNotification({ type: 'success', message: `Projects selected for deleting` }); + addNotification({ type: 'success', message: `Projects selected for deletion` });

What does this PR do?
Removes archiving based on latest cloud changes.
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
Refactor