UI Patterns and Techniques

Smart Menu Items


From Word for Windows

Use when:

Your UI has menu items that operate on specific objects, like "Close", or that behave slightly differently in different contexts, like "Undo."

Why:

Menu items that always say exactly what they're going to do make the UI self-explanatory. The user doesn't have to think about what object is going to be affected -- they're also less likely to accidentally do something they didn't mean, like deleting "Chapter 8" instead of "Footnote 3."

How:

Every time the user changes the selected object (or current document, or last undoable operation, etc.), change the menu items that operate on it to include the specifics of the action. Obviously, if there is no selected object at all, you'll want to disable the menu item, thus reinforcing the connection between the item and its object.

Incidentally, this could also work for button labels, or links, or anything else that is a "verb" in the context of the UI.

What if there are multiple selected objects? There's not a whole lot of guidance out there -- this pattern is mostly seen with documents and undo operations -- but you could write in a plural, like "Delete Selected Objects."

Examples:


From Illustrator 10

The last filter the user applied in this case was the "Hatch Effects" filter. The menu remembers that, and so it changes its first two items to (1) reapply the same filter again, and (2) modify the filter before reapplying. There are so many filters the user might have applied that it's quite useful to be reminded what the last one was. (And the accelerator keystrokes are handy for repeated application of the same filter!)