Repairing Responsive Layout Failures Using Retrieval Augmented Generation

📅 2025-11-01
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Responsive web pages frequently exhibit layout failures (RLFs) at specific breakpoints, and manual CSS debugging is inefficient and experience-dependent. This paper proposes an automated CSS repair method based on retrieval-augmented generation (RAG): first, parsing HTML/CSS to localize faulty elements; second, retrieving relevant Stack Overflow Q&A as domain-specific context; and third, prompting a large language model (LLM) to generate semantically sound and visually faithful CSS patches. Our key contribution lies in integrating authentic developer community knowledge into the RAG framework, enabling synergistic optimization between domain expertise and LLM capabilities. Experiments demonstrate an 88% repair accuracy rate. Engineer evaluations confirm that the generated patches effectively restore layout correctness while preserving visual aesthetics, significantly improving responsive debugging efficiency.

Technology Category

Application Category

📝 Abstract
Responsive websites frequently experience distorted layouts at specific screen sizes, called Responsive Layout Failures (RLFs). Manually repairing these RLFs involves tedious trial-and-error adjustments of HTML elements and CSS properties. In this study, an automated repair approach, leveraging LLM combined with domain-specific knowledge is proposed. The approach is named ReDeFix, a Retrieval-Augmented Generation (RAG)-based solution that utilizes Stack Overflow (SO) discussions to guide LLM on CSS repairs. By augmenting relevant SO knowledge with RLF-specific contexts, ReDeFix creates a prompt that is sent to the LLM to generate CSS patches. Evaluation demonstrates that our approach achieves an 88% accuracy in repairing RLFs. Furthermore, a study from software engineers reveals that generated repairs produce visually correct layouts while maintaining aesthetics.
Problem

Research questions and friction points this paper is trying to address.

Automating repair of distorted responsive website layouts
Reducing manual trial-and-error CSS adjustments
Generating accurate CSS patches using retrieved knowledge
Innovation

Methods, ideas, or system contributions that make the work stand out.

Retrieval-Augmented Generation for CSS repairs
Leveraging Stack Overflow discussions for guidance
Augmenting domain knowledge to generate CSS patches
🔎 Similar Papers
No similar papers found.