What Vibe Coding Misses: The Frontend Work Behind Production-Ready UI
Vibe coding can take a prompt and turn it into a convincing interface surprisingly fast. Give an AI coding tool a screenshot, a component description or a short product brief and it can generate a page that looks close t
Vibe coding can take a prompt and turn it into a convincing interface surprisingly fast. Give an AI coding tool a screenshot, a component description or a short product brief and it can generate a page that looks close to finished.
That speed is useful. It is also easy to mistake visible completeness for production readiness.
A clean screenshot confirms that the page rendered once with the data and conditions used during the demo. It does not tell you what happens when the request fails, the account contains no data, a user navigates with a keyboard or the page loads over a slow mobile connection.
Developers still own those parts. They are where a generated interface becomes a dependable product.
A generated demo usually implements one path
Most prompts describe the successful outcome:
Build a login form with email and password fields.
The generated result may work perfectly when:
- Both fields contain valid values
- The authentication service responds immediately
- The request succeeds on the first attempt
- The user clicks the button only once
Production users will eventually do something else. The network may time out. The API may return 401, 429 or 500. A password manager may fill the form unexpectedly. Someone may press Enter twice. The session may expire between loading the page and submitting the form.
The basic UI is not the difficult part. The difficult part is deciding how the interface behaves when reality stops matching the prompt.
Model the states before polishing the component
For most data-driven screens, data is not the only state. At minimum, consider:
type ViewState<T> =
| { status: "idle" }
| { status: "loading" }
| { status: "success"; data: T }
| { status: "empty" }
| { status: "error"; message: string };
This small model forces useful questions:
- Can users distinguish loading from a frozen page?
- Does an empty account explain what to do next?
- Can a failed request be retried safely?
- Does stale data remain visible during a refresh?
- What happens if a user triggers the same mutation twice?
An AI-generated component may collapse all of this into data ? <List /> : null. That looks fine with seed data and becomes a blank screen in production.
A more deliberate render path makes the states explicit:
function ContactList({ state }: { state: ViewState<Contact[]> }) {
switch (state.status) {
case "idle":
case "loading":
return <ContactListSkeleton />;
case "empty":
return <EmptyContacts />;
case "error":
return <ErrorNotice message={state.message} />;
case "success":
return <Contacts items={state.data} />;
}
}
The exact implementation is less important than making every meaningful state intentional.
Screenshots cannot verify accessibility
Two interfaces can look pixel-identical while only one works with a keyboard or screen reader.
For example, this can be styled to look like a button:
<div class="button" onclick="save()">Save</div>
But it does not automatically provide button semantics, keyboard behavior or the expected information to assistive technology.
Start with the native element:
<button type="button" onclick="save()">Save</button>
The browser gives you focus behavior, keyboard activation and semantic meaning. Recreating all of that on a div adds work and usually leaves gaps.
After generating a UI, run a keyboard-only pass:
- Put the mouse aside.
- Use Tab and Shift+Tab to move through the page.
- Confirm that focus is visible.
- Open and close dialogs using the keyboard.
- Check that focus returns to the element that opened the dialog.
- Confirm that validation errors are announced and associated with the correct fields.
Also inspect accessible names and roles in browser developer tools. A visual review cannot tell you whether an icon-only control is announced as βbuttonβ or as an unlabeled mystery element.
Performance has no visual signature
A screenshot taken after 400 milliseconds looks the same as one taken after four seconds.
Generated frontends often work well in a local environment with a fast machine, cached assets and a nearby API. Real users may have slower devices, higher latency and an empty cache.
Common problems include:
- Serving a multi-megabyte image inside a small card
- Importing an entire utility or charting library for one function
- Loading several font files before rendering text
- Sending API requests sequentially when they could run concurrently
- Shipping client-side JavaScript for content that could be rendered earlier
- Rendering hundreds of rows without pagination or virtualization
Do not judge this by feel. Use the Network and Performance panels in browser developer tools. Test with cache disabled and network throttling enabled. Check the page on a production build because development mode can behave differently.
If the application has key user journeys, measure those journeys rather than only the landing page. A fast homepage does not compensate for a slow dashboard after login.
Sample data hides layout failures
Generated demos tend to use neat, predictable content:
- Short names
- Complete profile images
- Small lists
- Valid URLs
- Descriptions of similar length
Real data is not neat.
Before shipping, test the interface with:
- An empty list
- One item
- Hundreds of items
- Very long names and unbroken strings
- Missing optional fields
- Failed images
- Localized text that is longer than the English version
- Dates, numbers and right-to-left content where relevant
This is not only visual QA. Unexpected data can reveal unsafe assumptions, unhandled exceptions and expensive rendering behavior.
Error handling should help without exposing internals
AI-generated code sometimes returns whatever error the server provides:
catch (error) {
setMessage(String(error));
}
That can produce an unhelpful message for the user and, depending on the response, expose implementation details.
Map technical failures to messages users can act on. Log the diagnostic information through the appropriate internal channel rather than rendering it directly.
catch (error) {
reportError(error);
setMessage("We couldn't save your changes. Check your connection and try again.");
}
The goal is not to make every message vague. βThis invitation has expired. Ask the workspace owner for a new linkβ is useful. A raw stack trace, database error or internal service name is not.
Security is another invisible layer
A generated form can work correctly and still introduce risk. Visual acceptance testing will not reveal:
- Secrets included in client-side code
- Unsafe rendering of untrusted HTML
- Missing server-side authorization
- Vulnerable dependencies
- Overly permissive cross-origin settings
- Missing security headers
- Sensitive information exposed through error responses or logs
Treat generated code like code from any other source. Review it, test it and scan it before trusting it.
Do not rely on client-side checks for authorization. Hiding a button does not prevent someone from calling the underlying endpoint. The server must verify whether the current user is allowed to perform the requested action.
Add a second pass to the vibe-coding workflow
The answer is not to stop using AI-assisted coding. The answer is to separate fast generation from production verification.
After the first working version, run a deliberate second pass:
State testing
- Loading
- Empty
- Partial data
- Failed request
- Retry
- Duplicate submission
- Expired session
Accessibility testing
- Keyboard navigation
- Visible focus
- Accessible names
- Correct heading order
- Form labels and error associations
- Dialog focus management
Performance testing
- Production build
- Empty cache
- Throttled network
- Large data set
- Oversized assets
- Unnecessary JavaScript
Security review
- Secret detection
- Dependency scanning
- Authorization checks
- Input and output handling
- Security headers
- Error and logging review
Resilience testing
- Slow API
- Offline transition
- Cancelled requests
- Repeated clicks
- Back and forward navigation
- Refresh during an in-progress action
This does not need to become a month-long audit. Even a focused pass through the riskiest user journey can expose problems that no screenshot review will catch.
Automate the checks that developers forget under deadline pressure
Manual review remains valuable, but repeatable checks should move into the development workflow wherever possible.
Use unit and integration tests for behavior, end-to-end tests for critical journeys and automated accessibility checks for common violations. Run dependency and source-code security checks in CI. Monitor the deployed application because some issues only exist after hosting, DNS, headers and production configuration enter the picture.
FlawPilot can support that second layer by checking a deployed site across security, performance, infrastructure and SEO. Its source-code security scanning can also identify insecure patterns, exposed secrets and vulnerable dependencies when a repository is connected. It does not replace code review or developer judgment. It helps make the checks repeatable and gives teams prioritized remediation guidance.
Conclusion
Vibe coding reduces the time required to reach a convincing first version. It does not remove the engineering work between βthe interface renderedβ and βthe product is ready for users.β
The useful distinction is simple: βLooks rightβ is a visual result. βWorks rightβ is a system property.
Generate quickly, then test the parts the screenshot cannot show.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.