Skip to content

Clarify quit-sites dialog options and move auto-start to app.json - #3837

Merged
bcotrim merged 10 commits into
trunkfrom
stu-1778-clarify-stop-sites-on-quit
Jun 23, 2026
Merged

Clarify quit-sites dialog options and move auto-start to app.json#3837
bcotrim merged 10 commits into
trunkfrom
stu-1778-clarify-stop-sites-on-quit

Conversation

@bcotrim

@bcotrim bcotrim commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Used Claude Code to trace the quit / auto-start flow end to end, implement the new dialog, relocate the auto-start flag, and write the migration and tests. I reviewed the full diff, iterated on the dialog copy and button layout, and ran typecheck, lint, the unit suites, and manual verification.

Proposed Changes

When you quit Studio with running sites, the dialog used to offer a single Stop sites action — but it stopped the sites and then silently auto-restarted them on the next launch. So you'd ask to stop them, reopen Studio, and find them running again. Confusing enough that the team kept tripping over it (see the issue thread).

This replaces that one ambiguous action with three explicit choices, so what you pick is what you get:

  • Leave running — sites keep running while Studio is closed.
  • Auto-start — sites stop now and restart when you reopen Studio (the old "Stop sites" behavior).
  • Stop — sites stop and stay stopped next time you open Studio.

It also moves the auto-start flag to where it conceptually belongs. Auto-start is a desktop-launch concern — only Studio's launch ever acts on it — yet it lived in CLI-owned config. It now lives in the desktop app's own storage, and the CLI no longer reads, writes, or accepts an auto-start flag. A one-time migration relocates the flag (and converts the old quit preference) for existing users, so nothing is lost on upgrade.

Known minor behavior change: starting a site from the CLI while Studio is closed no longer pre-flags it for auto-start (the site is running anyway, so nothing visible changes). Starting a site from the CLI while Studio is open is unaffected.

Testing Instructions

While Studio is closed, confirm site state with node apps/cli/dist/cli/main.mjs site list or by visiting the site URL — not the Studio UI, which auto-starts sites on reopen.

  • Start two sites, then quit and try each option, reopening between runs:
    • Stop → offline while closed, stays stopped on reopen.
    • Auto-start → offline while closed, restarts on reopen.
    • Leave runningonline while closed, still running on reopen.
    • Cancel → Studio stays open.
  • Stop a single site by hand, then quit with Leave running → that site does not come back on reopen.
  • Tick Don't ask again with a choice → the next quit skips the dialog and honors it.
  • Create a new site, quit with Auto-start, reopen → it restarts.
  • Upgrade path: an existing install with running-site auto-start keeps it after the migration, and the old quit preference is converted.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors? — npm run typecheck and eslint are clean; the CLI + Studio unit suites pass (incl. a new migration test).
@bcotrim
bcotrim marked this pull request as ready for review June 16, 2026 09:25
@bcotrim
bcotrim requested review from a team, fredrikekelund and nightnei June 16, 2026 09:25
@wpmobilebot

wpmobilebot commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 9debe76 vs trunk

app-size

Metric trunk 9debe76 Diff Change
App Size (Mac) 2341.84 MB 2341.85 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 9debe76 Diff Change
load 763 ms 1060 ms +297 ms 🔴 38.9%

site-startup

Metric trunk 9debe76 Diff Change
siteCreation 6531 ms 6502 ms 29 ms ⚪ 0.0%
siteStartup 6987 ms 6492 ms 495 ms 🟢 -7.1%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

…p-sites-on-quit

# Conflicts:
#	apps/studio/src/migrations/index.ts

@nightnei nightnei left a comment

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.

Tested different scenarios - it works like a charm ❤️
Briefly reviewed code, LGTM 👍 But would be good to have a review also from Fredrik, as he has better knowledge about this part of the codebase.

The copy also looks good, but I would propose a bit of an adjustment to somwthign like:

* Keep running — sites stay running after Studio closes.
* Auto-start — sites stop now and start again when you reopen Studio.
* Stop — sites stop now and stay stopped.

But up to you.

Thank Bernardo, for working and improving it ❤️

@bcotrim

bcotrim commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

@fredrikekelund please let me know if you have any feedback on this one, happy to address it in a follow-up.

@bcotrim
bcotrim merged commit 74fb548 into trunk Jun 23, 2026
11 checks passed
@bcotrim
bcotrim deleted the stu-1778-clarify-stop-sites-on-quit branch June 23, 2026 08:47
@fredrikekelund

