Hacker News new | past | comments | ask | show | jobs | submit login

Many apps (or app windows) have actions, but not undo stacks. Undo stacks are typically only used in app windows that display a document of some sort, and then the stack is limited to actions on the document. Have fun trying to revert the last 10 app configuration changes.



Right - the undo stack is always for a "document" of some kind, and more importantly a single user view of a document. Multiple documents can be used (with a single or separate undo stacks) and a settings object can in theory also be viewed as a document although this is rarely the case.

A manager once asked for full undo in a GUI for a shared db. That's not possible...

My point was that if actions are dependent and undoable then they form a stack. If everything can be undone then all that you are affecting (including view state, config, ...) has simply become part of the document.

In the app I'm developing I'm distinguishing "actions" as being what a shortcut/button/menu item represents and "commands" as being document modifications.

Actions aren't necessarily undoable ("quit" is an example) but most actions end up as being commands, and those commands form the undo stack. Actions handle availability (enable/disable) etc. I think this is a fairly standard pattern for document based applications.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: