Put the State Machine and Boundaries in the Prompt
Last lesson translated "what you want" into goals and scenarios. This one covers "don't gloss over it." The rule is simple: AI only seriously writes the states you name; anything unnamed, it imagines as fair weather. So list every state, nail the edge cases, spell out error prevention—those three together are the interaction spec.
You say "build an order list page," and AI always pictures: network fine, data fits one screen, user never mis-clicks. It's not lazy—your description only had fair weather. Lesson 2 covered the three states (loading, empty, error); lesson 3 covered error prevention and reversibility. Those taught you to spot the gaps; this lesson turns what you spotted into black-and-white clauses in the prompt.
Cross-lesson · The three states and the three parts of an error messageWhat loading, empty, and error should look like when they're done right, and how to write error copy in plain language—lesson 2 already walked it; we reuse that conclusion here.The prompt below is classic fair-weather; the five cells on the state board are still question marks. Tap a state chip to write that state into the prompt and watch the spec grow line by line.
How much is that one line—"empty state gets guidance"—worth? Same order page, two versions in a new user's eyes: left prompt never mentions empty state; right adds one sentence. Tap the side you think keeps the newcomer.
Once states are listed, deeper edge cases remain. Demo never hits them; week one after launch, they all show up. Draw one to see AI's default dodge—and which sentence to add to the prompt.
How finely you write states and edge cases depends on the interface posture. About Face 4, Chapter 9 sorts products into postures; here are the two you'll use most. Name the posture first in the prompt—AI will nail state density much better.
Classic posture mismatch: a leave-request page with sovereign-grade filters and charts, or a day-long monitoring console with poster-sized one-screen flows. Density follows posture; posture follows how often it's used.
Taste Engineering's block builder assembles visual specs; this one builds interaction specs. Toggle five clause groups; the preview updates live. Pick "Omit" and the preview flags where AI will freestyle. Assemble, copy, paste at the end of your generating-UI prompt.
AI only writes states you name: loading, empty, error, weak net, success—name all five. Unnamed ones are a blank-screen and alert farm.
Nail the edge cases: when the list is empty, when the network fails, when they double-submit, when permissions are missing—after every "when," one clear requirement.
Posture first, then density: sovereign UIs can be dense; transient UIs stay few and loud—don't grab the wrong script.
Ship the spec as an annex: goal + scenario (last lesson) first, interaction spec (this lesson) last—together they're the full brief for AI.
Source: Original to Xiaoshan Academy's Interaction Engineering series; error and state principles from About Face 4, Chapter 15; interface posture from Chapter 9 (Alan Cooper et al.).