Copy link
Copy Markdown
Contributor

This is clearer for sure, but four buttons instead of three (plus the checkbox) is kind of a lot – especially considering how macOS changes the dialog appearance. I would call this dialog a bit overwhelming, tbh.

I also think "Auto-start" is a bit of a misleading button label. Users need to read the description to understand what it means, or they'll mistake it for something else if they read only the button label.

Screenshot 2026-06-23 at 11 37 17

I would run this by @shaunandrews for input.

@shaunandrews

Copy link
Copy Markdown
Contributor

ooofa, yea, this isn't great. Thanks for the ping. Not only is there a lot of options (the cognitive overhead is through the roof), but the order and placement of options makes is very hard to process and choose.

We need to simplify the copy and the layout. Instead of trying to explain every option in text, separate from their related button, we should present them in a better interface. A list of radio buttons is what comes to mind. I also think we'll need to make this a proper setting, so users can change it later.

I created STU-1908 to track iterations one this.

gcsecsey added a commit that referenced this pull request Jun 30, 2026
wojtekn added a commit that referenced this pull request Jul 15, 2026
…4140)

## Related issues

<!--
Link a related issue to this PR. If the PR does not immediately resolve
the issue,
for example, it requires a separate deployment to production, avoid
using the "Fixes" keyword and use "Related to" instead.
-->

- Fixes STU-1908

## How AI was used in this PR

<!--
Help reviewers understand what to look for and verify that you've
reviewed the code yourself.
-->

Codex executed the implementation based on detailed instructions from
me, informed by @shaunandrews's design spec in STU-1908.

## Proposed Changes

<!--
Explain the intent of this PR:
- What problem does it solve, or what need does it address?
- How does it affect the user (new capability, fix, performance,
accessibility, etc.)?
- Note any user-visible behavior changes or trade-offs.

Focus on the "why" and the user impact. Avoid listing modified files or
describing implementation mechanics — the diff already shows that.
-->

#3837 changed the dialog Studio
displays when quitting with running sites to look like this:

<img width="632" height="402"
alt="611726748-9fe08097-aa05-4ec9-8770-04ac906d8b67"
src="https://github.com/user-attachments/assets/664f3330-2d80-45b6-885c-385f1a6556bc"
/>

I argued in
#3837 (comment)
that this is too complex, and Shaun agreed. This PR changes the dialog
to display a shorter text with fewer buttons again, along with a new
dropdown in the Studio settings (and in the new agentic UI).

| Dialog | Studio settings | Agentic UI settings |
| - | - | - |
| <img width="382" height="419" alt="Screenshot 2026-07-09 at 09 58 26"
src="https://github.com/user-attachments/assets/cf6c7c76-c46b-4f4d-827b-cc98380b57e1"
/> | <img width="1483" height="894" alt="Screenshot 2026-07-09 at 10 20
31"
src="https://github.com/user-attachments/assets/8a8314be-ce73-4ffa-ac98-d3879dabfcf9"
/> | <img width="1483" height="894" alt="Screenshot 2026-07-09 at 10 15
23"
src="https://github.com/user-attachments/assets/5c6156dd-27a1-4cea-8b6c-e0ce7818f7d6"
/> |


## Testing Instructions

<!--
Add as many details as possible to help others reproduce the issue and
test the fix.
"Before / After" screenshots can also be very helpful when the change is
visual.
-->

1. Edit `~/.studio/app.json` and remove the `quitSitesBehavior` prop
2. `npm start`
3. Start at least one site
4. Quit Studio
5. Ensure that you see a dialog asking you what to do with the running
sites
6. Pick one of the choices and ensure it works (sites are running or are
stopped after the app closes)
7. `npm start` again
8. Open the Studio settings, ensure the new setting is there and works
as expected (you can check `app.json` to verify that the setting is
persisted)
9. `ENABLE_AGENTIC_UI=true npm start`
10. Click your profile name in the bottom left corner to open the
settings view
11. Ensure the new setting is there and works as expected (you can check
`app.json` to verify that the setting is persisted)

## Pre-merge Checklist

<!--
Complete applicable items on this checklist **before** merging into
trunk. Inapplicable items can be left unchecked.

Both the PR author and reviewer are responsible for ensuring the
checklist is completed.
-->

- [ ] Have you checked for TypeScript, React or other console errors?

---------

Co-authored-by: Wojtek Naruniec <wojtek.naruniec@automattic.com>
Co-authored-by: Wojtek Naruniec <wojtek@naruniec.me>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants