Yeda AI Tips · #112

Español

AI-Generated UIs Skip the Empty States — Prompt for Every One

AI built your UI's happy path. Your users live on the sad path. Ask a coding assistant for "a dashboard with a list of orders" and you'll get a beautiful screen — for the one case where the data loaded instantly, the list has 8 tidy rows, and nothing went wrong. First-run users see a blank void. Slow networks see a flash of nothing. Failed requests see silence. None of that was in the prompt, so none of it is in the code.

States, not edge cases

Every data-driven view has at least five states, and only one of them is "happy":

  1. Loading — the request is in flight.
  2. Empty — the request succeeded and returned zero items.
  3. Error — the request failed.
  4. Partial / overflow — too much content: 10,000 rows, a 300-character name, a title that wraps three times.
  5. Ideal — the screenshot state. The only one AI reliably builds.

These aren't edge cases; they're the default experience for new users (empty), mobile users (loading), and everyone eventually (error). Nielsen Norman Group's guidance on empty states is blunt: a blank container leaves users unsure whether the app is broken, loading, or waiting on them — a well-designed empty state communicates status, teaches, and links to the next action.

Prompt for them explicitly — every time

The fix costs one sentence. Append it to every UI prompt:

Build the orders table. For every data-driven component, implement
all of: (1) a loading state with skeleton placeholders that reserve
the final layout's space, (2) an empty state with one line of copy
and a primary action, (3) an error state with a human-readable
message and a Retry button, (4) sensible handling of overflow —
long strings truncate with ellipsis, lists over 50 items paginate.

Rules of thumb per state:

StateShowDon't
LoadingSkeleton in the final layout's shapeSpinner centered in a void
Empty1 line of copy + a "create/import" actionThe bare word "No data"
ErrorWhat failed, in human words, + RetryA raw stack trace or nothing
OverflowTruncation, wrapping rules, paginationLayout that breaks at 200 chars

Skeletons: reserve the space

Loading states aren't just decoration — they prevent layout shift. web.dev's CLS guidance says it directly: reserve sufficient space in advance (placeholder or skeleton UI) so loaded content doesn't shove the page around; a good Cumulative Layout Shift score is 0.1 or less. NN/g's skeleton-screen research adds calibration: skeletons earn their keep on full-page loads of roughly 2–10 seconds; under ~1 second they're unnecessary, and past ~10 seconds a progress bar beats both. Prefer static skeletons over shimmering ones, and match the skeleton to the real layout — same card heights, same column widths — or you've just moved the reflow.

Power-user moves

Resources

Building an AI feature? Yeda AI designs, audits, and ships production LLM systems.

Talk to us · Read the blog