Skip to content

Add ability to start all stopped sites#2548

Merged
wojtekn merged 2 commits intotrunkfrom
wojtekn/start-all-sites
Feb 6, 2026
Merged

Add ability to start all stopped sites#2548
wojtekn merged 2 commits intotrunkfrom
wojtekn/start-all-sites

Conversation

@wojtekn
Copy link
Copy Markdown
Contributor

@wojtekn wojtekn commented Feb 6, 2026

Related issues

Proposed Changes

I propose to add an ability to start all stopped sites. I kept "Start all" only for case in which no sites are running, and "Stop all" for all other cases to keep UI simple.

CleanShot 2026-02-06 at 14 01 29 CleanShot 2026-02-06 at 14 01 47 CleanShot 2026-02-06 at 14 02 24

Testing Instructions

  1. Create 2+ sites in the app
  2. Stop all sites — verify "Start all" button appears in sidebar
  3. Click "Start all" — verify all sites start
  4. Stop some sites — verify "Stop all" button is shown and "Start" is disabled

@wojtekn wojtekn self-assigned this Feb 6, 2026
@wojtekn wojtekn requested a review from a team February 6, 2026 13:07
@wpmobilebot
Copy link
Copy Markdown
Collaborator

wpmobilebot commented Feb 6, 2026

📊 Performance Test Results

Comparing e38caf7 vs trunk

site-editor

Metric trunk e38caf7 Diff Change
load 2747.00 ms 2767.00 ms +20.00 ms 🔴 0.7%

site-startup

Metric trunk e38caf7 Diff Change
siteCreation 7080.00 ms 7085.00 ms +5.00 ms 🔴 0.1%
siteStartup 3928.00 ms 3939.00 ms +11.00 ms 🔴 0.3%

Results are median values from multiple test runs.

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

Copy link
Copy Markdown
Contributor

@gcsecsey gcsecsey left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @wojtekn, it's a very useful small enhancement. 🙌

The changes LGTM and when testing starting/stopping sites, it works well.

All sites stopped Some sites stopped All sites started
Image Image Image

Comment thread src/components/running-sites.tsx Outdated
<div className="flex flex-row px-5 pb-1 justify-between align-center self-stretch opacity-70">
<p className="text-xxs leading-4">
{ sprintf(
_n( '%d site running', '%d sites running', runningSites.length ),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This label was earlier only shown when any site was started, but now 0 sites running are shown by default. Maybe we could handle this case separately and show a No sites running label?

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, I changed it in e38caf7 so we will keep the current behavior. I will keep the opposite case as is, as it is a nice indicator of the number of all sites.

Copy link
Copy Markdown
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.

I confirm I'm able to start all the sites. The button is visible only if all the sites are stopped.
Code looks good. It iterates for each site and call startServer for each.
https://github.com/user-attachments/assets/64ac3441-0453-493c-9c91-4f5a3074081e

Copy link
Copy Markdown
Contributor

@bcotrim bcotrim left a comment

Choose a reason for hiding this comment

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

LGTM 👍
I wonder if we could add a studio site start --all similar to the existing studio site stop --all command, to keep CLI parity.
This discussion could be a follow up PR, if we decide to implement it, since the current change works perfectly already

@wojtekn wojtekn merged commit b21955f into trunk Feb 6, 2026
10 checks passed
@wojtekn wojtekn deleted the wojtekn/start-all-sites branch February 6, 2026 16:06
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.

5 participants