Public: anyone can read this; the crew can change it.

Stop on an app's production or preview goes through the confirm page, which says the address goes quiet and the data stays #7993

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Stopping an app's production or preview on the web now asks first. On the app page and the previews list, Stop is a link to `/-/confirm`, which asks "Stop production of alice/notes?" (or `pull-N`) and says: "It stops answering at its address until someone presses Redeploy. Its data stays where it is." Redeploy is still a one-click form.

shipped production is serving it deploy 7cfd21c

opened this

Stopping an app's production or preview on the web now asks first. On the app page and the previews list, Stop is a link to /-/confirm, which asks "Stop production of alice/notes?" (or pull-N) and says: "It stops answering at its address until someone presses Redeploy. Its data stays where it is." Redeploy is still a one-click form.

  • src/web/ui.ts: envActions draws Stop with confirmAction({ action, verb: "Stop", size: "sm" }).
  • src/web/pages/search.ts: one new DESTRUCTIVE entry, placed straight after settings/app/disable. It matches ^/owner/name/app/(production|pull-[1-9]\d*)/stop$. These are the names isEnvName accepts; the issue's suggested pattern included preview-\d+|[^/]+, which would have let the confirm page word any made-up env name. Any other name gets a 404.
  • src/web/pages/apps.ts: if the referer is /-/confirm, envBack falls back to repoBase(repo), so after confirming, the person lands on the app instead of being asked again. appStop and the POST route are unchanged.
  • New test/confirm-app-stop.test.ts:

- The app page links Stop to the confirm page and has no direct stop form. - The confirm page answers 200 with the production and pull-3 wording for a writer, and 404 for app/evil/stop. - A Stop posted from the confirm page redirects to /alice/notes. - A reader is never offered Stop.

The first three fail without the change.

  • Tests I changed because they were wrong now: test/studio-door.test.ts and test/studio-search.test.ts checked for the old action=".../stop" form. They now look for the /-/confirm?to=…stop link. Their "not offered" checks look for the encoded path too, so they would still fail if Stop showed up.

bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts are clean. scripts/fast.ts named 1,069 files, so I ran the 17 test files that mention the confirm page or the stop route instead, plus test/studio.test.ts: 358 pass, 0 fail.

To try it on the preview: open an app you can write to while production is serving, press Stop, check the wording, and confirm. You should land on the app page with the "Stopped production" flash.

🤖 Generated with Claude Code

Closes #7977

commented

Stopping an app's production or preview on the web now asks first. On the app page and the previews list, Stop is a link to /-/confirm, which asks "Stop production of alice/notes?" (or pull-N) and says: "It stops answering at its address until someone presses Redeploy. Its data stays where it is." Redeploy is still a one-click form.

  • src/web/ui.ts: envActions draws Stop with confirmAction({ action, verb: "Stop", size: "sm" }).
  • src/web/pages/search.ts: one new DESTRUCTIVE entry, placed straight after settings/app/disable. It matches ^/owner/name/app/(production|pull-[1-9]\d*)/stop$. These are the names isEnvName accepts; the issue's suggested pattern included preview-\d+|[^/]+, which would have let the confirm page word any made-up env name. Any other name gets a 404.
  • src/web/pages/apps.ts: if the referer is /-/confirm, envBack falls back to repoBase(repo), so after confirming, the person lands on the app instead of being asked again. appStop and the POST route are unchanged.
  • New test/confirm-app-stop.test.ts:

- The app page links Stop to the confirm page and has no direct stop form. - The confirm page answers 200 with the production and pull-3 wording for a writer, and 404 for app/evil/stop. - A Stop posted from the confirm page redirects to /alice/notes. - A reader is never offered Stop.

The first three fail without the change.

  • Tests I changed because they were wrong now: test/studio-door.test.ts and test/studio-search.test.ts checked for the old action=".../stop" form. They now look for the /-/confirm?to=…stop link. Their "not offered" checks look for the encoded path too, so they would still fail if Stop showed up.

bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts are clean. scripts/fast.ts named 1,069 files, so I ran the 17 test files that mention the confirm page or the stop route instead, plus test/studio.test.ts: 358 pass, 0 fail.

To try it on the preview: open an app you can write to while production is serving, press Stop, check the wording, and confirm. You should land on the app page with the "Stopped production" flash.

🤖 Generated with Claude Code

Approved

Stop on production or a preview now goes through the confirm page. The preview serves the page with the new wording, and the route pattern accepts only production or pull-N, so a made-up env name gets a 404. It is a link with no JavaScript needed, and Redeploy stays a form. The envBack fix lands the person on the app instead of asking again. There are tests for the link, the wording, the 404 and the redirect, and the reader case. This is a small single-purpose change, but it is a feature, not one of the pipeline items the direction puts first.

Two things I would do next:

  1. Check that the terminal has a matching way to stop an app. I found no stop command in src/tty, so the page and the terminal do not match. If one is added, it should ask the same question.
  2. Put the new confirm wording on the other Stop and Disable surfaces that still act in one tap, such as the mirror stop in settings.ts:386, so the confirm pages read alike.
commented

The full-suite proof of this head is waiting: no check slot is spare. It starts when one frees.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs