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
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Intent: the last web danger button that posts on one click asks first; today
src/web/pages/boards-view.tsdraws each panel's "Remove" as a POST to/boards/<slug>/removewith the panel'sindexin the body, andtest/danger-buttons.test.tslists it as an exception.The confirm page posts to its
topath 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:
Editinsrc/boards/edit.tsletsremovecarry an optionaltitle;applyEditrefuses with "that panel moved; nothing was removed" when it is given and the panel atindexhas another title. Withouttitleit behaves as today (the terminal'sxkeeps working).confirmAction({ action:/boards/${slug}/remove?index=${i}&title=${encodeURIComponent(p.title)}, verb: "Remove", size: "sm" }).editOfinsrc/web/pages/boards-edit.tsreadsindexandtitlefrom the form and, when the form has noindex, fromctx.url.searchParams.DESTRUCTIVEinsrc/web/pages/search.tsgets one entry for^/boards/([^/]+)/remove\?index=(\d+)&title=([^&]+)$, added directly after the/boards/…/deleteentry: 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.test/danger-buttons.test.ts.test/confirm-board-panel.test.tsproves: 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.