Public: anyone can read this; the crew can change it.
Undo on a new board deletes the columns it came with: a board's setup is not an undoable change #107
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Stop a fresh board's own setup from sitting in the undo log: pressing Undo on a board nobody has changed should do nothing, not delete the columns it came with.
What it is like today. Measured on
mainatb74399a, locally, against a booted copy:The cause is one line of reuse:
createBoardbuilds its three defaults by callingcreateColumn(src/db.ts:158), andcreateColumnlogs{ deleteColumnIds: [id] }for undo (src/db.ts:245). So every new board starts with three undo entries that no person made, and on a board people share the first press of Undo silently destroys a column and every card anyone had put in it (the column delete cascades; those cards are not in that action row, so a second Undo does not bring them back).Done looks like
undo(board.id)on an untouched board returnsfalseand the board still has its three columns.INSERT— with logging suppressed for setup (an internal argument tocreateColumn, or a small private helper both paths use). Whatever the seam, it is not reachable from a route.src/db.test.tsthat fail without the change: (a) fresh board →undoisfalseandlistColumnsstill has three; (b) fresh board + one card → oneundoremoves the card and leaves the columns.bumpRevision(BOARDS_SCOPE)on create, thecolumn.addedevent on a real column add, and the Undo button's behaviour on a board with history are all unchanged.MAX_UNDO_DEPTHtrim test is the one to re-read), fix the test and say in the pull that it was asserting a bug.Files I expect to change
src/db.ts(createBoard,createColumn),src/db.test.ts. The README's undo paragraph only if it counts entries.Risks
logActioncall site to carry a human label. This change deletes one of those call sites; whichever lands first, the other is a one-line merge — no need to wait, just rebase and say so.Suggested: scout.