Skip to content
← All insights

Interaction design6 min read

How to design loading, empty and error states for a mobile app

Follow one saved-list screen through a delayed request, an empty result, a failed refresh and a successful save. Get the words, actions and tests for each moment.

Four clear glass vessels holding different levels and textures of liquid

Let the screen answer what happened to the last request, what data is still trustworthy and what the person can do next. An empty collection and an unread collection need different treatment.

Imagine opening your grocery list outside the shop. The heading appears, followed by “No items yet”. A moment later twelve items pop into place. Nothing has gone wrong with the network, yet the app has made a false statement. Now imagine the opposite problem. You lose reception and the list spins indefinitely. Both failures start with the same design decision: the screen was designed around its finished appearance.

Start with what the app knows

Give the first request a state of its own. Before it finishes, the app knows which list you asked for. It does not know how many items belong to it. Show the list name and a short loading indication. Reserve roughly the space the rows will occupy so controls stay in predictable places. When a request takes longer, an honest message such as “Still loading your shopping list” helps more than a progress indicator that invents a percentage.

An empty state begins only after a successful response returns no rows for this list. This is a good moment to teach a first action. “Your Saturday list is empty” and a button labelled “Add an item” tell someone exactly where their first item will land. A filtered result needs different copy. If the underlying list contains twelve items and a search for lemons returns none, offer “Clear search” or let the reader edit the term. An invitation to create their first list would send them backwards.

Compare these two prepared states from a shopping-list prototype rendered in Appsanic. Both show Saturday list in the same place. The first says that the app is looking for saved items. The second says the list is empty and offers Add an item. They share a layout, so a tester can concentrate on what the wording promises. They are examples you can reproduce with sample data before you connect a service.

Write down the evidence needed to move from the first screenshot to the second. The response must belong to the current person and the current list, complete successfully, and contain zero items. Until all three are true, the app cannot honestly invite the shopper to add their first item. If somebody switches from Saturday to Sunday while Saturday is loading, leave each response attached to its own list identity. A delayed empty Saturday response should never clear the milk already visible on Sunday.

Keep useful information during a failed refresh

Suppose eight items were visible a moment ago and a refresh fails. Those eight items still have value if the app can identify them as the last successful result for the same signed-in person and list. Leave them readable and show “Couldn’t refresh this list” with a Retry action. Clear cached private data when the account changes. A first load with no previous result needs a full error state, because showing an empty list would imply the request succeeded.

For a save, keep the typed item in the input while the request runs. Prevent repeated taps from sending another write. Show success after the service confirms it. If the response never arrives, the write may already have happened. A fresh read or a retry using the same operation identifier lets the app settle that uncertainty. Blindly creating a second item on retry can put two identical cartons of milk on an otherwise correct list.

The third example begins after a successful read. Milk, Lemons and Fresh basil are still on screen. The message above them explains that the refresh failed and that these are the last saved items. A single Retry action sits beside the explanation. Somebody outside a grocery shop can still buy the ingredients they remember adding, and can tell that another person’s recent changes may be missing.

Prepared refresh-error view offers Retry, says it is showing last saved items and retains Milk, Lemons and Fresh basil.

To test the distinction, start with those three rows, have a second test session add bread, then interrupt the first session’s refresh. Look at the list while the service is unreachable. If Bread appears because a sample value was substituted, the screen is misleading. If all three original rows disappear, an ordinary refresh has thrown away information the shopper already had. Restore the connection, press Retry once and count again. You should see four rows and the temporary warning should disappear. Repeat with a second test account that has an empty list. A clean switch should never borrow the first shopper’s groceries as a convenient fallback.

Ask for one complete interaction

A brief for Sanic AI could read “On Shopping, keep the list title visible while loading. Show Add an item after a successful empty result. On a failed refresh retain the last confirmed items for this user and give them Retry. Preserve the typed item if a save fails.” Include the mechanism the project already uses for reading and saving. When the screen still uses sample data, build the state transitions with sample records first and label that test accordingly. The Sanic AI guide explains how to scope a request and review the changes.

Make each state appear on purpose

  1. Use a test list with zero rows, then a second list with several items. Open each from a cold start and check which message appears first.
  2. Delay a test response. Read and tap the screen during the wait. Hidden or disabled actions should have a clear reason and should become usable at the right moment.
  3. Interrupt a refresh after a successful load, restore the connection, and press Retry once. Confirm that the rows recover and that an old error disappears.
  4. Attempt a save, tap twice and then reopen the list. Count actual saved records. A toast message alone cannot establish that a write happened only once.

Use the Appsanic preview for the navigation and touch checks. Keep a short recording of the slow case. It often reveals a half-second flash of “empty” or an unexpected jump that remains invisible in a collection of polished screenshots.

When a slower search replaces the right result

Put lemons, lentils and milk in a test shopping list. Give the search for “le” a two-second delay in the test data and let “lem” return immediately. Type “le”, then add the m before the first reply arrives. The field should say “lem” and the list should show only lemons. Wait another two seconds. If lentils appear, the screen is showing the answer to a question the shopper has already changed.

Give each search a request number. When a reply arrives, update the screen only if its number still matches the most recent search. Apply that check to errors and loading indicators too. Otherwise an older request can leave an error banner above the correct lemons, or hide the spinner while the next query is still waiting.

Try one more sequence. Type “lem” and clear the field before the reply arrives. All three groceries should remain visible after both replies have finished. The guide to intermittent connections has a related test for a shopper who loses reception while the screen is open.

Write your first Sanic AI brief

Published

Analytics cookies

With your OK, we use Google Analytics to count visits and see which pages people find useful. It sets cookies and sends Google details of your visit, such as the pages you open. Nothing loads unless you accept. Cookie Policy