Evaluating LLM Coding Ability with Single-File Web Desktop Applications

    A full web-based desktop interface built in a single HTML file is a demanding benchmark for large language models. This article explains why complete applications reveal more about LLM coding ability than simple code completion, proposes a six-dimension scoring rubric, and describes a standardized, reproducible testing process—including blind review, multiple sampling, and sample code for recording scores.

    Why Full Applications Are a Better Test of Coding Ability

    Completing a single function no longer reflects how capable a large language model really is at coding. In real development, engineers deal with cross-module state management, interdependent components, continuously growing codebases, and repeated refinements to UI details. Scaling the task up to “implement a desktop-style operating system interface in a single web page file” lets you observe a model’s performance across architecture design, code organization, visual fidelity, and interaction logic all at once.

    This kind of task has three defining characteristics. First, the requirements are broad: modules such as a text editor, terminal, file manager, drawing tool, and mini-games are independent of each other, yet they must share infrastructure for windows, files, and themes. Second, the constraints are clear: all code must be inlined in one file with no additional build steps, which tests the model’s understanding of the runtime environment. Third, the result can be opened and verified directly in a browser, reducing room for subjective judgment.

    Evaluation Dimensions

    Evaluation should separate “does it run” from “how well is it done.” The recommended approach is to score six dimensions, each worth up to 10 points.

    1. Functional completeness: Check each module against the requirements list, verifying that core operations work. For example, can the file manager create, rename, and delete files? Can the terminal execute basic commands?
    2. Engineering structure: Under the single-file constraint, is the code organized by function, are names consistent, is shared logic extracted into reusable functions, and are later modifications easy?
    3. Visuals and layout: Are UI elements accurately aligned, are spacing and color schemes consistent, and do details like icons, fonts, and shadows feel coherent?
    4. Responsiveness and mode switching: When window size or device type changes, does the interface switch correctly between desktop and mobile layouts, without overflowing or overlapping elements?
    5. Interaction and state: Do window dragging, z-order switching, focus transfer, and keyboard shortcuts behave intuitively? When multiple windows are manipulated simultaneously, do their states interfere with each other?
    6. Runtime stability: Are there uncaught exceptions in the console? Is there a reasonable fallback when external resources are missing? Does the page slow down noticeably after extended use?

    A Standardized Testing Process

    The core of the testing process is controlling variables. The following five steps ensure that results from different models are comparable.

    1. Unified prompt: All models receive the same requirements text, including the feature list, constraints, and output format. Differences in the prompt directly affect results, so it must not be adjusted casually.
    2. Independent runs: Each generated result is saved as a standalone file and opened in the same browser environment, recording load time and console output.
    3. Dimension-by-dimension recording: Score each of the six dimensions described above, attaching screenshots and issue descriptions for later review.
    4. Multiple sampling: Generate several outputs from the same model and compute the mean and variance of the scores. A single run is subject to randomness, and drawing conclusions from one result can be misleading.
    5. Blind review: Reviewers do not know which model produced each file, reducing bias from brand impressions and personal preferences.

    Here is a simple scoring record structure that makes aggregation and comparison easier:

    1. const scoreRecord = {
    2. modelLabel: "model-A", // Use a neutral ID; do not reveal the actual source
    3. runId: 3,
    4. scores: {
    5. functionality: 8,
    6. structure: 7,
    7. visual: 9,
    8. responsive: 6,
    9. interaction: 7,
    10. stability: 8
    11. },
    12. notes: [
    13. "Mobile taskbar overlaps with window stacking order",
    14. "Terminal history cannot be navigated with arrow keys"
    15. ]
    16. };
    17. function averageScore(record) {
    18. const values = Object.values(record.scores);
    19. const total = values.reduce((sum, v) => sum + v, 0);
    20. return total / values.length;
    21. }
    22. console.log(averageScore(scoreRecord)); // 7.5

    Key Implementation Challenges and What to Evaluate

    4.1 Desktop and Mobile Mode Switching

    A single page must adapt to both desktop and mobile screens. The common approach is to use media queries to detect viewport width and switch layouts accordingly. When reviewing, pay special attention to behavior near breakpoints—for example, whether the interface jumps or misaligns when the window width fluctuates around the threshold.

    1. @media (max-width: 768px) {
    2. .taskbar {
    3. position: fixed;
    4. bottom: 0;
    5. width: 100%;
    6. }
    7. .window {
    8. top: 0;
    9. left: 0;
    10. width: 100vw;
    11. height: calc(100vh - 48px);
    12. }
    13. }

    4.2 Window Stacking and Focus Management

    A multi-window system needs to maintain a z-order. When a window is clicked, it should be moved to the top and its focus state updated. Common problems in poor implementations include: an occluded window still receiving keyboard input, or focus being lost after a window closes, leaving keyboard events with nowhere to go.

    1. const windowStack = [];
    2. function focusWindow(win) {
    3. const index = windowStack.indexOf(win);
    4. if (index !== -1) windowStack.splice(index, 1);
    5. windowStack.push(win);
    6. windowStack.forEach((w, i) => {
    7. w.style.zIndex = 100 + i;
    8. w.classList.toggle("is-active", w === win);
    9. });
    10. }

    4.3 Simulating a File System

    Simulating a file system in the browser typically involves representing the directory tree as nested objects and persisting data with local storage. When reviewing, check two things: whether deleting a directory recursively removes