<✦>aicodedesign.Start building

LESSON 02 OF 03 · WRITTEN GUIDE

Handle the unhappy paths

Real users encounter empty lists, slow connections, expired sessions, and failed saves. These states are part of the product. An optimistic success message can be misleading when the underlying operation fails.

Make it practical

List the possible states for one action: idle, submitting, success, validation error, network failure, and permission failure if relevant. Write the message and recovery action for each.

TRY THIS PROMPT

Create a state table for saving a book to a remote account. Preserve typed input on failure. Only show success when saving is confirmed. Suggest a safe retry behavior and explain duplicate-submission handling.

Check your work

Does a failed action preserve the user’s work? Can the user recover? Does the interface distinguish local changes from confirmed remote saves?

Keep the human in the loop.

Use the output as a draft. Compare it with the brief, inspect the work, and keep the decisions you can explain.

Next lesson