a11y(typing): empty typing state announced 'undefined, undefined, undefined and -3 others are typing' (#187)
CI / Build & Quality Checks (push) Successful in 1m33s
CI / Docker image build & smoke test (push) Skipped
CI / Secret scan (gitleaks) (push) Successful in 10s
CI / Trigger Desktop Build (push) Successful in 12s
CI / Playwright smoke (e2e) (push) Successful in 2m37s

RoomViewTyping's live region fell into the >3-names branch when nobody
was typing, so screen readers heard that string on every room load and
whenever typing stopped. Empty list now announces nothing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
2026-09-18 19:27:23 -04:00
co-authored by Claude Opus 5
parent 2e8244dc67
commit 1a8fa5cd4c
+6 -1
View File
@@ -38,7 +38,12 @@ export const RoomViewTyping = as<'div', RoomViewTypingProps>(
// a `role="status"` region added to the DOM together with its first text // a `role="status"` region added to the DOM together with its first text
// is not reliably announced by some screen readers. // is not reliably announced by some screen readers.
let typingAnnouncement = ''; let typingAnnouncement = '';
if (typingNames.length === 1) { if (typingNames.length === 0) {
// nobody typing — keep the region mounted but silent (the final `else`
// below used to announce "undefined, undefined, undefined and -3
// others are typing" on every room load, Gitea #187)
typingAnnouncement = '';
} else if (typingNames.length === 1) {
typingAnnouncement = `${typingNames[0]} is typing`; typingAnnouncement = `${typingNames[0]} is typing`;
} else if (typingNames.length === 2) { } else if (typingNames.length === 2) {
typingAnnouncement = `${typingNames[0]} and ${typingNames[1]} are typing`; typingAnnouncement = `${typingNames[0]} and ${typingNames[1]} are typing`;