From da2bb912264e392b7efa7835c276be52ae2ec343 Mon Sep 17 00:00:00 2001 From: agessaman Date: Sat, 24 Oct 2026 13:38:15 -0700 Subject: [PATCH] fix(web_viewer): announce connection changes and let the log stream take focus The navbar's connection text changed silently, so a screen-reader user wasn't told when the viewer lost or regained its link to the bot. It becomes a status region after the first update, which keeps the routine connect on every page load quiet and announces later changes; it's only rewritten when the text actually changes. The Logs stream scrolls but couldn't take focus, so keyboard users couldn't scroll it. It is now a focusable region named "Bot log stream". It is deliberately not a live region: announcing every log line would drown everything else. --- modules/web_viewer/templates/base.html | 7 ++++++- modules/web_viewer/templates/logs.html | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/web_viewer/templates/base.html b/modules/web_viewer/templates/base.html index 8a82956..8a2bcdc 100644 --- a/modules/web_viewer/templates/base.html +++ b/modules/web_viewer/templates/base.html @@ -1277,8 +1277,13 @@ const statusElement = document.getElementById('connection-text'); const indicatorElement = document.getElementById('connection-status'); - if (statusElement) { + if (statusElement && statusElement.textContent !== text) { statusElement.textContent = text; + // Announce later changes (a dropped or restored link), but + // not the first connect every page load makes. + if (!statusElement.hasAttribute('role')) { + statusElement.setAttribute('role', 'status'); + } } if (indicatorElement) { indicatorElement.className = `status-indicator status-${status}`; diff --git a/modules/web_viewer/templates/logs.html b/modules/web_viewer/templates/logs.html index aeb1657..cd352f1 100644 --- a/modules/web_viewer/templates/logs.html +++ b/modules/web_viewer/templates/logs.html @@ -157,7 +157,7 @@
-
+
Waiting for log data…