Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

We ran 10 AI-written UI components across 6 viewports on real Chrome and Edge. All 10 passed every desktop check and all 10 failed on mobile. Here is the data.

Sushobhit Dua
Author

Saurabh Prakash
Reviewer
Published on: August 31, 2026
An AI coding agent verifies its own UI work at one screen width, and that width is a library default rather than a deliberate choice. Everything narrower ships unchecked, which is how a primary button ends up off the edge of a phone screen.
Rendering the change at a mobile width between 360px and 390px before merge, with assertions on element geometry rather than page scroll, catches this class of defect, and storing that render as a baseline keeps it caught. We measured how much it catches: ten agent-written components at six viewports on real Chrome and Microsoft Edge. All ten passed every desktop check and all ten failed on mobile.
TL;DR
To verify an AI-written UI change, render it at a mobile width between 360px and 390px before merge, then keep that rendering as a baseline so later builds compare against it. A second desktop width adds nothing. A second browser adds nothing. Viewport is the variable that exposes these defects.
How to Verify AI-Written UI Changes Across Viewports
Browser choice changed nothing. Chrome and Microsoft Edge returned identical defect counts on all 60 paired runs, and the three desktop widths agreed completely, so viewport width was the only variable that separated a passing render from a failing one.
The 2025 DORA report found that 90% of survey respondents report using AI at work, while 30% report little or no trust in the code generated by AI. The same report notes that AI adoption continues to have a negative relationship with software delivery stability.
Those two findings fit together once you look at what the agent can actually observe. An agent verifies by reading, running unit tests, and type checking, and all three inspect source code. When it does open a browser, it opens one, at one size.
That default matters more than it looks. Playwright ships with a 1280x720 viewport, so a self-check that renders the page inherits a comfortable desktop width nobody chose deliberately. Everything narrower is untested by construction.
We asked an AI coding agent for ten common interface pieces, one single-sentence prompt each, and accepted the first output without iteration. That is the state in which agent work usually arrives in a pull request.
Each render ran the same five checks in the page, all of them objective rather than a judgment about whether a layout looked good.
The touch target threshold comes from WCAG Success Criterion 2.5.5, a Level AAA criterion requiring pointer targets of at least 44 by 44 CSS pixels, subject to four stated exceptions.
Every component passed at every desktop width. Every component failed at both mobile widths. There was no middle ground in the results.
| Viewport | Renders with defects | Total defects |
|---|---|---|
| 1280x720 baseline | 0 of 20 | 0 |
| 1920x1080 | 0 of 20 | 0 |
| 1440x900 | 0 of 20 | 0 |
| 768x1024 | 6 of 20 | 20 |
| 390x844 | 20 of 20 | 214 |
| 360x800 | 20 of 20 | 222 |
The tablet width caught three components: the navigation bar overflowed by 63px, the KPI tile row by 124px, and the filter toolbar by 135px. Those same three were the worst offenders on mobile, which makes 768px a useful early warning rather than a substitute for a real mobile check.
The filter toolbar shows the failure most plainly. At 390px the page rendered 903px wide, leaving two filter dropdowns, the export control, and the primary New deployment button beyond the right edge and out of reach.
Across the sweep the defects concentrated in two categories. Chrome logged 143 elements pushed past the viewport edge and 68 undersized touch targets, against 17 horizontal page overflows. No component produced clipped content or overlapping siblings at any width.
Note: Every number above came from browsers running on TestMu AI, which gives you 3,000+ browser and OS combinations to render a change against before it merges. Start free
All 456 recorded defects trace back to three causes. Each one is a reasonable choice at the width it was written for, which is why review does not catch them.
That third pattern is the one worth internalising. Three of ten components were broken in a way that no amount of scroll detection would surface, and a reviewer scanning a screenshot would not measure a button to find it.
None of this is a reasoning failure. An AI coding agent works on a closed surface made of text: it reads source, writes source, and verifies with tools that also read source. A button positioned outside the viewport is valid code and a broken interface at the same time, and only one of those two facts is visible to a compiler.
Our data puts a boundary on that blind spot. The same CSS was correct at three separate desktop widths on two browsers, which rules out bad CSS as the cause. What the numbers point at is the closing condition of the verification loop: it ends at whatever width the agent happened to render, and nobody set that width.
The related question of whether agents can close this loop themselves is covered in our analysis of whether coding agents can test their own code, which reaches the same conclusion from the requirements side rather than the rendering side.
The fix is narrow. Render the change at a width the agent did not pick, and assert against the rendering rather than the source.
Which width to add is not a close call. Statcounter put mobile at 52.61% of worldwide platform share in July 2026, against 45.89% for desktop and 1.5% for tablet.
For the browser half of this, Kane CLI is built for the case where the thing requesting verification is itself an agent. It drives a real Chrome browser through the Chrome DevTools Protocol from a natural language objective, with no selectors or page objects to maintain, and returns an evidence-backed pass or fail rather than a transcript. Its agent mode suppresses the terminal interface and emits NDJSON, one object per line, so a coding agent can consume the verdict and close its own loop.
# Agent mode: structured NDJSON on stdout, no display server needed
kane-cli run "Open the deployments page at 390px wide and confirm the New deployment button is fully visible" --agent --headlessThe same binary and syntax run headed on a developer machine and headless in CI, which keeps the local check and the pipeline check honest about each other. Setup for both is in the Kane CLI agent mode documentation.
A check that runs once tells you today's answer. The reason to capture the rendering is that the next change gets compared against it instead of judged again from scratch.
SmartUI handles that half by storing screenshot baselines per browser and per viewport, then flagging pixel-level differences while filtering rendering noise, dynamic content and anti-aliasing artifacts. Its viewport list is declared in configuration, so the widths that caught defects in this study become the widths every later build is measured at.
{
"viewports": [[1920, 1080], [1280, 720], [768, 1024], [360, 640]]
}Baselines also survive branching. When a feature branch merges, SmartUI merges the branch baselines and surfaces a conflict for manual resolution when both branches changed the same screen, which is the same shape as a Git merge conflict. The full option set is in the SmartUI SDK configuration options.
Where this sits in a broader merge gate is laid out in our vibe coding QA workflow, and the underlying principle has its own treatment in verification-driven development.
Note: On the Statcounter figures above, a layout checked only at desktop widths is unverified for most visits. Render the change on 10,000+ real Android and iOS devices with the TestMu AI real device cloud.
Ten components is a small sample and the findings should be read as directional. The sample is bounded in ways worth stating plainly before anyone generalises from it.
What the sample does support is narrower and still useful: for first-pass agent output rendered standalone, viewport width predicted failure completely and browser choice predicted nothing.
Open the last UI change an agent wrote for you and render it at 390px. That takes a minute and, on this evidence, is where the defects are.
If it holds up, add that width to your pull request gate so the next one is checked automatically. Kane CLI covers the browser verification and SmartUI keeps the baseline, and both run against the same TestMu AI grid alongside the test automation cloud your existing suite already uses. Getting the first run going is covered in the Kane CLI getting started guide.
The broader shift this sits inside, where agents write and a separate layer proves, is mapped in our guide to agentic coding CLI tools.
Author
Sushobhit Dua is an Engineering Manager at TestMu AI (formerly LambdaTest), leading SmartUI, the visual regression and visual testing product. He manages the team that builds and ships SmartUI and maintains and cuts releases of the open-source SmartUI CLI. He works primarily in Core Java, Spring Boot, and Gradle, and is an AMCAT Certified Software Engineer. He brings over 10 years of software engineering experience, with earlier work as a Software Engineer at ecare Technology Labs. Sushobhit owns the SmartUI roadmap and the engineering decisions behind it.
Reviewer
Saurabh Prakash is an Engineering Manager at TestMu AI (formerly LambdaTest), where he leads engineering on agentic AI development and scalable system architecture for the quality engineering platform. He has also contributed to Test at Scale, the company's open-source test intelligence platform. He brings over 9 years of experience across Node.js, Java, Spring, MVC, data structures, algorithms, and scalable system design, with earlier roles as SDE 2 at Zomato, Senior Software Engineer at LogicHub, and Software Development Engineer at Directi. Saurabh holds a B.Tech in Computer Science and Engineering from Delhi Technological University.
Did you find this page helpful?
More Related Blogs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance