UI Patterns and Techniques

Command History


From Photoshop 6

Use when:

The user performs a sequence of actions in the UI. This seems to be found most often in graphical editors and programming environments.

Why:

Sometimes a user needs to remember what they did in the course of working with the UI. Computers are good at keeping track of things like that; people aren't. For instance, the user may want to repeat a sequence of operations on a different object.

Furthermore -- and this is just as important, but for different reasons -- sometimes a user will want to reverse those actions. Reversibility gives users the freedom to play and explore. They know that whatever they do, they can go back to a known state, and not have to worry about doing permanent damage to whatever they're working with. A recorded sequence of actions enables them to undo as many "levels" as they wish.

How:

The software your UI is built on first needs to have a strong model of what an action is -- what it's called, what object it was associated with, how to reverse it, etc. Then you can build an interface on it.

Multi-level undo (i.e., being able to undo multiple operations) should be the first thing you implement, as it's probably the first thing a user will look for if they suspect the UI has a record of actions taken. Then, if you think it's worth the interface complexity, show the list of actions somewhere in the UI. Name them well, and let the user use that list to go backwards some arbitrary number of steps.

The "back" button on a Web browser serves a very similar function as command history.