A Practical Retrospective on Generating Multi-Page Frontend Applications with AI Coding Tools
This article reviews a hands-on practice of using an AI coding tool to generate a multi-page frontend application of roughly ten pages. It evaluates the tool across verifiable engineering dimensions—long-task continuity, first-pass output quality, responsive layout, dependency selection, static type migration, project structure, and user experience—and concludes with actionable guidelines: phased generation with intermediate artifacts, responsive image baselines, dependency whitelists, contract-first typing, and grouped batch fixes. The goal is to help developers turn AI-assisted scaffolding and batch repair into a controllable engineering process.
1. Evaluation Background: Turning “User Experience” into Verifiable Engineering Dimensions
The value of AI coding tools cannot be judged by subjective impressions like “how fast it generates” or “how good the code looks.” A more reasonable approach is to break the experience down into verifiable engineering dimensions: long-task continuity, completeness of the first-pass output, responsive layout quality, style coverage, reasonableness of dependency choices, cost of migrating to static typing, batch-fix efficiency, directory structure planning, and the end-user experience of the final business flow. Only by observing these dimensions separately can we determine whether a problem originates at the interactive coding tool layer, the code generation service layer, or from missing engineering constraints in the project itself.
This article is an abstract retrospective based on a practice of generating a multi-page frontend application. The practice generated roughly ten pages in a continuous session. The first-pass output performed well on mobile, but the desktop side exposed issues such as insufficient image width/height constraints, missing footer styles, unclear boundaries for using heavy component libraries, and concentrated errors during static type migration. At the same time, the subsequent fix process went smoothly, batch handling of type errors showed good continuity, and the directory structure formed a solid engineering skeleton. These observations indicate that AI coding tools can already handle a large share of first-pass scaffolding work, but their output still needs to be constrained by engineering rules.
2. Long-Task Continuity: Interruptions When Generating Ten Pages in a Row
When generating about ten pages continuously, the generation process was interrupted. This should not be attributed to a single cause. Long-task generation is typically affected simultaneously by the context window, task queues, resource quotas, output length truncation, and session state management. As the page count grows, the design tokens, routing structure, API contracts, component conventions, and business rules accumulated in the context inflate, making it harder for the model to stay consistent across later pages.
A more robust approach is to split “generate ten pages continuously” into a staged pipeline: stage one generates the information architecture and route list; stage two generates page skeletons and shared layouts; stage three fills in the style baseline and responsive rules; stage four unifies type contracts and mock data; stage five handles regression fixes. Each stage produces a checkable intermediate artifact, such as a directory tree, a component list, an API field table, a style variable table, or an acceptance checklist. This way, even if the process is interrupted midway, context can be restored from the intermediate artifacts rather than relying on the full conversation history.
For interruption recovery, it is recommended to preserve four kinds of context: the current directory tree, the list of completed pages, the list of pending pages, and a summary of the unified contracts. Compressing a long conversation into a structured summary is far more stable than repeatedly appending scattered descriptions. For multi-page projects, generating in batches with milestones is more engineering-controllable than pursuing “everything done in one shot.”
3. First-Pass Output Quality: Usable on Mobile, Layout Risks on Desktop
The first-pass output in this practice was fairly complete on mobile, showing that the generation tool covers common mobile layout patterns, card structures, and basic interactions well. However, on desktop, inconsistent image widths and heights caused layout breakage, and the footer styles were not fully covered. Both are typical “usable on first pass, details pending acceptance” issues.
Inconsistent image dimensions usually come from three causes: the image container has no fixed aspect ratio; the image element has only a width set with no adaptive height; or images from different sources have very different intrinsic ratios with no cropping or fitting strategy applied. An image baseline should be established in global styles, for example:
img {max-width: 100%;height: auto;aspect-ratio: 16 / 9;object-fit: cover;}
At the same time, container ratios should be defined separately for different scenarios such as cards, carousels, product images, and avatars, so that a single global rule does not override all business semantics. The missing footer styles indicate that the style checklist was not included in first-pass acceptance. A footer typically contains multi-column links, copyright information, contact details, and social media entries, and misalignment is common at responsive breakpoints. It is advisable to provide a footer structure template before generation and to check alignment, spacing, and line wrapping at desktop, tablet, and mobile widths after generation.
The root cause of such issues is often not insufficient generation capability, but the lack of “responsive acceptance criteria” in the requirement description. If explicit constraints such as “images on desktop must keep a uniform aspect ratio” and “the footer must not misalign at any of the three breakpoints” are written into the prompt, first-pass quality improves noticeably.
4. Components and Dependencies: The Applicable Boundaries of Heavy Component Libraries
Introducing a large component library into pages with very low form complexity is a dependency-selection issue worth watching. Large component libraries typically provide complete capabilities—forms, tables, modals, date pickers, uploads—but at the cost of larger bundle size, higher style-override effort, increased build complexity, and unnecessary runtime burden on simple pages. For pages with only a few input fields and buttons, lightweight native controls or on-demand imports of small components are often more appropriate.
A more reasonable strategy is to establish a dependency whitelist and selection thresholds: when a page has fewer than a certain number of form fields, prefer lightweight solutions; introduce a heavy component library only when complex tables, date ranges, or cascading selects are genuinely needed; and when it is introduced, load it on demand and record the style override points. Without constraints, generation tools tend to pick the “most capable” option to guarantee that features work, but that is not the same as the engineering optimum. The fact that this issue was not flagged as a fix item in the first pass also shows that teams need to audit dependencies after generation, rather than only checking whether pages are clickable.
5. Static Type Migration: Batch Fixes from Dynamic Scripts to Static Typing
This practice started with dynamically typed scripts by default, and errors surfaced in concentration after switching to static type checking midway. In one case, about 25 type errors appeared, but the batch-fix process was interrupted only once, and most errors did not require manual, line-by-line modification. This is valuable: it shows that AI coding tools already have good continuity along the chain of “error location — grouping — batch modification — regression verification.”
Type errors usually concentrate in a few categories: inconsistent field nullability, un-narrowed union types, missing event object types, mismatches between API return values and page usage, and inconsistencies between mock data and real contracts. Fixes should establish type contracts first and then modify the implementation. For example:
UserContract:id: stringname: stringrole: enum(admin, member)OrderContract:id: stringuserId: stringstatus: enum(created, paid, closed)
Unifying the contracts first, and then aligning pages, components, and mock data to them, avoids the “fix one error, three more appear” pattern. For batch errors, it is recommended to fix them in groups by file or by error category, running a type check and basic regression after each group. AI tools are well suited to repetitive type narrowing and field alignment, but developers still need to review business semantics to avoid introducing unreasonable non-null assertions or overly broad types just to silence errors.
6. Code Structure: A Good Skeleton Without Human Intervention
In this practice, with no human intervention, the overall project structure was planned reasonably well, with four clear strengths: the page directory separated user pages that require permissions; the component directory separated layout components from other common components; static type definitions lived in their own folder; and mock data lived in its own folder. Such a skeleton matters greatly for later maintenance.
project/pages/user/public/components/layout/common/types/user-contractorder-contractmocks/user-dataorder-data
Isolating permissioned pages makes it easy to wire in route guards and permission checks uniformly; isolating layout components makes it easy to manage the header, sidebar, and footer consistently; isolating type definitions makes contracts shareable across pages or between frontend and backend; isolating mock data makes it easy to swap in real APIs and to isolate tests. Many problems in generated output are not that pages cannot be written, but that the structure is chaotic from the start, forcing every later change to be traced across directories. This practice shows that as long as directory conventions and responsibility boundaries are given before generation, the AI tool can produce a sound engineering skeleton.
7. User Experience: Acceptance Criteria for the Ordering Flow and the Personal Center
The generated site in this practice was fairly complete in the ordering flow and the personal center information display. An ordering flow typically includes product or service selection, quantity adjustment, address or contact entry, order confirmation, payment status feedback, and a result page; the personal center includes user information, order lists, order statuses, action entries, and empty-state hints. These pages must not merely “render”—they require clear state transitions, explicit error messaging, and consistent operations across mobile and desktop.
Acceptance should focus on: whether form validation covers required fields, formats, and boundary values; whether submit buttons have loading states and duplicate-submission protection; whether failures produce recoverable prompts; whether order statuses have clear copy; whether empty lists provide guidance; whether the personal center’s information hierarchy is clear; and whether key operations are reachable above the fold on both desktop and mobile. Compared with earlier similar generation practices, the overall site experience in this practice improved noticeably, but the closer the output gets to real business, the more the user-experience acceptance checklist needs to be moved forward into the generation instructions.
8. Attribution and Collaboration: What the Tool Layer and the Generation Layer Each Own
The issues above should not be casually attributed to a single link in the chain. Long-task interruption leans toward task scheduling and context management at the tool layer; image ratios, footer styles, and component selection lean toward the generation layer’s understanding of engineering constraints; static type errors involve generation quality, missing contracts, and migration strategy simultaneously. A reasonable collaboration model is to classify problems: tool-layer issues are mitigated through staged generation and context summaries; generation-layer issues are improved through explicit constraints, templates, and acceptance checklists; engineering-layer issues are backstopped by type contracts, dependency whitelists, and directory conventions.
9. Action Checklist and Conclusion
Overall, AI coding tools can already significantly improve first-pass scaffolding and batch-fix efficiency for multi-page frontend applications, but their output must be brought under engineering governance. The following checklist is recommended: generate in stages and keep intermediate artifacts; provide design tokens and a responsive image baseline; maintain a component-library dependency whitelist; put static type contracts first; manage pages, components, types, and mock data in separate directories; build state and exception acceptance checklists for the ordering flow and the personal center; and after fixes, run type checks, build checks, and key-path regression.
In a cloud-based development workflow, static assets can be hosted on object storage, build and runtime logs can be connected to a logging service, and anomalies can be tracked through monitoring and alerting; the general-purpose capabilities offered by Baidu AI Cloud can serve as components of such a pipeline. The overall conclusion is this: the value of AI coding tools lies not in generating perfect pages in one shot, but in turning repetitive scaffolding and batch fixes into a controllable process. What developers need to do is write the engineering constraints clearly, move acceptance criteria forward, and group the fix process—thereby building a stable collaboration between efficiency and maintainability.
