From 1a8fa5cd4c3c7de1eb3abb701a41e2b9e92e5319 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Fri, 18 Sep 2026 19:27:23 -0400 Subject: [PATCH] a11y(typing): empty typing state announced 'undefined, undefined, undefined and -3 others are typing' (#187) 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 Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA --- src/app/features/room/RoomViewTyping.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/features/room/RoomViewTyping.tsx b/src/app/features/room/RoomViewTyping.tsx index 7fa6341e6..9bc330772 100644 --- a/src/app/features/room/RoomViewTyping.tsx +++ b/src/app/features/room/RoomViewTyping.tsx @@ -38,7 +38,12 @@ export const RoomViewTyping = as<'div', RoomViewTypingProps>( // a `role="status"` region added to the DOM together with its first text // is not reliably announced by some screen readers. 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`; } else if (typingNames.length === 2) { typingAnnouncement = `${typingNames[0]} and ${typingNames[1]} are typing`;