I'd like to add undo/redo functionality to my Mac app. The app works with notes and I'd like to add an "undo" action for when the user deletes a note.
This works just fine, the "Undo Delete Note" menu becomes active after the user deleted a note, but after using the "Undo Delete Note" command, there is a "Redo Delete Note" menu that becomes active.
Currently nothing happens when I click "Redo Delete Note", because I didn't register an action. I don't want the user to be able to delete a note accidentally through the undo/redo stack.
Is it possible to add an "undo" action without a "redo" action?
Not in the common case. And to do so would be to violate the implicit contract of the platform-standard undo/redo mechanism. You want the things you register to be symmetric. If a user deletes a note, then the available undo action should bring the note back. If the user elects to undo, then the redo action would be to "delete the note" again. It shouldn't matter if a user "accidentally" deletes a note by virtue of undo or redo, because they should always be able to get it back by doing the inverse action, right?
Don't overthink this.