LLM UI Smells: The Anti-Patterns Every Developer Is Shipping in AI Product Interfaces — and How to Refactor Them A developer published a deep-dive cataloguing seven common "UI smells" in LLM-powered product interfaces and showing production-ready refactors for each. The piece argues that most AI chat UIs are built on patterns never designed for token streams, non-deterministic responses, or prompt injection, and walks through fixes such as consuming Server-Sent Events or ReadableStream chunks to render tokens incrementally instead of blocking on a full-screen spinner, and replacing dangerouslySetInnerHTML with a sanitizing markdown renderer like react-markdown with rehype-sanitize while wrapping user input in delimiters to defend against prompt injection. Originally published on tamiz.pro https://tamiz.pro/insights/llm-ui-smells-anti-patterns-refactoring . LLM-powered interfaces are popping up everywhere, but most of them are built on UI patterns that were never designed for token streams, non-deterministic responses, or prompt-injection attacks. The result is a new class of "UI smells"—code that works in a demo but collapses under real users. This deep-dive walks through seven of the most common anti-patterns I see in AI product interfaces, explains why they happen, and shows you concrete, production-ready refactors. The smell: You fire a request to /api/chat , set isLoading = true , and render a full-screen spinner until the entire response arrives. The user stares at a blank screen for 10–30 seconds, with zero feedback about what's happening. This is the single most common LLM UI anti-pattern, and it's a UX killer. Why it happens: Most developers are trained to treat API calls as atomic units. But LLM responses are streams, not files. The first token often arrives in under a second, while the last token might take 30 seconds. Blocking on the whole response is like downloading a 4K movie before showing the first frame. The bad version: function ChatScreen { const isLoading, setIsLoading = useState false ; const answer, setAnswer = useState '' ; async function sendPrompt prompt: string { setIsLoading true ; setAnswer '' ; const res = await fetch '/api/chat', { method: 'POST', body: JSON.stringify { prompt } , } ; const data = await res.json ; setAnswer data.answer ; setIsLoading false ; } if isLoading return