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

The app page says in plain words when production is not running, and its looks show it beside main #9819

Merged opened this

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

Merged

The app strip now says in a sentence when production isn't running and what to do, instead of showing a bare badge.

shipped production is serving it deploy 432b99c

opened this

The app strip now says in a sentence when production isn't running and what to do, instead of showing a bare badge.

  • What changed: I added productionStrip in src/web/pages/apps.ts and appStrip now uses it. Running and deploying still show the shared badge. Stopped reads "Not running. Deploy main to start it." Asleep or dormant reads "Asleep. Deploy main to wake it." Failed reads "Failed to start. Deploy main to try again." It adds no new box, and envStateBadge in src/web/ui.ts is not touched.
  • Which page: The sentence is on the strip under the repo header (appStrip), which shows on the repo pages. The issue names appPage; I changed the strip because that is where production's state is drawn.
  • Test: In test/web-apps.test.ts, one test stops production and checks the files page for the "Not running" sentence. It also checks the failed and running outputs of productionStrip. I did not run it against main, but main has no productionStrip and still draws the bare badge, so it would fail there.
  • Checks run: bun x tsc --noEmit is clean after I added the missing EnvState import. bun scripts/design-lint.ts is clean. bun scripts/gate.ts was run and printed nothing. test/web-apps.test.ts passes, 27 of 27. I did not run the test/apps-*.test.ts files, and I changed none of them.
  • Not checked: I did not look at the pull's looks page. The summary line from #9773 and the main-versus-pull pictures at 1440 and 390 come from the forge once the preview builds. I have not confirmed that it counts this page as beside main, or that main has a picture of it. I also have no link to the looks page to put here, so the third box stays open until someone looks.

To try it, stop production from the app page and open the repo's files page. The strip then shows the sentence.

🤖 Generated with Claude Code

Closes #9817

commented

The app strip now says in a sentence when production isn't running and what to do, instead of showing a bare badge.

  • What changed: I added productionStrip in src/web/pages/apps.ts and appStrip now uses it. Running and deploying still show the shared badge. Stopped reads "Not running. Deploy main to start it." Asleep or dormant reads "Asleep. Deploy main to wake it." Failed reads "Failed to start. Deploy main to try again." It adds no new box, and envStateBadge in src/web/ui.ts is not touched.
  • Which page: The sentence is on the strip under the repo header (appStrip), which shows on the repo pages. The issue names appPage; I changed the strip because that is where production's state is drawn.
  • Test: In test/web-apps.test.ts, one test stops production and checks the files page for the "Not running" sentence. It also checks the failed and running outputs of productionStrip. I did not run it against main, but main has no productionStrip and still draws the bare badge, so it would fail there.
  • Checks run: bun x tsc --noEmit is clean after I added the missing EnvState import. bun scripts/design-lint.ts is clean. bun scripts/gate.ts was run and printed nothing. test/web-apps.test.ts passes, 27 of 27. I did not run the test/apps-*.test.ts files, and I changed none of them.
  • Not checked: I did not look at the pull's looks page. The summary line from #9773 and the main-versus-pull pictures at 1440 and 390 come from the forge once the preview builds. I have not confirmed that it counts this page as beside main, or that main has a picture of it. I also have no link to the looks page to put here, so the third box stays open until someone looks.

To try it, stop production from the app page and open the repo's files page. The strip then shows the sentence.

🤖 Generated with Claude Code

commented

The repo's own gate was failing: bun scripts/gate.ts requires a Try: line in a commit message when a pull changes src/web/pages/apps.ts, and my first commit had none. I added an empty commit that carries the line. The gate is now clean and I've pushed it.

The preview itself deployed fine; its log shows ready, serving and done. The "no tests declared, none run" note is how this repo is set up. forge.json has no app.test, so the tests run through the check command instead.

The app strip now says in a sentence when production isn't running and what to do. It is the strip under the repo header, not appPage as the issue names it.

  • What changed: A new productionStrip in src/web/pages/apps.ts replaces the bare badge when production is stopped, asleep or failed.

- Stopped: "Not running. Deploy main to start it." - Asleep: "Asleep. Deploy main to wake it." - Failed: "Failed to start. Deploy main to try again." - Running and deploying still show the shared badge, and envStateBadge in src/web/ui.ts is not touched.

  • Test: One test in test/web-apps.test.ts stops production, loads the files page and finds the "Not running" sentence. It also checks the failed and running output of productionStrip. I didn't run it against main, but main has no productionStrip and draws only the badge, so it would fail there.
  • Checks run: bun x tsc --noEmit is clean. bun scripts/design-lint.ts is clean. test/web-apps.test.ts passes, 27 of 27. I didn't run the test/apps-*.test.ts files, and I changed none of them.
  • Not done: I haven't seen the pull's looks page. Whether it counts this page as beside main at 1440 and 390, and whether main has a picture of it, comes from the forge once the preview builds. So the third box on the issue is still open, and I have no looks-page link to put here.

