From 19e03e87088b2bb07fbe0342b22225f2aa8298c3 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 7 Jul 2026 15:31:04 -0400 Subject: [PATCH] Make sure stale statuses are not presented to the screen reader, e.g. Hall Unlocked - This Hall is Locked. --- distro-packages/Arch-Linux/skald-git/PKGBUILD | 2 +- static/skald.js | 19 ++++--------------- webserver/static_accessibility_test.go | 1 + 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/distro-packages/Arch-Linux/skald-git/PKGBUILD b/distro-packages/Arch-Linux/skald-git/PKGBUILD index 04c119e..01febac 100644 --- a/distro-packages/Arch-Linux/skald-git/PKGBUILD +++ b/distro-packages/Arch-Linux/skald-git/PKGBUILD @@ -2,7 +2,7 @@ # shellcheck shell=bash disable=SC2034,SC2154 pkgname=skald-git -pkgver=0.0.0.r1540.g26c7808 +pkgver=0.0.0.r1547.g506c053 pkgrel=1 pkgdesc='Audio-only hall-based conferencing server' arch=('x86_64' 'aarch64') diff --git a/static/skald.js b/static/skald.js index cf21a78..02251d3 100644 --- a/static/skald.js +++ b/static/skald.js @@ -2650,6 +2650,7 @@ function flushLiveRegion(elementId) { let text = state.queue.shift(); if(text === undefined) { + announcement.replaceChildren(); state.active = false; return; } @@ -4221,11 +4222,7 @@ document.addEventListener('keydown', function(e) { setVisibility('show-chat', true); resizePeers(); - // Announce the action - let announcement = document.getElementById('chat-announcements'); - if(announcement) { - announcement.textContent = 'Chat collapsed'; - } + announceChat('Chat collapsed'); // Focus the show-chat button (delayed to ensure announcement is read) setTimeout(function() { @@ -4239,11 +4236,7 @@ document.addEventListener('keydown', function(e) { setVisibility('show-chat', false); resizePeers(); - // Announce the action - let announcement = document.getElementById('chat-announcements'); - if(announcement) { - announcement.textContent = 'Chat expanded'; - } + announceChat('Chat expanded'); // Focus the close-chat button (delayed to ensure announcement is read) setTimeout(function() { @@ -4272,11 +4265,7 @@ document.addEventListener('keydown', function(e) { localMute = !localMute; setLocalMute(localMute, true); - // Announce the action - let announcement = document.getElementById('chat-announcements'); - if(announcement) { - announcement.textContent = localMute ? 'Microphone muted' : 'Microphone unmuted'; - } + announceChat(localMute ? 'Microphone muted' : 'Microphone unmuted'); // Focus the mute button (delayed to ensure announcement is read) setTimeout(function() { diff --git a/webserver/static_accessibility_test.go b/webserver/static_accessibility_test.go index 202d0db..433c09d 100644 --- a/webserver/static_accessibility_test.go +++ b/webserver/static_accessibility_test.go @@ -56,6 +56,7 @@ func TestStaticLiveRegionAnnouncementsStayWired(t *testing.T) { requireFunctionContains(t, js, "announceLiveRegion", "state.queue.push") requireFunctionContains(t, js, "announceLiveRegion", "flushLiveRegion") requireFunctionContains(t, js, "flushLiveRegion", "appendChild") + requireFunctionContains(t, js, "flushLiveRegion", "if(text === undefined) {\n announcement.replaceChildren();") requireFunctionContains(t, js, "addToChatbox", "announceChat") requireFunctionContains(t, js, "setUserStatus", "announceUrgent(`${username}: hand raised`)") requireFunctionContains(t, js, "setUserStatus", "announceUrgent(`${username}: hand lowered`)")