Controls, menus and messages¶
Exercise controls-menus-messages-annex.pdf · PDF
A settings screen offers Theme, with two checkboxes: Light and Dark. Both are ticked. So which theme is the app in right now? Further down, Text size is a text box. You type abc. Then 900. It takes both.
Whose mistake is abc? The user's? No. The designer gave them a tool that allows it. A control is a promise about which answers are possible, and the wrong control makes promises the app cannot keep. This page gives you the pieces and the reasons: where a command goes, which control fits a question, and how an app should talk.
What you will learn
- Place a command in the standard menu bar, then group it and mark it with a separator, an ellipsis and a shortcut
- Say what belongs in a context menu and a toolbar, and why both only repeat the menu bar
- Choose the right control by asking two questions
- Tell the four kinds of message apart, and pick the quietest one that works
- Write a message that says what happened, why, and what to do now, with verbs on the buttons
- The trap: why "Are you sure?" is usually the wrong answer
The workshop¶
You do not drive a screw with a hammer. Controls are tools, and for this whole page your app is a workshop. Its tools live in three places:
| In the workshop | In the app | Holds |
|---|---|---|
| The labelled drawers | The menu bar | Every command, in a fixed, familiar order |
| The pegboard on the wall | The toolbar | The few tools you grab all day: big, visible, one move away |
| The tool belt | The context menu (right-click, or long press) | What you need for the thing in your hands, right now |
A menu bar is the row of menus that holds every command of a desktop app. A toolbar is a strip of buttons for the most frequent commands. A context menu is the short list that opens on the thing you right-clicked.
The menu bar: the same drawers everywhere¶
Open any desktop app, such as LibreOffice Writer, and read the top row: File, Edit, View ... Help. You have seen it a thousand times, which is the point: this is the consistency of heuristic 4, and the recognition that the 1987 Apple book asked for. Each drawer has a meaning, so a command's place follows from a rule:
| Menu | Its rule | Typical commands |
|---|---|---|
| File | The whole document | New, Save, Share..., Print... |
| Edit | Changes the selected thing | Undo, Cut, Copy, Paste, Delete |
| View | Changes how it looks, not what it is | Zoom, Show sidebar, Dark mode |
| Help | Explains the app | Keyboard shortcuts, About |
So Delete note goes in Edit, because it changes the selected thing, not the document as a whole. Dark mode goes in View, because the notes stay the same. If you can defend a place with a rule, it is a good place. "It felt right" is not a rule.
Open a menu and you will see three conventions:
- Groups and separators. Undo and Redo together, a thin line, then Cut, Copy, Paste. That line is proximity inside a menu.
- The ellipsis. "Save As..." has three dots and "Save" has none. An ellipsis means I will ask you something before I act.
- The shortcut on the right. Ctrl+Z, Ctrl+X, Ctrl+C, Ctrl+V. Larry Tesler and Tim Mott invented cut, copy and paste at Xerox PARC in the mid-1970s, and you still use the same commands in the same menu.
The pegboard and the tool belt¶
A toolbar holds few tools. Keep it to about four. With 30 it is not a pegboard any more: it is a wall you have to search.
A context menu holds what applies to this object, right now: for a note, Share..., Duplicate, Rename... and Delete note.
Careful: the tool belt holds no secrets
The context menu is not where hidden commands live. Not everyone finds the right-click, and a keyboard user needs Shift+F10 to open it. Everything in the tool belt, and on the pegboard, is also in a drawer. They are shortcuts to the menu bar, never a replacement for it.
Each platform, its own drawers¶
These are the highway codes again. On the desktop, macOS puts the menu bar at the top of the screen, and Windows and Linux put it in the window. A phone has no menu bar: instead there is a tab bar at the bottom, with 3 to 5 destinations, and a "More" menu for the rest. Right-click becomes a long press.
Two questions choose the control¶
Every time you need input from a person, ask two things: how many answers may the user give, and out of how many options?
| The user must... | Control | What it is | Example |
|---|---|---|---|
| Pick one of a few (2 to 5), all worth seeing | Radio buttons or a segmented control | Visible options where choosing one clears the others | Theme: Light · Dark · System |
| Pick one of many (6 or more) | Dropdown | A closed list that opens on click | Language: one of 24 |
| Pick any number of independent options | Checkboxes | Boxes you tick one by one | Notify me about: shared notes, reminders... |
| Turn one thing on or off, applied at once | Switch | A small lever, like a light switch | Sync on mobile data |
| Give a number with limits | Stepper or slider | − and + buttons around a number, or a handle on a track | Text size, 12 to 24 |
| Give something you cannot list | Text field | A box you type into | A note's title, an email |
flowchart TB
Q1{"<b>How many answers?</b>"}
Q1 -->|"any number"| CB["<b>Checkboxes</b>"]
Q1 -->|"on or off,<br>applied at once"| SW["<b>Switch</b>"]
Q1 -->|"one"| Q2{"<b>Out of how<br>many options?</b>"}
Q2 -->|"2 to 5"| R["<b>Radio buttons</b> or<br><b>segmented control</b>"]
Q2 -->|"6 or more"| D["<b>Dropdown</b>"]
Q2 -->|"a number<br>with limits"| ST["<b>Stepper</b> or <b>slider</b>"]
Q2 -->|"cannot be listed"| TF["<b>Text field</b>"]
Go back to the screen from the start. Theme is one of three, so checkboxes were wrong. Text size is a number with limits, so abc should have been impossible.
Careful: the text field is not the safe choice
A text field can do everything, which makes it the most dangerous control: it accepts every wrong answer. Each time you replace one with a better control, a set of errors can no longer happen. That is error prevention, heuristic 5, done with a single decision.
Three refinements for the choices people get wrong:
- Switch or checkbox? A switch acts the moment you touch it, like a light switch. A checkbox waits for a Save or Send button, like a paper form. A switch with a Save button under it is a checkbox in disguise.
- Dropdown or visible options? A dropdown saves space, but it costs a click and hides the options. Under six, and if there is room, show them.
- Stepper or slider? A slider that shows no value cannot tell 16 from 17. If the exact number matters, use a stepper, which shows it.
The dangerous button¶
A destructive action never sits next to the main one and never looks like it. Move it away as well as recolouring it. If it cannot be undone, it asks first, so its label ends in dots: Delete all notes...
Do you remember the Undo in heuristic 3? If an action can be undone, it does not need to ask. Delete note can act at once and offer Undo, so it has no dots.
Four voices¶
Your app also has to talk. It has four voices, from a whisper to a hand on your shoulder.
Use the quietest voice that works.
| Voice | What it is | Use it for | Example |
|---|---|---|---|
| Inline | Text next to the control | A problem with this field | "Add a title to save this note." |
| Toast | A small bar that leaves by itself | Good news, no decision needed | "Note saved" |
| Banner | A bar that stays while a state lasts | Something true right now | "You are offline." |
| Dialog | A window that blocks the app | A decision you cannot skip | "Delete all 4 notes?" |
Material Design calls the toast a snackbar. You will meet both words.
Writing a message people can use¶
Heuristic 9 gave you the anatomy of an error message. It says what happened, why, and what to do now:
| Message | |
|---|---|
| Bad | "Error 413: upload op failed" |
| Good | "Your photo was not uploaded. It is larger than 10 MB. Choose a smaller photo." |
And three rules of length and tone:
- Short. A toast is read in one glance: two or three words. Longer is not more polite. Nobody reads it, so short and useful is polite.
- Human. No codes, no "null", no "op".
- Verbs on buttons. "Delete 4 notes" and "Cancel", never "Yes" and "No". People read the button, not the question, and "Delete 4 notes" is clear on its own.
The trap: asking 'Are you sure?'
When in doubt, it is tempting to ask. But the 1987 Apple book already warned that a barrage of alerts means the design is wrong. A dialog is for the few actions that cannot be undone. For the rest: do it, and offer Undo in a toast.
Do it for your project
List your app's commands (at least 10) and sort them into a menu or a tab bar. Then choose the control for three settings using the two questions. You will need this list to wireframe your app.
Key takeaways¶
- The menu bar holds every command in a familiar order (File, Edit, View ... Help). The toolbar and context menu only repeat it.
- Separators group commands, an ellipsis means "I will ask first", and shortcuts sit on the right. On a phone, a tab bar of 3 to 5 destinations replaces the menu bar.
- To choose a control, ask: how many answers, out of how many options? Replacing a text field removes whole sets of errors.
- A switch acts at once. A checkbox waits for Save. A destructive button moves away from the main action, and asks first if it cannot be undone.
- An app has four voices: inline, toast, banner and dialog. Use the quietest that works.
- A good error says what happened, why and what to do now, with verbs on the buttons.
Quick check¶
1. What do the three dots in a menu command such as “Export as PDF...” mean?
- The command asks you something before it acts
- The command is disabled at the moment
- The command has a keyboard shortcut
- The command opens a list of sub-items
An ellipsis promises a question before the action. "Save" acts at once, while "Save As..." first asks where and under what name.
2. In which standard menu does a command belong if it changes how the document looks on screen, but not its content?
- View
- File
- Edit
- Help
View is for how it looks, not what it is, such as Zoom or Dark mode. Edit changes the selected thing, File deals with the whole document and Help explains the app.
3. What is the relation between a context menu and the menu bar?
- The context menu repeats commands that also live in the menu bar
- The context menu holds advanced commands the menu bar leaves out
- The context menu replaces the menu bar once the app is installed
- The context menu holds only the commands for the app's settings
Not everyone finds the right-click, and keyboard users need Shift+F10. So the context menu is a tool belt: quick access to commands that are also in a drawer, never a place for secrets.
4. A sign-up form asks for the user's country, out of nearly 200. Which control fits?
- A dropdown
- A switch
- A group of radio buttons
- A group of checkboxes
The user gives one answer out of many options, so a dropdown fits. Radio buttons would also allow only one answer, but nearly 200 of them would fill several screens.
5. A settings screen has a switch for “Sync on mobile data” and a Save button under it. What is wrong?
- A switch should apply at once, so it needs no Save button
- A switch can only be used for sound and for brightness
- A switch should be replaced by a text field for clarity
- A switch should sit inside a toast so that it disappears
A switch acts the moment you touch it, like a light switch. A control that waits for Save behaves like a checkbox, so a switch with a Save button is a broken promise.
6. Your app has just saved a draft, and the user needs to decide nothing. Which voice should it use?
- A toast, which leaves by itself
- A dialog, which blocks the app
- A banner, which stays on screen
- An inline text, next to a field
Good news with no decision is what a toast is for. A dialog would interrupt for nothing, and a banner is for a state that is still true. Use the quietest voice that works.
7. Which of these messages follows the anatomy of a good error message?
- "Your file was not sent. You are offline. Reconnect and try again."
- "Something went wrong with your file. We are very sorry about it."
- "Send operation failed with status code 0x80040154 at this time."
- "Are you sure that you want to send this file again right now?"
A good message says what happened (not sent), why (offline) and what to do now (reconnect). The apology gives no reason and no way forward, and the code is machine language.
8. A library app asks how many days to extend a loan, from 1 to 14, in a free text field. Users type “two weeks” and the app rejects it. What should you change, and why?
- Use a stepper, because a number with limits then makes wrong answers impossible
- Use checkboxes, because each number of days is an independent option to select
- Use a longer field, because users need more room to type the number of days
- Use a dialog, because users should confirm the number of days they typed in
Ask the two questions: one answer, and it is a number with limits. A stepper cannot hold "two weeks" or 900, so the error no longer exists. The designer gave users a tool that allowed the mistake, and the fix belongs to the designer.
You have the pieces, and you know where each one goes. Now you stop fixing other people's screens and start your own app: Wireframes, prototypes and usability tests.