Open
Description
Description
When a user attempts to undo or redo and there are no more states in the respective stack, we should provide feedback to indicate that the action can't be performed. Right now, nothing happens, which can be confusing.
Requirements
- Play a system beep (e.g.,
NSBeep()
) whenundo()
orredo()
is called but the stack is empty. - Disable the Undo menu item when
canUndo
isfalse
. - Disable the Redo menu item when
canRedo
isfalse
. - Ensure the menu item states update correctly when mutations are added or the stacks change (e.g., after
undo()
,redo()
, orclearStack()
).
Implementation Notes
- Hook into
undo()
andredo()
inCEUndoManager
to check if the respective stack is empty, and callNSBeep()
if it is. - Use a binding or delegate to notify the menu system to update the state of the Undo/Redo menu items when
canUndo
orcanRedo
changes. - Consider adding a
didUpdateUndoRedoState
callback orNotification
for observing changes tocanUndo
/canRedo
.
Motivation
This improves the UX by making the application behavior more intuitive and responsive. It matches the standard macOS UX expectations for undo/redo behavior.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
📋 Todo