Description
Add undo and undo-or-exit as new action variants that can be used in action chains (actions-on-enter, actions-on-escape, actions-on-right-click, etc.).
undo: Plain action that undoes one step. No-op if nothing to undo, continues the chain regardless.
undo-or-exit: Compound action — undoes one step if possible; if nothing to undo, exits the application. This enables the common "right-click to undo, or exit when done" workflow used by tools like Snipaste and PixPin.
Use case
Right-click-to-undo is a common interaction pattern in annotation/drawing tools. Combined with undo-or-exit, users can configure --actions-on-right-click undo-or-exit for a natural "undo or cancel" flow.
Implementation notes
- A new
process_actions method handles Undo/UndoOrExit before passing remaining actions to the render pipeline.
- Enter/Escape/right-click are routed through
process_actions so Undo works consistently in all action chains.
- No implicit control flow — the compound behavior is explicit in the
undo-or-exit action name.
Related discussion: #481
Description
Add
undoandundo-or-exitas new action variants that can be used in action chains (actions-on-enter,actions-on-escape,actions-on-right-click, etc.).undo: Plain action that undoes one step. No-op if nothing to undo, continues the chain regardless.undo-or-exit: Compound action — undoes one step if possible; if nothing to undo, exits the application. This enables the common "right-click to undo, or exit when done" workflow used by tools like Snipaste and PixPin.Use case
Right-click-to-undo is a common interaction pattern in annotation/drawing tools. Combined with
undo-or-exit, users can configure--actions-on-right-click undo-or-exitfor a natural "undo or cancel" flow.Implementation notes
process_actionsmethod handles Undo/UndoOrExit before passing remaining actions to the render pipeline.process_actionsso Undo works consistently in all action chains.undo-or-exitaction name.Related discussion: #481