From 8069fbab2869b6c59e11df1370dcaed2e8ed9dba Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Wed, 22 Apr 2026 20:45:40 +0000 Subject: [PATCH] fix(botui): improve HTML streaming rendering to avoid loading dots lock --- botui/ui/suite/partials/chat.html | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/botui/ui/suite/partials/chat.html b/botui/ui/suite/partials/chat.html index d63e7d4e..999059b4 100644 --- a/botui/ui/suite/partials/chat.html +++ b/botui/ui/suite/partials/chat.html @@ -757,16 +757,13 @@ function addMessage(sender, content, msgId) { var renderInterval = 200; // ms between renders function isTagBalanced(html) { + // The browser's DOM parser is very resilient with unclosed tags. + // Blocking render until tags are perfectly balanced causes the entire + // message to be hidden (showing loading dots) if the LLM wraps everything + // in an outer
...
until the very last token. + // We only check if we're in the middle of writing a tag itself (e.g. ")', 'gi')) || []).length; - var closeCount = (html.match(new RegExp('', 'gi')) || []).length; - if (openCount !== closeCount) return false; - } - // Check if we are currently inside an opening tag (e.g.