AI-assisted building2 min read

How to Review AI-Generated UI Code

AI-generated UI code often looks right in a screenshot and fails in use. The review should check behaviour, not appearance: how the component handles states, keyboard input, screen sizes, long text and errors. A short, consistent checklist catches most of the problems before they reach users.

Check semantics first

Look for buttons implemented as clickable divs, inputs without labels, images without alternative text and headings that skip levels. These problems are invisible in a visual review and expensive to fix later. Fix them before discussing colour or spacing.

Check every state

Confirm the component handles loading, empty, error, disabled and success states, not only the default. Generated code often covers the happy path and leaves the rest as placeholders. A placeholder that says 'TODO' should not reach production.

Check responsive behaviour

Test at phone width, tablet width and a wide desktop. Look for fixed widths, overflow, text that breaks awkwardly and touch targets that are too small. Test with long words and with right-to-left text if the product supports Arabic.

Check for duplication

AI tools often create a new component when an existing one would work. Search the project for similar components before accepting the change. Duplicated components drift apart and create inconsistent behaviour.

Read the logic, not only the markup

Look for hidden assumptions: a date that uses the server's time zone, a number that is not validated, a fetch with no error handling, a permission check that only happens in the interface. The most serious bugs are often in logic the screen does not show.

Require tests for behaviour

Ask for tests that describe what the component does: it submits the form, it shows the error, it disables the button while saving. A test that only checks that the component renders is weak evidence.

A review table

AreaQuestion
SemanticsAre the right elements and labels used?
StatesAre all states designed and handled?
ResponsiveDoes it work at phone width and with long text?
DuplicationDoes an existing component already do this?
LogicAre validation, time zones and errors handled?
TestsDo they check behaviour?

Treat generated code as a contribution from a fast but inexperienced collaborator. It can save hours, and it still needs the same review you would give a human colleague.

Next step

Get help improving conversion

Send me the page or flow that loses people. I will tell you where the friction is and what to change first.

Open the conversion page