Skip to content

Remove: archiving#2834

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

Remove: archiving#2834
ItzNotABug wants to merge 6 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.
    • Removed project-limit advisory checks and project-limit alert UI.
    • Simplified project listing to show active projects only and streamlined paging.
    • Updated usage messaging to refer to deleting excess projects (text updates).

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

Trigger functions via HTTP, SDKs, events, webhooks, or scheduled cron jobs

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

Warning

Rate limit exceeded

@ItzNotABug has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 52 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

This PR removes the project archival feature and related alerts: deletes components src/lib/components/archiveProject.svelte, src/lib/components/billing/alerts/projectsLimit.svelte, and src/lib/components/billing/alerts/selectProjectCloud.svelte; removes checkForProjectsLimit from src/lib/stores/billing.ts and its invocation from layout; renames archive-related variables/messages to "delete" in organizationUsageLimits; simplifies organization page loader and UI to fetch/display only active projects and removes archived-project UI and selection flows; updates routing/imports (resolve usage) and adds 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' accurately summarizes the main change: deletion of archiving-related components and functionality across the codebase.
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;
 };

Comment on lines +57 to 61
const excessUsage = $derived({
projects: Math.max(0, currentUsage.projects),
members: Math.max(0, currentUsage.members - freePlanLimits.members),
storage: Math.max(0, storageUsageGB - freePlanLimits.storage)
});
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 | 🔴 Critical

Bug: excessUsage.projects calculation is inconsistent and incorrect.

The projects property doesn't subtract freePlanLimits.projects, unlike members and storage. This means the "Excess usage" column (line 187) will display the total project count instead of projects exceeding the limit.

For example: with 5 projects and a limit of 2, the UI would show "5 projects" excess instead of "3 projects".

🐛 Proposed fix
 const excessUsage = $derived({
-    projects: Math.max(0, currentUsage.projects),
+    projects: Math.max(0, currentUsage.projects - freePlanLimits.projects),
     members: Math.max(0, currentUsage.members - freePlanLimits.members),
     storage: Math.max(0, storageUsageGB - freePlanLimits.storage)
 });
🤖 Prompt for AI Agents
In `@src/lib/components/organizationUsageLimits.svelte` around lines 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.

Comment on lines 307 to 313
<Alert.Inline
status="warning"
title={`${messagePrefix} will be archived on ${toLocaleDate($organization.billingNextInvoiceDate)}`}>
{formatProjectsToArchive()} will be archived
status="error"
title={`${messagePrefix} will be permanently deleted on <b>${toLocaleDate($organization.billingNextInvoiceDate)}</b>`}>
<b>{formatProjectsToDelete()}</b> and all associated data, including databases,
storage, functions, and users, will be <b>permanently deleted</b>.
<b>This action is irreversible</b>.
</Alert.Inline>
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 | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Search for package.json to check pink-svelte version
fd package.json | xargs grep -l "pink-svelte" 2>/dev/null | head -5

Repository: appwrite/console

Length of output: 72


🏁 Script executed:

# Look for Alert.Inline usage patterns in the codebase
rg "Alert\.Inline" -A 3 -B 1 --max-count 20

Repository: appwrite/console

Length of output: 50373


🏁 Script executed:

# Check if Alert component documentation or types exist locally
fd -e d.ts -e ts | xargs grep -l "Alert" 2>/dev/null | grep -i alert | head -10

Repository: appwrite/console

Length of output: 158


🏁 Script executed:

# Look for Alert component in node_modules or source
find . -path ./node_modules -prune -o -name "*.svelte" -print | xargs rg -l "Alert" | grep -i alert | head -20

Repository: appwrite/console

Length of output: 846


🏁 Script executed:

# Search for Alert component export or definition
rg "export.*Alert|component Alert" -t svelte -t ts -A 5 | head -100

Repository: appwrite/console

Length of output: 90


🏁 Script executed:

# Check package.json for pink-svelte version and location
cat package.json | grep -A 2 -B 2 "pink-svelte"

Repository: appwrite/console

Length of output: 402


🏁 Script executed:

# Look for pink-svelte in the repo to understand where it's from
find . -type d -name "*pink*" 2>/dev/null | head -20

Repository: appwrite/console

Length of output: 909


🏁 Script executed:

# List the Alert component files in pink-svelte
find ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte -name "*lert*" -o -name "index*" 2>/dev/null | head -20

Repository: appwrite/console

Length of output: 3662


🏁 Script executed:

# Get the structure of pink-svelte
ls -la ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte/ 2>/dev/null | head -30

Repository: appwrite/console

Length of output: 409


🏁 Script executed:

# Look for Alert component in dist or src
find ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte -type f \( -name "*.svelte" -o -name "*.ts" -o -name "*.d.ts" \) 2>/dev/null | xargs grep -l "Alert" | head -10

Repository: appwrite/console

Length of output: 233


🏁 Script executed:

# Check the Alert component type definitions and implementation
cat ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte/dist/alert/index.d.ts

Repository: appwrite/console

Length of output: 243


🏁 Script executed:

# Check the Alert component JS implementation
cat ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte/dist/alert/index.js | head -100

Repository: appwrite/console

Length of output: 178


🏁 Script executed:

# List all files in alert directory
ls -la ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte/dist/alert/

Repository: appwrite/console

Length of output: 559


🏁 Script executed:

# Check the Inline.svelte component implementation
cat ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte/dist/alert/Inline.svelte

Repository: appwrite/console

Length of output: 3826


🏁 Script executed:

# Also check the type definitions
cat ./node_modules/.pnpm/@appwrite.io+pink-svelte@https+++pkg.vc+-+@appwrite+@appwrite.io+pink-svelte@dd7e01c_svelte@5.49.2/node_modules/@appwrite.io/pink-svelte/dist/alert/Inline.svelte.d.ts

Repository: appwrite/console

Length of output: 776


Remove HTML tags from Alert.Inline title or move formatted content to the body slot.

The title prop in Alert.Inline renders text as plain content without HTML support. The <b> tags in the title will display as literal text in the UI instead of rendering as bold formatting. Either remove the HTML tags from the title or place the formatted content in the default slot instead.

🤖 Prompt for AI Agents
In `@src/lib/components/organizationUsageLimits.svelte` around lines 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.

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