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

Contraction: fold the dev app page into the studio app page #433

Merged opened this

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

Merged

Dev's App page (`GET /:owner/:name/app`) is folded into the studio app page. The old URL now redirects there, and the page's environment controls moved over. The full `forge.json` check passes: 579 tests across 38 files, typecheck clean.

shipped production is serving it deploy 79be2f6

opened this

Dev's App page (GET /:owner/:name/app) is folded into the studio app page. The old URL now redirects there, and the page's environment controls moved over. The full forge.json check passes: 579 tests across 38 files, typecheck clean.

Line count: src/ dropped by 145 lines net (+89 / −234). src/web/pages/apps.ts went from 967 to 799 lines. Counting tests and docs, the change is −40 net (+231 / −271).

What moved where

  • The old URL: GET /:owner/:name/app now answers with a 302 instead of rendering a page (appPage, src/web/pages/apps.ts).

- In studio mode it goes to /:owner/:name, which is the studio app page. - In dev mode it goes to /:owner/:name?mode=studio, because dev's repo home is the code page. Following that link switches the browser to studio mode. - A repo that isn't an app, or one the viewer can't read, still gets the same 404 as before.

  • Removed from the old page: the environment cards, the recent-runs card, the crew card and the about card. Runs still live at /:owner/:name/runs, and the studio page already shows the crew.
  • Controls added to the studio page:

- Each row in the previews list (src/web/studio/previews.ts) gets its own Redeploy and Stop for a writer, beside its state badge. When a row has buttons, the row itself is no longer a link; its host is. - Admins get an Environment settings link in the footer (src/web/studio/app.ts), pointing to /:owner/:name/settings/app for env vars, hostname, access and domains.

  • Other links to /app were repointed to the repo home or the studio page (appHref):

- the dev App tab (now ?mode=studio) - the app strip's App button - the app list rows - New app in dev mode - the "Run as an app" flash and the Environments button in settings - the Now card's busy row

  • Where Stop sends you: in both modes it returns to the page it was pressed on (the referer, same-origin only), falling back to the repo home. Dev-mode Redeploy still goes to the run's page.
  • Cleanup: removed the .env-card .card-foot CSS, which only the deleted cards used. docs/STUDIO.md and docs/DESIGN.md now describe the studio app page as the app's only page.

Tests

  • Added to test/studio.test.ts:

- the old route redirects in studio mode, in dev mode, and for an anonymous viewer of a public app - it still 404s for a repo that isn't an app and for one that doesn't exist - preview Redeploy/Stop and the settings link appear for a writer and not for a stranger

  • These tests had asserted the old behaviour, so I changed them to the new one. The tests weren't wrong; the behaviour changed on purpose:

- test/web-apps.test.ts: the App-page tests now follow the redirect. I dropped the Open-link assertion, because the studio only draws that link once production is running (#118), which made it timing-dependent. The dashboard test still covers that link. - test/apps.test.ts: New app in dev mode now lands on /:owner/:name. - test/studio.test.ts: dev-mode Stop now returns to the referer.

Not done

  • The old page's hostname, access and preview-data facts weren't brought over; they are settings rather than controls, and the settings page shows them.
  • Previews for closed pulls aren't listed, since they are removed anyway.
  • I didn't touch the TUI's app screen, the release workflow or the chart.

To try it: sign in, open an app's /:owner/:name/app in dev mode and in studio mode, and press Redeploy or Stop on a preview row.

🤖 Generated with Claude Code

Closes #395

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs