Feature/undo delete#2
Merged
Merged
Conversation
Single and bulk deletes now push the removed tasks (with their original positions) onto a bounded undo stack. store.undo() restores the most recent deletion in place. No-op when the stack is empty. Co-authored-by: Cursor <cursoragent@cursor.com>
Adds actions.undo() with a restored/nothing-to-undo notification, the configurable mappings.undo key (default `u`), and binds it in the pad. Co-authored-by: Cursor <cursoragent@cursor.com>
Adds the `u` mapping to the README feature list, mappings table, and config block, and to the SPEC in-buffer mappings table. Co-authored-by: Cursor <cursoragent@cursor.com>
undo_spec.lua exercises restore-to-position for single and bulk deletes, empty-stack, the 25-deep cap, and one-transaction-at-a-time sequential undo. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds undo for deletes so removing a task (or a bulk selection) is no longer
irreversible. Press
uin the pad to restore the most recently deleted task(s)to their original positions.
ddand visual-modeV+d. Removedtasks are recorded with their original indices and re-inserted in place.
repeated
uwalks back through the history.persisted across sessions (keeps behavior simple and predictable).
mappings.undo(defaultu), set tofalsetodisable.
Restored N task(s)orNothing to undo.Changes
store.lua: record deletions (single + bulk) onto a bounded undo stack; addstore.undo()that restores the most recent deletion.actions.lua:actions.undo()with notifications; bound to the newmappings.undokey in the pad.config.lua: newmappings.undo = "u"(typed inPinPadMappings).table.
tests/undo_spec.luacovering single/bulk restore-to-position,empty-stack, the 25-deep cap, and sequential undo.
Test plan
make testgreen locally (18 passed, 0 failed)dd, pressu, confirm it returns to its spotVselect several tasks,dto bulk-delete,urestores alluwith nothing to undo → "Nothing to undo"