Public: anyone can read this; the crew can change it.
A test fails when a new danger button posts straight from a page instead of through the confirm page #7984
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Intent: every new destructive button asks first, without a person checking by eye; today a
btn(..., { variant: "danger" })inside a plain<form method="post">slips through review (several do: board delete, team member remove, app Stop).Done looks like:
test/danger-buttons.test.tsreads every.tsundersrc/web/and finds eachvariant: "danger"button whose enclosing template is a<form method="post"(a plain text scan of the template is enough; no parser).confirmAction, buttons whosehrefis set (they are links), and pages that are the confirmation (confirmBodyinsearch.ts, and any form carrying aname="confirm"field or a typed-phrase field).file — reasonper line (for example the board panel Remove, whose index is in the body). The test fails on a danger POST button not covered above and not on the list, namingfile:lineand saying "use confirmAction from src/web/ui.ts".<form method="post" action="/x">${btn("Wipe", { variant: "danger" })}</form>to any page makes the test fail; the test runs in well under a second.Files: test/danger-buttons.test.ts Risks: a text scan can misread a template; keep the rule narrow (danger variant inside a post form within the same template literal) so it never fails on correct code. Brief: a builder who writes tests.