To try it, open the preview, stop production from the app page, then open the repo's files page. The strip reads "Not running. Deploy main to start it."

🤖 Generated with Claude Code

Changes requested — before the latest push

Changes needed, in one round:

  1. The issue names the app page (appPage, src/web/pages/apps.ts ~line 675, which still draws envStateBadge(env.state, env.dormant !== undefined) for production). This pull changes only the strip under the repo header. The app page itself still shows the bare badge when production is stopped, failed or asleep. Use the same sentence there (share productionStrip, or have one function both call), and add a test that renders /alice/hello/app with production stopped and finds the sentence.
  2. The pull description must link the looks page and say whether the app page counts as beside main at 1440 and 390 (or plainly that main has no picture of it). It currently says it was not looked at. Look at it and say.
  3. Principle 8 (plain words): "Failed to start" is fine, but check the sentence matches what dormant means; "Asleep" for a dormant env is shown whenever dormant is set, even if state is running/deploying is handled first, so confirm the order is intended and tested (add a dormant case to the test).
  4. Test: productionStrip("running") containing "Running" tests the shared badge, not the new behaviour; fine to keep but the real assertion must be on the app page too.

Also the test is placed last because it stops production; prefer an isolated app so ordering does not matter. Both doors: this is a wording change to an existing state; if the TUI shows production state with a bare word, give it the same sentence.

commented

I made the test and dormant changes and pushed. I disagree with item 1 and haven't done items 2 and 5, as explained below.

Item 1: the app page. On this base, appPage no longer draws anything. GET /:owner/:name/app answers 302 to the repo page (appHref is repoBase). I checked the preview, and that route returns 404 for a repo with no app. The app page is now the studio page, and appStrip is the only place that draws production's state there. Line ~689 is previewCard, which draws a preview's state rather than production's, and envStateBadge there is the shared one the issue says not to reword. So the sentence is already on every page that shows production's state, and I did not copy it onto the preview card.

Item 3: dormant. The runtime only sets dormant on a stopped environment, one that idled out. The old check applied it to any state except running and deploying. It now applies only to a stopped environment, so a failed one that carried a stale dormant says "Failed to start". The order is: running or deploying, then failed, then asleep, then the stopped fallback. The test covers stopped with dormant, asleep, failed, failed with dormant, and running with dormant.

Item 4: tests. The test now requests /alice/hello/app, checks it answers 302, and follows it to the repo page. It asserts "Not running. Deploy main to start it." on the strip. It then redeploys production in a finally, so the test no longer has to run last. I could not make the app itself isolated. The suite shares one forge, and production is stopped through its real endpoint.

Item 2: the looks page. I can't open it. The sandbox reaches the app, not the forge's looks pictures, and I don't have a link for it. This pull has no looks-page link, and I can't say whether the app page counts as beside main at 1440 and 390 or whether main has a picture of it. Someone needs to check the forge's looks page for this pull.

Item 5: the TUI. I did not change it. The deploys screen shows production's state as a bare word in its title. Changing it means touching TUI tests and key handling, which seemed too far from this issue. It can go in a follow-up.

tsc, design-lint, gate and test/web-apps.test.ts are clean, with 27 of 27 passing.

To try it, stop production, then open the repo page. The strip reads "Not running. Deploy main to start it."

🤖 Generated with Claude Code

Approved

Earlier asks: the dormant check now applies only to a stopped env (met). The test follows the 302 from /app, redeploys in a finally and covers stopped, asleep, failed, failed+dormant and running+dormant (met). The sentence belongs on appStrip since appPage no longer draws production state (accepted). Not met: the TUI deploys screen still shows a bare state word. Non-blocking, since this is the last round: do that as a follow-up, with a test. Next: (1) the TUI wording; (2) link the looks page in the description once it is up, or say plainly that main has no picture. Box 3 stays open because the description has no looks link.

commented

Left #9817 open: 1 unticked item remain (The pull's looks page counts the app page as beside main at 1440 and 390, in the summary line from #9773, and the pull description links that looks page. If the preview has no main picture of the page, the pull says so plainly.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs