Skip to content

Conversation

ndiego
Copy link
Contributor

@ndiego ndiego commented Sep 19, 2025

Proposed Changes

This PR adds a context menu to sites in the sidebar, and was originally designed last year:

image

While a relatively low-priority feature, the context menu is a significant QOL improvement, especially for Studio power users. Simple actions like deleting a site now take three clicks rather than up to five clicks.

This PR does not add new functionality to Studio, such as the "Duplicate site..." option shown in the design mockup above. It simply adds easy access to all the existing functionality in Studio.

Here are the various states:

Stopped Started Starting up (isLoading) Adding Site (isAddingSite)
image image image image

A couple of notes:

  • The "Open in..." options respect the user preferences
  • "Edit site..." will switch to the Settings tab of the correct site and then open up the "Edit site" modal
  • Theoretically, everything should work regardless of operating system, but I do not have a Windows machine to test

Here's a quick video of this feature in action:

studio-context-menu.mp4

Testing Instructions

  • Add a new site if none exist
  • Open the context menu and try all the options

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@ndiego ndiego self-assigned this Sep 19, 2025
@ndiego ndiego requested review from sejas and bcotrim September 19, 2025 14:02
Copy link
Member

@sejas sejas left a comment

Choose a reason for hiding this comment

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

Great work Nick! 🎉
Thanks for adding the site context menu.
I've pushed a commit fixing the tests. I'll take a closer look next week, but feature wise, everything worked smoothly.

One suggestion, what do you think if we leave open site and open wp-admin enabled for stopped sites too?
We could start the site before opening the browser.

Screenshot 2025-09-19 at 20 40 01

@ndiego
Copy link
Contributor Author

ndiego commented Sep 20, 2025

One suggestion, what do you think if we leave open site and open wp-admin enabled for stopped sites too?
We could start the site before opening the browser.

@sejas, good call. I was just following the original design, but the other "Open site" and "WP admin" links in the app start up the site if it has not already been started.

I updated the functionality in d1fa0db

@ndiego ndiego requested a review from sejas September 20, 2025 11:58
Copy link
Member

@sejas sejas left a comment

Choose a reason for hiding this comment

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

@ndiego, thanks for applying my suggestion of starting the site to open the site or wp-admin. It works great.
I reviewed a second time and I think it's super close to be merged. I think it would be awesome to include it in v1.6.0.

I'll investigate a way to remove the setTimeout when opening the modal, and I'll create a PR with a slight modification around that.

I left a suggestion to remove unused parameters. The rest of the code looks and works great.

Could you add a new entry in the release notes?

Unreleased
==========
* Upgraded Playground dependencies to support Playground CLI and make offline site creation faster #1594
* Added support for Sublime Text as a code editor #1723

? `${ site.name.substring( 0, MAX_LENGTH_SITE_TITLE - 3 ) }…`
: site.name;

const { response, checkboxChecked } = await ipcApi.showMessageBox( {
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to be repeating a bunch of code from delete-site.tsx. Do you think we should extract it at this point?

Copy link
Member

Choose a reason for hiding this comment

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

I extracted the common code into a new hook: bb8cf40

…#1807)

* Remove setTimeout and move edit modal state to site-content-tabs

* Move the edit modal is open state to use site details context

* fix tests

* fix tests
@sejas
Copy link
Member

sejas commented Sep 25, 2025

@ndiego, do you want to continue working on this PR, or would you prefer that I push a few changes? I think the main change left is unifying the delete site logic.

@ndiego
Copy link
Contributor Author

ndiego commented Oct 7, 2025

Closing the loop here. Passing this off to you @sejas 🙏

@sejas sejas requested review from wojtekn and a team October 9, 2025 11:31
@sejas
Copy link
Member

sejas commented Oct 9, 2025

@ndiego , @wojtekn , Could you review the PR again? I've addressed all the feedback and I think it's ready to merge.

Copy link

github-actions bot commented Oct 9, 2025

📊 Performance Test Results

Comparing 7798813 vs trunk

site-editor

Metric trunk 7798813 Diff Change
load 14266.00 ms 13238.00 ms -1028.00 ms 🟢 -7.2%

site-startup

Metric trunk 7798813 Diff Change
siteCreation 17236.00 ms 18138.00 ms +902.00 ms 🔴 5.2%
siteStartup 5949.00 ms 5007.00 ms -942.00 ms 🟢 -15.8%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change

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