From 70c77095a7d14da0c1342589ece7302cdc5cccb2 Mon Sep 17 00:00:00 2001 From: Rodrigo Gomes da Silva Date: Sun, 9 Aug 2026 18:44:58 -0300 Subject: [PATCH] fix(a11y): clear stale aria-expanded when switching panels (#6656) _syncSidebarAria set aria-expanded on the newly-active rail button without unsetting the previous one, so chat -> kanban -> skills left three buttons all claiming aria-expanded=true. A screen reader announced three open disclosures when only one panel owns the sidebar. Reset every rail button that carries the attribute before setting the active one. --- static/boot.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/boot.js b/static/boot.js index 77fddfe2..afa2e1b0 100644 --- a/static/boot.js +++ b/static/boot.js @@ -529,6 +529,12 @@ function _isSidebarCollapsed(){ function _syncSidebarAria(){ // Mirror the open/collapsed state on the active rail button via aria-expanded // so screen readers announce the toggle. Open=true, collapsed=false. + // Clear the others first: only one panel owns the sidebar, but this used to set + // aria-expanded on the newly-active button without unsetting the previous one, + // so chat -> kanban -> skills left three buttons claiming aria-expanded=true + // and a screen reader announced three open disclosures. + document.querySelectorAll('.rail .rail-btn.nav-tab[data-panel][aria-expanded]') + .forEach(function(btn){ btn.setAttribute('aria-expanded','false'); }); const active=document.querySelector('.rail .rail-btn.nav-tab.active[data-panel]'); if(active)active.setAttribute('aria-expanded',!_isSidebarCollapsed()); }