Skip to content

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

Open
bcotrim wants to merge 3 commits into
trunkfrom
stu-1778-clarify-stop-sites-on-quit
Open

Clarify quit-sites dialog options and move auto-start to app.json#3837
bcotrim wants to merge 3 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

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing c0797f8 vs trunk

app-size

Metric trunk c0797f8 Diff Change
App Size (Mac) 2334.13 MB 2334.13 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk c0797f8 Diff Change
load 1756 ms 1754 ms 2 ms ⚪ 0.0%

site-startup

Metric trunk c0797f8 Diff Change
siteCreation 8124 ms 8544 ms +420 ms 🔴 5.2%
siteStartup 3920 ms 3878 ms 42 ms ⚪ 0.0%

Results are median values from multiple test runs.

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

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