Skip to content

fix: Disable redeploy button when sourceSize is 0 #2136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hmacr
Copy link

@hmacr hmacr commented Jul 21, 2025

What does this PR do?

Following the pattern established in DeploymentActionMenu, this PR hides the Redeploy action/button in other places when sourceSize is 0.

Test Plan

Manual QA: verified Redeploy button is hidden when deployment sourceSize is 0.

Related PRs and Issues

#1894 where Redeploy item was first hidden in DeploymentActionMenu.

@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Jul 21, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-07-21 11:26:07 CET

@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Jul 21, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-07-21 11:26:07 CET

@@ -98,7 +98,7 @@
</Button>
<svelte:fragment slot="menu" let:toggle>
<ActionMenu.Root>
{#if $canWriteFunctions}
{#if $canWriteFunctions && activeDeployment.sourceSize !== 0}
Copy link
Contributor

Choose a reason for hiding this comment

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

Hiding it all-together is considered bad UX, as it doesn't explain why it's sometimes disappearing. Also can cause trouble to feature discoverability.

Instead, let's just set it disabled: https://github.com/appwrite/console/blob/8381af6982a1eff132b1e40cccf6bc2ba3d508d4/src/routes/(console)/project-[region]-[project]/functions/function-[function]/(components)/downloadActionMenuItem.svelte#L26-L33

Also, let's add tooltip to explain why it's disabled, It could say something like Source is empty.

Please also add tooltip to download button I linked above, it seems to be missing it too.

Copy link
Author

Choose a reason for hiding this comment

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

I agree disabling is much better than hiding. Since the existing pattern hid the button, I extended the same.
I'll make the change to disable all the instances.

@hmacr hmacr changed the title fix: Hide redeploy button when sourceSize is 0 fix: Disable redeploy button when sourceSize is 0 Jul 22, 2025
@hmacr hmacr requested a review from Meldiron July 22, 2025 04:08
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