Skip to content

Disable Copy and Delete in context menu when any site is being added#2596

Merged
wojtekn merged 1 commit intotrunkfrom
stu-1298-context-menu-disabled-states
Feb 18, 2026
Merged

Disable Copy and Delete in context menu when any site is being added#2596
wojtekn merged 1 commit intotrunkfrom
stu-1298-context-menu-disabled-states

Conversation

@sejas
Copy link
Member

@sejas sejas commented Feb 16, 2026

Related issues

Proposed Changes

The Settings tab disables "Copy site" and "Delete site" for all sites when any site is being created (sites.some(site => site.isAddingSite)), but the right-click context menu only checked site.isAddingSite for the individual site. This created an inconsistency where right-clicking Site B while Site A was being created showed Copy/Delete as enabled.

  • Added isAnySiteAdding (computed from sites.some(s => s.isAddingSite)) in the renderer and pass it to the main process via showSiteContextMenu()
  • Use isAnySiteAdding instead of isAddingSite for the "Copy site" and "Delete site" enabled conditions
  • Per-site isAddingSite continues to be used for all other menu items (Start, Stop, Open, etc.)

Testing Instructions

  1. Start the app with npm start
  2. Create a new site
  3. While the site is being created, right-click another existing site in the left sidebar
  4. Verify "Copy site…" and "Delete site…" are greyed out and disabled
  5. Verify other menu items (Stop, Open site, WP admin, etc.) remain enabled
  6. Once site creation completes, verify all menu items return to normal
copy-and-delete-sites-are-disabled.mp4

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors? (Tests pass, no errors)

The Settings tab disables these actions for all sites when any site is
being created, but the right-click context menu only checked the
individual site. Pass isAnySiteAdding from the renderer to the main
process so Copy and Delete are consistently greyed out.
@sejas sejas self-assigned this Feb 16, 2026
@sejas sejas requested a review from a team February 16, 2026 20:06
@sejas sejas marked this pull request as ready for review February 16, 2026 20:06
@sejas sejas changed the title Disable Copy/Delete in context menu when any site is being added Disable Copy and Delete in context menu when any site is being added Feb 16, 2026
Copy link
Contributor

@ivan-ottinger ivan-ottinger left a comment

Choose a reason for hiding this comment

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

The change looks good and works as expected. 👍🏼

CleanShot.2026-02-17.at.10.24.49.mp4

I have asked myself the same question as you did in the related task:

Although I wonder if we should enable the delete and copy site menu items in site settings. I don't see any issue of adding or removing other sites.

When testing, I did not observe any issues with deleting or copying a site while another site is being created.

Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

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

Thanks @sejas for solving this! I have tested it, and it works as expected. Copy and Delete site menu items are disabled when a site is being created. Changes LGTM! :shipit:

Image

@wojtekn wojtekn merged commit 33d6486 into trunk Feb 18, 2026
9 checks passed
@wojtekn wojtekn deleted the stu-1298-context-menu-disabled-states branch February 18, 2026 07:57
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.

4 participants