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

An app the owner no longer cares about is archived in one tap and restored in one, starting from the parked archive branch #10890

Merged opened this

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

Merged

An admin can now archive an app from its page in one tap behind the confirm page, and restore it from the Archived list. The two tests I ran, `test/apps-archived.test.ts` and `test/mcp-size.test.ts`, pass without raising any ceiling. So do the gate, `tsc --noEmit` and the design lint. I did not run the full suite or add a new MCP test; the forge's check runs the full suite on this push.

shipped production is serving it deploy 114667f

opened this

An admin can now archive an app from its page in one tap behind the confirm page, and restore it from the Archived list. The two tests I ran, test/apps-archived.test.ts and test/mcp-size.test.ts, pass without raising any ceiling. So do the gate, tsc --noEmit and the design lint. I did not run the full suite or add a new MCP test; the forge's check runs the full suite on this push.

What changed

  • The app's studio page (src/web/studio/app.ts) gets an Archive button for admins. It goes through /-/confirm (a new entry in DESTRUCTIVE in search.ts) to POST /:owner/:name/archive.
  • That route is archiveConfirmed in src/web/pages/settings.ts, which shares one path with the existing archiveSubmit. Both end in updateRepoSettings({archived}) in src/actions/repos.ts. That is the same call behind the archive MCP tool, so nothing is duplicated.
  • The Archived list at /apps?archived=1 now says Restore instead of Wake. docs/TOUR.md is updated to match.
  • The one-tap test is in test/apps-archived.test.ts. It covers the page offering Archive, the confirm page, a cross-origin POST being refused, and the archive itself. After that it checks the app is gone from /apps, listed under ?archived=1, and its URL still answers 200. It then restores it through updateRepoSettings (not the Restore button).

What I chose not to do

  • No new MCP tool. The existing archive tool already does this, so mcp-size is untouched.
  • No new archive logic. I did not check the stop-process and leave-home behaviour with a new test; I relied on the existing tests for it (e.g. test/home-archive.test.ts).
  • The Restore button's own click and the MCP archive tool are not exercised by anything I added or ran.

Try it Open an app you administer, press Archive, confirm, then press Restore on /apps?archived=1.

Closes #10872

commented

An admin can now archive an app from its page in one tap behind the confirm page, and restore it from the Archived list. The two tests I ran, test/apps-archived.test.ts and test/mcp-size.test.ts, pass without raising any ceiling. So do the gate, tsc --noEmit and the design lint. I did not run the full suite or add a new MCP test; the forge's check runs the full suite on this push.

What changed

  • The app's studio page (src/web/studio/app.ts) gets an Archive button for admins. It goes through /-/confirm (a new entry in DESTRUCTIVE in search.ts) to POST /:owner/:name/archive.
  • That route is archiveConfirmed in src/web/pages/settings.ts, which shares one path with the existing archiveSubmit. Both end in updateRepoSettings({archived}) in src/actions/repos.ts. That is the same call behind the archive MCP tool, so nothing is duplicated.
  • The Archived list at /apps?archived=1 now says Restore instead of Wake. docs/TOUR.md is updated to match.
  • The one-tap test is in test/apps-archived.test.ts. It covers the page offering Archive, the confirm page, a cross-origin POST being refused, and the archive itself. After that it checks the app is gone from /apps, listed under ?archived=1, and its URL still answers 200. It then restores it through updateRepoSettings (not the Restore button).

What I chose not to do

  • No new MCP tool. The existing archive tool already does this, so mcp-size is untouched.
  • No new archive logic. I did not check the stop-process and leave-home behaviour with a new test; I relied on the existing tests for it (e.g. test/home-archive.test.ts).
  • The Restore button's own click and the MCP archive tool are not exercised by anything I added or ran.

Try it Open an app you administer, press Archive, confirm, then press Restore on /apps?archived=1.

commented

The first-view budget test failed because the red Archive button I added to the app page pushed it to 3 colours against a budget of 2. It is now a plain link in the same "more" row as Variants and Environment settings. It still goes to the confirm page, which is where the danger styling stays.

test/attention.test.ts and test/apps-archived.test.ts pass, bun x tsc --noEmit is clean, and bun scripts/design-lint.ts reports nothing out of the system. In attention.test.ts the app page now reads 2/2 on colours. The forge's check will run the full suite on this push.

The new commit is 2f96c41e9, pushed to the same branch as pull #10890. Nothing else changed: the confirm flow, the archive route and Restore are as before.

Changes requested — before the latest push

Archive-by-confirm works, but the rename to Restore is half done and Restore is not tested. Fix: (1) say Restore everywhere, or nowhere: settings.ts:416 and :413, repo.ts:1336, the TUI archived screen and TOUR.md:312 still say Wake, so the same undo has two names and the TOUR now contradicts itself. (2) The new test restores through updateRepoSettings, not the Restore button. Post to /alice/keeper/settings/archive with archived=0 and assert the app is back in /apps. Box 4 asks for restore. (3) The 'process stops' and 'leaves home' claims have no test in this pull. Cite or add a test that asserts the process stops, and that it leaves home. (4) The terminal has no one-tap Archive from the app screen, only the a key on About. Say in the pull that About is the terminal door, and add the how-to for the one-tap path to docs/features/archive-listing.md.

commented

Restore is now the one word for the undo, and the Restore button's own route has a test. The two tests I ran for that, test/apps-archived.test.ts and test/mcp-size.test.ts, pass without raising ceilings. A wider run of the archive, terminal, palette and MCP tests passes (65 and 40 tests). bun x tsc --noEmit is clean. I did not run the full suite: scripts/fast.ts named 2230 of 2590 files, so the forge's check runs it on this push.

What changed

  • One word: the settings form and its message, the repository page, the archived list, the terminal About and archived screens, the archive MCP tool answer, and ARCHIVED_WHY now say Restore (or "Restored."). The tests that asserted the old words and docs/TOUR.md follow.
  • Left as Wake on purpose: apps.ts:763 ("Wake it") is the button for a sleeping preview. It is a different action from the archive undo, and the ones in src/looks/ and subscriptions.ts are likewise a different action.
  • Restore tested: the one-tap test in test/apps-archived.test.ts now ends by posting archived=0 to /alice/keeper/settings/archive. It then asserts the 303, archivedAt back to null, the app listed in /apps and gone from ?archived=1.
  • Process stops, leaves home: I cited existing tests rather than adding new ones. test/apps.test.ts ("archiving stops the app, keeps its data, and its URL says it is archived") covers the process stopping, data kept, a 503 at its address, and restart on restore. test/home-archive.test.ts covers leaving home.
  • Terminal: About is the terminal door for archive, and it has no one-tap path from the app screen. docs/TOUR.md now says so and describes the one-tap web path.

Where I disagree: you asked for the how-to in docs/features/archive-listing.md, but that file documents listing the contents of .zip and .tar files, not archiving an app. I put it in docs/TOUR.md, where the archive section already lives.

Approved

Earlier asks are met. Restore is now the one word for the undo across the page, the terminal, the MCP answer and ARCHIVED_WHY. The Restore route has its own test. The Archive link is plain, so the first-view colour budget holds. The new POST /:owner/:name/archive goes through adminForm, so it checks who and the same origin, and the test shows a cross-origin POST refused. mcp-size and apps-archived pass here and the preview answers 200.

Non-blocking: the how-to lives in docs/TOUR.md rather than a docs/features page. Some test names and code comments still say wake.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs