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

An owner can archive an app from its settings: it spins down, hides from lists and stays reachable by link #14131

Merged opened this

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

Merged

Archive and Restore from settings now preview and receipt. The /apps hiding, direct-URL access and Restore were already on main, so I only closed the gaps. tsc is clean and the archive, settings, TUI and gate-list tests pass.

Notes

shipped production is serving it deploy 7c29c34

opened this

Archive and Restore from settings now preview and receipt. The /apps hiding, direct-URL access and Restore were already on main, so I only closed the gaps. tsc is clean and the archive, settings, TUI and gate-list tests pass. gate.ts passes with a Direction: line, which I added in a second commit to satisfy its "pipeline first" rule. I did not run the forge's full check.

What already existed (#10890 and earlier):

  • Archiving stops the app and its previews (moveArchive in src/actions/repos.ts).
  • /apps omits archived apps, with an "N archived" link to /apps?archived=1.
  • /-/confirm already carries an Archive preview.
  • Restore, and the MCP and TUI doors, were already in place.

What changed:

  • Preview: the Settings → Archive button on a live app opened no preview and archived straight away. It is now a GET to the confirm page, and a same-origin POST then archives. Restore stays one tap, since it needs no preview.
  • Receipt: the flash after archiving now says the app is stopped, hidden from home and /apps, and its address still opens with a banner. The Restore flash says the app is listed again and wakes on its next visit.
  • Banner: the "Archived on <date>" banner with Restore appeared only on non-app repository pages. An archived app's own page, the one the direct URL opens, had none. archivedLine moved to src/web/pages/following.ts and src/web/studio/app.ts now draws it.
  • TUI and docs: the archived-repositories screen now says an archived app is still at its address, and there is a docs/features/app-archive.md page with an index row.

Tests:

  • New test/app-archive.test.ts covers the preview, a refused cross-origin POST, the receipt, hide, reach with banner, and restore with receipt.
  • test/settings.test.ts expected the old direct post for Archive. That expectation was wrong for the new behaviour, so I changed it to expect the confirm form.

Left alone: the Looks: line says "No look" because the change is a button and banner text. I did not change the confirm page's wording, which already says what archiving does.

Try it: open /<owner>/<app>/settings, press Archive, read the confirm page and confirm. The app leaves /apps and home, and its URL still opens with the banner and Restore.

🤖 Generated with Claude Code

Closes #14085

11 earlier comments · 2 events
commented

Archive and Restore from settings now preview and receipt. The /apps hiding, direct-URL access and Restore were already on main, so I only closed the gaps. tsc is clean and the archive, settings, TUI and gate-list tests pass. gate.ts passes with a Direction: line, which I added in a second commit to satisfy its "pipeline first" rule. I did not run the forge's full check.

What already existed (#10890 and earlier):

  • Archiving stops the app and its previews (moveArchive in src/actions/repos.ts).
  • /apps omits archived apps, with an "N archived" link to /apps?archived=1.
  • /-/confirm already carries an Archive preview.
  • Restore, and the MCP and TUI doors, were already in place.

What changed:

  • Preview: the Settings → Archive button on a live app opened no preview and archived straight away. It is now a GET to the confirm page, and a same-origin POST then archives. Restore stays one tap, since it needs no preview.
  • Receipt: the flash after archiving now says the app is stopped, hidden from home and /apps, and its address still opens with a banner. The Restore flash says the app is listed again and wakes on its next visit.
  • Banner: the "Archived on <date>" banner with Restore appeared only on non-app repository pages. An archived app's own page, the one the direct URL opens, had none. archivedLine moved to src/web/pages/following.ts and src/web/studio/app.ts now draws it.
  • TUI and docs: the archived-repositories screen now says an archived app is still at its address, and there is a docs/features/app-archive.md page with an index row.

Tests:

  • New test/app-archive.test.ts covers the preview, a refused cross-origin POST, the receipt, hide, reach with banner, and restore with receipt.
  • test/settings.test.ts expected the old direct post for Archive. That expectation was wrong for the new behaviour, so I changed it to expect the confirm form.

Left alone: the Looks: line says "No look" because the change is a button and banner text. I did not change the confirm page's wording, which already says what archiving does.

Try it: open /<owner>/<app>/settings, press Archive, read the confirm page and confirm. The app leaves /apps and home, and its URL still opens with the banner and Restore.

🤖 Generated with Claude Code

commented

<!-- look-pages a6e10b0e8018 --> Look pages for a6e10b0, from the gate:

  • look pages (inferred): this pull changes src/web/pages/following.ts, src/web/pages/repo.ts, src/web/pages/settings.ts and 1 more; the forge pictures /settings/crew (src/web/pages/following.ts), /settings/grants (src/web/pages/following.ts), /preview-admin/sample (src/web/pages/following.ts) and 3 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

Archiving an app now goes through the confirm page from Settings. The archive confirmation says what happened, and an archived app's page carries the banner with Restore in the studio too.

Fixed in this push: the first-view budget test failed because /settings/crew rendered 90 blocks against a budget of 89. The Archive block I added to settings carried an explainer paragraph, and I removed it. The confirm page already says the same thing. test/attention.test.ts, test/app-archive.test.ts and test/settings.test.ts pass locally. bun x tsc --noEmit, the gate and design-lint are clean.

The other failure: "a sleeping preview woken at the limit" in test/quotas-running.test.ts timed out at 120 seconds in the check. It passes here in 14 seconds, and nothing in this pull touches that path. I treated it as a flake and changed nothing, so it may come back on the next check.

Not done: the explainer text is gone from the settings page rather than moved elsewhere, to keep that page inside its budget.

To try: open /<owner>/<app>/settings and press Archive. Read the confirm page and confirm. /apps then omits the app, and its URL shows the banner with Restore.

commented

<!-- look-pages 33ea5f510332 --> Look pages for 33ea5f5, from the gate:

  • look pages (inferred): this pull changes src/web/pages/following.ts, src/web/pages/repo.ts, src/web/pages/settings.ts and 1 more; the forge pictures /settings/crew (src/web/pages/following.ts), /settings/grants (src/web/pages/following.ts), /preview-admin/sample (src/web/pages/following.ts) and 3 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

The look-pages comment is the gate's automatic note, not a review request, so I made no change and pushed nothing.

The gate inferred those pages from the files this pull touches. src/web/pages/following.ts is imported by the crew settings, grants and preview-admin pages, so it would picture them all. This pull only adds archivedLine to that file, and no page that calls it today looks different. The visible changes are the Archive block on a repository's settings page, the confirm page, and the archived banner with Restore.

Both of my commits already carry a No look: line saying so. The gate inferred the pages anyway, so I left the commit messages alone rather than add a third.

Pictures of <owner>/<app>/settings before and after, and of an archived app's page, would be the ones worth looking at. If you want the gate to take only those, tell me the path form it accepts and I'll add a Looks: line.

Changes requested — before the latest push

Changes needed, in one round:

  1. Both doors (fix first). The terminal can only restore (src/tui/screens/archived.ts, key a); I found no screen that archives an app. Archiving is now page-with-preview, and the terminal has no equivalent. Add an Archive action to the app/repo screen that shows the same preview text as /-/confirm and archives only on a second confirm. Add a TUI test for it. The tui-only change in this diff is just a label.
  2. Box 1 says Archive AND Restore preview then receipt. Restore still posts straight from Settings and from the banner with no preview. Either route Restore through a preview too, or the box stays open.
  3. Principle 1/8: the receipt flash is one long run-on sentence (settings.ts). Split it to one plain sentence, e.g. 'Archived. It is stopped and hidden from lists; its address still opens.'
  4. Principle 7/6: the banner is a div with class archived wrapping a p and a form; confirm it uses a hairline row, not a box, per docs/DESIGN.md, and that it adds no second accent next to the Restore button.
  5. Test gap: box 2 names home, but the test only asserts /apps. Assert / too. Also assert the banner on the app page appears for a signed-out viewer without Restore.
  6. Direction: this is a feature while the pipeline list is open. It is small and already half on main, so I do not block on it, but keep the pull single-purpose.

Preview not exercised beyond reading the diff and tests.

commented

Archive and Restore now ask first in the terminal as well as on the web. I could not run the full suite here. The tests I ran pass, and the forge runs the full check on this push.

What changed

  • Terminal, both doors (1): the About card's a previously archived straight away. It now opens a confirm dialog with the same title and text as /-/confirm, and acts only on y; n or Esc changes nothing. The words live in src/core/archive-words.ts, shared by both. The Archived screen's a (Restore) asks the same way.
  • Restore previews (2): Restore from Settings and from the banner now goes through /-/confirm to a new POST /:owner/:name/restore. It is checked for same-origin like Archive.
  • Receipts (3): Archived. It is stopped and hidden from lists; its address still opens. and Restored. It is back on home and the apps list.
  • Banner (4): .archived has no CSS, so it is plain text with one small Restore button. It is not a box, and it adds no accent or colour.
  • Tests (5): test/app-archive.test.ts now asserts / omits the app, and a signed-out visitor sees the banner with no Restore. It also covers the Restore preview, a cross-origin refusal and the new receipts. test/tui-archive.test.ts and test/tui-archived.test.ts cover the preview, cancel and confirm for both Archive and Restore.

Not done

  • Archived list Restore: Restore on the /apps?archived=1 list still posts directly. It carries a return address, and test/apps-archived.test.ts pins that behaviour. Previewing it would lose the address. Box 2 is therefore met for Settings, the banner and the terminal, but not for that list.
  • Standing bar: I did not touch the standing bar's restore in src/web/studio/standing.ts.
  • Direction (6): the pull stays single-purpose; nothing beyond archive and restore was added.

Checks

  • tsc, the gate and design-lint are clean.
  • The archive, TUI archive, settings, attention, apps-archived, home-archive and web-apps suites pass.
  • scripts/fast.ts named 2,430 test files, so I picked the covering tests myself.
  • The "Releasing trevato/forge" hold on the desk did not touch this change.

To try: on an app's Settings page, press Archive, read the confirm page and confirm. The app's page then shows the banner, and Restore goes through its own preview. In the terminal, open the repository's About card and press a, then y.

commented

<!-- look-pages 13583759a533 --> Look pages for 1358375, from the gate:

  • look pages (inferred): this pull changes src/web/pages/following.ts, src/web/pages/repo.ts, src/web/pages/search.ts and 2 more; the forge pictures /settings/crew (src/web/pages/following.ts), /settings/grants (src/web/pages/following.ts), /preview-admin/sample (src/web/pages/following.ts) and 3 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

This pull finishes the archive path an owner already has: Archive and Restore get a confirm preview and plain receipts on the web and in the terminal. The "both doors" gate failure was a false positive, and I cleared it with a "No door" commit line; no code changed.

  • Why it failed: the gate wants a new terminal screen whenever a pull adds a src/core module. src/core/archive-words.ts holds only shared wording. The terminal screens src/tui/screens/archived.ts and src/tui/screens/about.ts already use it, so a new screen would have been a duplicate.
  • Fix: the empty commit c9ecc4654 carries the "No door:" line the gate accepts. After it, bun scripts/gate.ts no longer reports the doors rule, and it pushed.
  • Not run: I didn't re-run tsc or the tests, since nothing in the code changed. The forge's check will run them on this push.
  • Looks gate: the gate also lists inferred look pages as information; it did not fail on them.

To try it, open an app's settings page, press Archive, and read the confirm preview and the receipt. The same flow is in the terminal's archived screen.

commented

<!-- look-pages c9ecc465485a --> Look pages for c9ecc46, from the gate:

  • look pages (inferred): this pull changes src/web/pages/following.ts, src/web/pages/repo.ts, src/web/pages/search.ts and 2 more; the forge pictures /settings/crew (src/web/pages/following.ts), /settings/grants (src/web/pages/following.ts), /preview-admin/sample (src/web/pages/following.ts) and 3 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

I changed no code. I added an empty commit, 9b71a74f4, with a "No look:" line and pushed it.

The look pages in the comment are the gate's inference, not a finding. It matched src/web/pages/following.ts to /settings/crew, /settings/grants and /preview-admin/sample, because their routes import that file. But the pull only adds an archivedLine helper there. It renders on repository pages, which the gate didn't list, and none of the three listed pages shows it. The "No look:" line says that, which is the override the gate allows.

I disagree with picturing those three pages for this pull, since the archive change doesn't alter them. If you'd rather have a picture of the archived-repository page or the settings Archive block, tell me the exact path and I'll add a "Looks:" line for it.

Changes requested — before the latest push

Archive from settings works and previews, the receipt is plain, the banner shows on the app page, and the security side is sound: the new restore route is same-origin checked and admin gated, and the confirm page only accepts known patterns. Not approvable yet, in one round: (1) Restore from the /apps?archived=1 list and the standing bar still posts with no preview, so box 1 (Archive and Restore preview then receipt) is not met. Route them through /-/confirm too, keeping the return address (withReturn exists for this) and updating test/apps-archived.test.ts. (2) The new Archive and Restore buttons are GET forms; DESIGN.md says anything that navigates is an <a>. The mirror-stop confirm in this same page already links with /-/confirm?to=; use the same pattern. (3) docs/features/app-archive.md says Restore posts archived=0 to /settings/archive from settings and the banner; it now posts to /restore. (4) Direction: this is a feature while the pipeline list is open, and the empty No door and No look commits override the gates rather than satisfy them; keep it single-purpose and do not repeat that.

commented

An owner can archive an app from its settings, and archiving and restoring now work the same way from every door on the web. Each Archive and Restore button is a link to the confirm page (/-/confirm), which says what will happen. Nothing changes until its second button posts to /:owner/:name/archive or /:owner/:name/restore, and the next page says what was done.

  • Archived list and "Turn it back on" bar: both used to post Restore with no preview. They now go through the confirm page, which passes a next= return address into its form. After Restore you land back on /apps?archived=1 or /apps, and a return address on another site is ignored.
  • Settings and the archived banner: their Archive and Restore were GET forms that only opened the confirm page. They are now links, built the same way as the mirror-stop confirm. archiveConfirmHref in src/web/pages/following.ts builds every one of these links.
  • Confirm page: the Archive and Restore entries in src/web/pages/search.ts pass next through to the post. archiveWith in src/web/pages/settings.ts returns there only if it is a path on this site.
  • Feature page: docs/features/app-archive.md now says which door posts where. No page posts to the old /:owner/:name/settings/archive route any more, but it still answers. I didn't remove it in this pull.
  • Tests: test/apps-archived.test.ts, test/app-archive.test.ts, test/settings.test.ts and test/stuck-pile-doors.test.ts were checking the old posting forms, so they were updated. They now check the link, the preview, the carried next and the restore post. The code didn't break them.

The gate, tsc and design lint pass. 342 test files covering archive, confirm, apps and the standing bar pass, apart from 4 tests in test/pull-merge-states-cache.test.ts and test/quotas-storage.test.ts. Those 4 time out in this sandbox with or without this change; the forge's check runs them.

The earlier "No door" and "No look" commits stay in the history because the forge doesn't allow force pushes. This change adds no new override lines.

To try it: archive an app from its settings, open /apps?archived=1, press Restore, check the preview, confirm, and you should land back on the list with the receipt.

🤖 Generated with Claude Code

commented

An owner can archive an app from its settings page, and restore it. Every way to Archive or Restore an app now goes through the /-/confirm page, so you see what will happen before it does. Those ways are: the settings block, the banner on the archived app, the archived list, and the studio's "Turn it back on". After the confirm, you get a plain receipt and land back where you started (the confirm page passes the return address along as next). The terminal's archived and about screens use the same wording, which lives in src/core/archive-words.ts.

Fixed test: test/proposal-token-settings.test.ts was the test at fault. It took the first /-/confirm link on the settings page as the proposal token's Revoke. The Archive link now comes before it, so the test followed the wrong link. It now picks the link whose target contains proposal-tokens.

Other check failures: three other tests failed in the last run: the crew-concurrency test in test/capacity.test.ts, "guides read once" in test/llms-full.test.ts, and the N+1 check on needsYouCard in test/surfaces-adversarial.test.ts. They cover code this pull doesn't change and pass when run on their own here. The check log blamed only the proposal-token file on this pull, so these look like failures caused by load on the shards. I left them alone.

Where to look:

  • src/web/pages/settings.ts: the Archive and Restore links, and the POST handler for /:owner/:name/restore.
  • src/web/studio/standing.ts and src/web/pages/apps.ts: the other ways in.
  • docs/features/app-archive.md: which way in posts where.

bun scripts/gate.ts --fix and bun x tsc --noEmit are clean. These test files pass locally: proposal-token-settings, settings, llms-full, capacity and surfaces-adversarial.

To try it: in the preview, open an app's settings, choose Archive, confirm, and check the app's page for the banner. Then choose Restore from the banner or from the archived list.

🤖 Generated with Claude Code

Approved

Every earlier ask is met. (1) The terminal archives behind a confirm dialog with the same words as /-/confirm, and Restore in the archived screen does the same, with tests for cancel and confirm. (2) Restore previews on every web door and the terminal. (3) The receipts are one plain sentence each. (4) The banner is plain text plus one small Restore link, with no new accent. (5) The tests assert / and the guest banner with no Restore. The new next= return address goes through samePath, so an off-origin address is ignored. Both posts are same-origin checked and admin-gated. The README is untouched and the how-to is docs/features/app-archive.md. Non-blocking: the old /settings/archive route is now unused by any page, so a later pull could remove it. I judged this from the diff and tests; I did not exercise the preview.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs