I shipped a UI rewrite that nobody had looked at

I recently led a rewrite of an app’s interface from a design mockup. Most of the screens were built by coding agents working from issues I wrote. Every test passed, every change was reviewed, and everything was merged. Then the new UI reached production, and it looked wrong on almost every page. Tables showed up as stacks of label/value pairs. Groups that should have sat side by side were stacked in a column. A navigation element appeared in a place the design never had it.

This failure was mine, not the agents’. The agents did what I set them up to do. I set them up badly. Here is what went wrong and what I’m changing.

What I did wrong

1. Nobody looked at a rendered page before release

Screens were built, tested and merged without a single screenshot. Our test suite runs under jsdom, which has no layout engine. A test there can confirm that a table has the right columns while the browser draws that table as a pile of stacked cards. The few real-browser tests we had checked narrow things, like which layout a given width selects or what a color token resolves to. None of them checked what a page actually looks like.

There also wasn’t any way to run the app locally with realistic data: no fixture-backed dev mode and no screenshot tool. So “compare it to the mockup” wasn’t something an agent could actually do. The first person to see the finished product was a user, in production.

2. My docs made the mockup sound optional

My intent was always that the mockup should be copied exactly. Written requirements existed only because words can’t carry visual detail without growing longer than the mockup’s own HTML and CSS.

That isn’t what the docs said. They said the requirements were “functional only” and that once the screens were built, “the code is the visual reference.” Agents were held to those docs and to tests tied to requirement IDs, and they reasonably read this as “how it looks isn’t part of the contract.” One agent put a set of groups in a column instead of a row, met the written requirement, and moved on. By the rules I wrote, that was correct.

The fix isn’t to say fidelity was in scope all along. It’s to state, in so many words, that any visual detail the text leaves out is whatever the mockup shows, never whatever the implementation prefers, and that the code becomes the reference only after it matches the mockup.

3. I paraphrased the mockup instead of handing it over

The mockup is an HTML file, and its CSS is the real layout spec: section proportions, cell widths, label sizes, which tables scroll sideways. I rewrote all of that as sentences and small markup snippets. The rewrite dropped most of the detail and got some of it backwards. The mockup has no tab strip at all, but my docs described where the tab strip should go. The agents built it exactly as described.

Prose is a lossy copy of a mockup, and it’s an easy place to invent things by accident. The mockup itself should have been an input to every screen.

4. Many small issues worked in parallel, with no integration pass

I split the rewrite into a few dozen “draw screen X” issues. Separate agents took them in parallel, and each was merged once its unit tests passed. Nothing at the end rendered all the pages together and compared them to the mockup. So problems that affected everything, like a shared component misbehaving or the page chrome in the wrong order, showed up on every page at once and nobody caught them.

5. I reused shared components without checking how they rendered in the new layout

The table component came from the old UI. It switches to a stacked label/value layout whenever it’s wider than its container. The new design puts tables inside narrow sections, so every table stacked, even on a desktop screen. Each agent reused “the existing table” as told and never saw the result. I told them to reuse it, and I never checked it either.

What I’ll do differently

Build the visual feedback loop before any screen. A screenshot harness that renders every page over a fake, fixture-seeded backend at desktop and phone widths and writes out images took about an hour to build after the fact. That one tool would have prevented all of this. From now on it’s part of project setup, with the command documented and kept working.

Make “matches the mockup” an explicit acceptance criterion. Every screen issue will name the mockup file as an input and the screenshot command as the check. Done means: screenshot taken, compared with the mockup, and every difference either fixed or listed.

Give agents the mockup source, not my summary of it. Prose docs stay for behavior and functional requirements. For layout, sizes and structure they point to the mockup’s own markup and CSS. If a doc has to describe layout, it quotes the mockup. It never states a layout fact the mockup doesn’t show.

State the mockup’s authority in the spec itself:

  • Every screen copies the mockup exactly.
  • A detail the written requirements leave out is whatever the mockup shows.
  • A screen or element the mockup doesn’t include is drawn in the mockup’s visual style, based on the closest screen it does include.
  • The code becomes the reference only once it matches.

Each page will be labeled with which of these cases applies, so nobody reads “not spelled out” as “free to differ.”

Add a verification step with fresh eyes. After the implementing agent says it’s done, a separate reviewer re-takes the screenshots and tries to prove the report wrong by comparing against the mockup. People who build something tend to confirm their own work. A reviewer with no stake in it finds the gaps.

End every multi-screen effort with an integration pass. Render every page and review the whole set together, so problems in the chrome and shared components get spotted once and fixed once.

Render shared components in their new context before calling them “reused.” Responsive behavior tuned for one layout (stacking, collapsing, wrapping) is the usual way this breaks.

Keep unit tests, but don’t treat them as seeing the page. jsdom can’t catch a broken layout. A screen isn’t done until someone has looked at it.

The short version

I built a process that could check whether the UI was correct without anyone ever seeing it, and I wrote docs that made looking optional. Every step passed and the result still failed. Next time, the first thing I build is the ability to see the screens, and the mockup itself, not my description of it, is the standard every screen is checked against.

Advanced search: filter by model or tag