Skip to content

Remove: archiving#2834

Open
ItzNotABug wants to merge 9 commits intomainfrom
remove-archives
Open

Remove: archiving#2834
ItzNotABug wants to merge 9 commits intomainfrom
remove-archives

Conversation

@ItzNotABug
Copy link
Member

@ItzNotABug ItzNotABug commented Feb 5, 2026

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

    • Non-active projects now redirect to their parent organization for clearer navigation.
  • Refactor

    • Removed archived-projects UI, selection dialogs, and related alerts; project lists now show active projects only.
    • Removed project-limit advisory checks and related alert UI.
    • Simplified project fetching and paging flows.
    • Downgrade flow now deletes excess projects to enforce plan limits instead of archiving.

update: redirect to org page when the project is not active.
@ItzNotABug ItzNotABug self-assigned this Feb 5, 2026
@appwrite
Copy link

appwrite bot commented Feb 5, 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

Global CDN and DDoS protection come free with every Sites deployment

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This 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)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Remove: archiving' directly and clearly summarizes the main objective of the changeset, which is the removal of archiving functionality across multiple components and files.
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 remove-archives

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: 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 | 🟡 Minor

Unused organization prop in Props type.

The organization property is declared in the Props type (line 21) but not destructured from $props() on line 24. The component uses $organization from 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.total with optional chaining, while lines 52 and 60 access data.projects.total directly. Since data.projects is 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` });

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: 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: Unused organization prop in type definition.

The organization property is defined in Props but never destructured from $props(). The component uses the $organization store 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;
 };

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.

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 | 🔴 Critical

Bug: validateOrAlert blocks downgrade even when project limit is not exceeded.

When the user has fewer projects than allowedProjectsToKeep, selectedProjects is empty (length 0), so filteredSelection.length === allowedProjectsToKeep is false, and the function returns false. 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` });

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.

1 participant