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

On the home, an admin selects apps and archives them in one tap, and the answer offers Undo #2521

Parked opened this
Closed without merging

A site admin can now archive apps from the home: tick them, press Archive, and the answer page lists them with an Undo button. After Undo they are back on the home. The new tests and the neighbouring archive, feed and studio suites pass; I did not run the full bun test.

Notes

stopped parked by the crew deploy a642d01

opened this

A site admin can now archive apps from the home: tick them, press Archive, and the answer page lists them with an Undo button. After Undo they are back on the home. The new tests and the neighbouring archive, feed and studio suites pass; I did not run the full bun test.

The type check reported nothing in the files I changed, but tsc first complained that it couldn't find the bun type definitions. I ran bun install and re-ran it filtering only for home and server.ts, so I never saw a full clean type-check.

  • Apps rail: in src/web/studio/home.ts an admin gets a checkbox per app and an Archive button. Both stay display:none until a "Select" toggle is on, so nothing shifts and non-admins see no extra markup.
  • Routes: three small routes in src/web/studio/home_archive.ts (registered in src/http/server.ts).
    • The POST runs the existing fleet archive operation on the ticked repositories, with the usual preview, receipt and 24-hour undo. There is no new action code.
    • The receipt page is a GET, so a refresh can't archive again.
    • The Undo POST calls undoFleetOp.
  • Checks on the POSTs: both go through readForm, so a cross-origin POST gets 403. The archive POST also returns 403 for a non-admin. Ticked ids are validated and capped at the fleet's row limit, and the fleet operation refuses repos the actor doesn't administer.
  • Tests: test/home-archive.test.ts covers the four cases you listed, plus a second Undo being refused.
  • Left out:
    • The Select toggle is CSS-only, so a live refresh of the apps region resets it.
    • The rail still shows only the first 8 apps, so you can only tick those.
    • There is no preview step before archiving. The receipt and Undo stand in for it.
    • "Admin" here means site admin, not a per-repo admin.

To try it, sign in as a site admin, press Select in the Your apps card on /, tick two apps and press Archive.

Closes #2512

commented

A site admin can now archive apps from the home: tick them, press Archive, and the answer page lists them with an Undo button. After Undo they are back on the home. The new tests and the neighbouring archive, feed and studio suites pass; I did not run the full bun test.

The type check reported nothing in the files I changed, but tsc first complained that it couldn't find the bun type definitions. I ran bun install and re-ran it filtering only for home and server.ts, so I never saw a full clean type-check.

  • Apps rail: in src/web/studio/home.ts an admin gets a checkbox per app and an Archive button. Both stay display:none until a "Select" toggle is on, so nothing shifts and non-admins see no extra markup.
  • Routes: three small routes in src/web/studio/home_archive.ts (registered in src/http/server.ts).
    • The POST runs the existing fleet archive operation on the ticked repositories, with the usual preview, receipt and 24-hour undo. There is no new action code.
    • The receipt page is a GET, so a refresh can't archive again.
    • The Undo POST calls undoFleetOp.
  • Checks on the POSTs: both go through readForm, so a cross-origin POST gets 403. The archive POST also returns 403 for a non-admin. Ticked ids are validated and capped at the fleet's row limit, and the fleet operation refuses repos the actor doesn't administer.
  • Tests: test/home-archive.test.ts covers the four cases you listed, plus a second Undo being refused.
  • Left out:
    • The Select toggle is CSS-only, so a live refresh of the apps region resets it.
    • The rail still shows only the first 8 apps, so you can only tick those.
    • There is no preview step before archiving. The receipt and Undo stand in for it.
    • "Admin" here means site admin, not a per-repo admin.

To try it, sign in as a site admin, press Select in the Your apps card on /, tick two apps and press Archive.

commented

Parked by the crew: the check failed ("reserved names > every top-level page of the forge is a reserved name") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs