Skip to content

Conversation

@HarshMN2345
Copy link
Member

@HarshMN2345 HarshMN2345 commented Oct 30, 2025

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

image image

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

  • New Features

    • Added a permission-gated Delete action for individual deployments (visible for specific deployment statuses).
  • Improvements

    • Automatically redirects to the deployments list when deleting the deployment currently being viewed.
    • Unified and updated action button icon placement and visuals (download, redeploy, refresh, terminal) for clearer, more consistent UI.
    • Tightened Delete visibility to narrower deployment statuses (e.g., ready or failed).

@appwrite
Copy link

appwrite bot commented Oct 30, 2025

Console

Project ID: 688b7bf400350cbd60e9

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

Tip

Cursor pagination performs better than offset pagination when loading further pages.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 30, 2025

Walkthrough

The PR adjusts UI icon placements (many ActionMenu items from trailingIcon to leadingIcon), adds icon imports (IconChevronRight, IconTrash), introduces Delete action buttons for deployments (gated by permissions and specific statuses), removes a standalone delete.svelte component, and alters deletion modals to conditionally navigate to the deployments list when the current route references the deleted deployment, returning early to skip the usual invalidation path.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify trailingIconleadingIcon prop changes render correctly and consistently across components.
  • Check new imports (IconChevronRight, IconTrash) are used and do not cause import/packaging issues.
  • Review the new Delete action gating (permission checks and tightened status conditions like "ready" or "failed") for correctness.
  • Confirm the conditional redirect/early-return in deletion modals does not omit necessary cache invalidation or other side effects in callers.
  • Ensure removal of delete.svelte does not leave dangling references or regressions in modal flow.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "fix(functions): align deployment action menu icon placement to match sites and solve error page issue" accurately reflects the primary changes in the changeset. The title makes two clear claims: aligning deployment action menu icon placement and solving an error page issue. The raw summary confirms both aspects are present—multiple files show changes replacing trailingIcon with leadingIcon (in +page.svelte, deployment-[deployment]/+page.svelte, table.svelte, and deploymentActionMenu.svelte), and several files address the deletion flow refactoring (deleteModal.svelte, delete.svelte deletion, deleteDeploymentModal.svelte, and deployment-[deployment]/+page.svelte changes) to resolve the error page when deleting deployments. The title is concise, specific, and provides sufficient detail for a teammate to understand the primary objectives without being vague or generic.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-SER-433-Error-page-shown-when-deleting-deployment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b64a17 and b9b9ce3.

📒 Files selected for processing (3)
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte (3 hunks)
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/table.svelte (3 hunks)
  • src/routes/(console)/project-[region]-[project]/sites/(components)/deploymentActionMenu.svelte (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: e2e
  • GitHub Check: build
🔇 Additional comments (3)
src/routes/(console)/project-[region]-[project]/functions/function-[function]/table.svelte (2)

142-142: LGTM! Icon placement aligned to leading position.

The icon placement changes for Redeploy, Activate, and Delete actions are consistent with the PR objective to align with the sites deployment menu.

Also applies to: 158-158, 185-185


183-196: Inconsistent delete conditions confirmed between functions and sites deployments.

The review comment accurately identified a real divergence:

  • Functions (table.svelte:183): Allows deletion when status is NOT building, processing, or waiting—meaning deletion is permitted in states like ready, failed, cancelled, and error.
  • Sites (deploymentActionMenu.svelte:127): Restricts deletion to only ready or failed states.

This means functions deployments can be deleted in significantly more states than sites deployments. Clarify whether this difference is intentional (e.g., different deletion policies) or if the delete conditions should be aligned.

src/routes/(console)/project-[region]-[project]/sites/(components)/deploymentActionMenu.svelte (1)

127-138: Inconsistency confirmed: Sites deployment delete is more restrictive than functions.

The sites component now allows deletion for only ready and failed statuses (line 127 of deploymentActionMenu.svelte). However, the functions component allows deletion for all statuses except building, processing, and waiting (line 183 of table.svelte)—which includes cancelled and failed, among others.

This creates an inconsistency: deployments in cancelled status can be deleted from functions but not from sites. Confirm whether this difference is intentional or if both components should use aligned deletion conditions.


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: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8bc5fa2 and f09458b.

📒 Files selected for processing (6)
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/(components)/downloadActionMenuItem.svelte (2 hunks)
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/(modals)/deleteModal.svelte (2 hunks)
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/+page.svelte (2 hunks)
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/delete.svelte (2 hunks)
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte (3 hunks)
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/deployments/deleteDeploymentModal.svelte (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-10-13T05:13:54.542Z
Learnt from: ItzNotABug
PR: appwrite/console#2413
File: src/routes/(console)/project-[region]-[project]/databases/table.svelte:33-39
Timestamp: 2025-10-13T05:13:54.542Z
Learning: In Svelte 5, `import { page } from '$app/state'` provides a reactive state proxy that can be accessed directly (e.g., `page.params`), unlike the older `import { page } from '$app/stores'` which returns a readable store requiring the `$page` syntax for auto-subscription in components.

Applied to files:

  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/(components)/downloadActionMenuItem.svelte
📚 Learning: 2025-10-05T09:41:40.439Z
Learnt from: ItzNotABug
PR: appwrite/console#2398
File: src/routes/(console)/verify-email/+page.svelte:48-51
Timestamp: 2025-10-05T09:41:40.439Z
Learning: In SvelteKit 5, `page` imported from `$app/state` is a reactive state object (using runes), not a store. It should be accessed as `page.data` without the `$` prefix, unlike the store-based `$page` from `$app/stores` in earlier versions.

Applied to files:

  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/(components)/downloadActionMenuItem.svelte
📚 Learning: 2025-10-26T10:20:29.792Z
Learnt from: ItzNotABug
PR: appwrite/console#2509
File: src/routes/(console)/project-[region]-[project]/auth/teams/+page.svelte:47-61
Timestamp: 2025-10-26T10:20:29.792Z
Learning: When deleting teams in the Appwrite Console codebase, only `Dependencies.TEAMS` needs to be invalidated. Additional invalidations for `Dependencies.TEAM` (detail route) and `Dependencies.MEMBERSHIPS` are not necessary because the deleted teams and their memberships no longer exist.

Applied to files:

  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/deployments/deleteDeploymentModal.svelte
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: e2e
  • GitHub Check: build
🔇 Additional comments (10)
src/routes/(console)/project-[region]-[project]/functions/function-[function]/delete.svelte (1)

2-3: LGTM!

The imports are necessary for the new redirect logic after deployment deletion.

src/routes/(console)/project-[region]-[project]/functions/function-[function]/(components)/downloadActionMenuItem.svelte (2)

5-5: LGTM!

The IconChevronRight import is necessary for the new trailing icon that indicates the submenu.


16-17: LGTM!

The icon placement change improves UI consistency by moving the primary action icon (Download) to the leading position and adding a chevron to indicate the submenu. This aligns with the broader icon placement standardization across the codebase as described in the PR objectives.

src/routes/(console)/project-[region]-[project]/sites/site-[site]/deployments/deleteDeploymentModal.svelte (1)

31-34: Good use of Promise.all for parallel invalidation.

Wrapping the invalidate calls in Promise.all improves performance when both dependencies need to be refreshed.

src/routes/(console)/project-[region]-[project]/functions/function-[function]/+page.svelte (2)

116-116: LGTM!

The icon placement change aligns the Redeploy button with the broader icon standardization across the UI, moving the primary action icon to the leading position.


137-137: LGTM!

The icon placement change aligns the Build logs link with the broader icon standardization across the UI, moving the primary action icon to the leading position.

src/routes/(console)/project-[region]-[project]/functions/function-[function]/(modals)/deleteModal.svelte (1)

2-3: LGTM!

The imports are necessary for the new redirect logic after deployment deletion.

src/routes/(console)/project-[region]-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte (3)

29-29: LGTM!

The IconTrash import is necessary for the new Delete action button.


107-107: LGTM!

The icon placement change aligns the Redeploy button with the broader icon standardization across the UI.


124-135: LGTM!

The Delete action implementation is well-designed:

  • Properly gated by $canWriteFunctions for permission checks
  • Correctly disabled during active deployment states ('building', 'processing', 'waiting')
  • Uses status="danger" to indicate the destructive nature of the action
  • Follows consistent icon placement patterns with leadingIcon={IconTrash}

functionId: selectedDeployment.resourceId,
deploymentId: selectedDeployment.$id
});
if (page.url.href.includes(`deployment-${selectedDeployment.$id}`)) {
Copy link
Member

Choose a reason for hiding this comment

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

lets just use the route.id and check for deployment-[deployment].

{#if !!data.deployment?.sourceSize || !!data.deployment?.sourceSize}
<DownloadActionMenuItem deployment={data.deployment} {toggle} />
{/if}
{#if $canWriteFunctions && data.deployment.status !== 'building' && data.deployment.status !== 'processing' && data.deployment?.status !== 'waiting'}
Copy link
Member

Choose a reason for hiding this comment

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

we can check if $canWriteFunctions && data.deployment.status === 'available' instead of all inverted checks.

invalidate(Dependencies.DEPLOYMENTS),
invalidate(Dependencies.SITE)
]);
if (page.url.href.includes(`deployment-${selectedDeployment.$id}`)) {
Copy link
Member

Choose a reason for hiding this comment

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

here as well.

Copy link
Member

Choose a reason for hiding this comment

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

this seems to be a duplicate of deleteModal.svelte, I don't see any difference.

@ItzNotABug ItzNotABug merged commit 95528de into main Nov 3, 2025
4 checks passed
@ItzNotABug ItzNotABug deleted the fix-SER-433-Error-page-shown-when-deleting-deployment branch November 3, 2025 07:59
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.

3 participants