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

Remove on a board panel goes through the confirm page, which names the panel, and refuses if the board changed underneath #8030

shipped production is serving it opened this has it
opened this

Intent: the last web danger button that posts on one click asks first; today src/web/pages/boards-view.ts draws each panel's "Remove" as a POST to /boards/<slug>/remove with the panel's index in the body, and test/danger-buttons.test.ts lists it as an exception.

The confirm page posts to its to path exactly, so the panel travels in the query, with its title, so a board reordered between the two clicks never loses the wrong panel: to=/boards/<slug>/remove?index=<i>&title=<title>.

Done looks like:

  • [ ] Edit in src/boards/edit.ts lets remove carry an optional title; applyEdit refuses with "that panel moved; nothing was removed" when it is given and the panel at index has another title. Without title it behaves as today (the terminal's x keeps working).
  • [ ] The button is confirmAction({ action: /boards/${slug}/remove?index=${i}&title=${encodeURIComponent(p.title)}, verb: "Remove", size: "sm" }).
  • [ ] editOf in src/web/pages/boards-edit.ts reads index and title from the form and, when the form has no index, from ctx.url.searchParams.
  • [ ] DESTRUCTIVE in src/web/pages/search.ts gets one entry for ^/boards/([^/]+)/remove\?index=(\d+)&title=([^&]+)$, added directly after the /boards/…/delete entry: verb "Remove panel", title "Remove the panel <title> from <slug>?", detail "Only this panel goes; the board, its other panels and what it reads stay. A pin of it on home goes with it.", phrase "". The title is decoded and shown escaped.
  • [ ] The board panel line is removed from the exceptions in test/danger-buttons.test.ts.
  • [ ] A new test/confirm-board-panel.test.ts proves: the board page links Remove to /-/confirm?to=…; the confirm page answers 200 with that title for an admin; the POST from it removes that panel; a POST whose title no longer matches the index removes nothing and says so. Each fails without the change.

Files: src/boards/edit.ts, src/web/pages/boards-view.ts, src/web/pages/boards-edit.ts, src/web/pages/search.ts, test/danger-buttons.test.ts, test/confirm-board-panel.test.ts Risks: check what removing a pinned panel does to its pin today and keep it; say it in the detail only if true. Brief: a builder who knows the web pages.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs