Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): announce the chat list's unread badges

Yudhi Armyndharis1b49389c1373
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4097be4c7..5b39f36f3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Draw links inside a quoted dashboard chat message in the chat link colours, which clear 4.5:1 on the quote in light and dark themes.
- Draw the selection check in the dashboard New group list dark on its green fill, where white measured under 3:1.
- Name the buttons that remove a staged file and close a reply above the dashboard chat composer for screen readers.
+- Announce the unread badges on dashboard chat list rows to screen readers, including the dot of a chat marked as unread.
## [0.26.0] - 2026-10-28
diff --git a/dashboard/src/components/chats/ChatSidebar.test.ts b/dashboard/src/components/chats/ChatSidebar.test.ts
index 66bb5702c..3cc8794b2 100644
--- a/dashboard/src/components/chats/ChatSidebar.test.ts
+++ b/dashboard/src/components/chats/ChatSidebar.test.ts
@@ -105,6 +105,10 @@ test('a chat marked unread (count -1) shows an unread badge without a number', (
['3', t('chats.unreadBadge', { count: 3 })],
],
);
+ // A label on an element with no role is not announced: each badge is an image named by it, as the pin and mute are.
+ for (const name of [t('chats.markedUnread'), t('chats.unreadBadge', { count: 3 })]) {
+ assert.equal(rtl.screen.queryAllByRole('img', { name }).length, 1, `${name} is not announced`);
+ }
});
test('a quick filter that leaves no chat says so, while an empty account still reads as having none', () => {
diff --git a/dashboard/src/components/chats/ChatSidebar.tsx b/dashboard/src/components/chats/ChatSidebar.tsx
index 73fb93621..35c6a2f24 100644
--- a/dashboard/src/components/chats/ChatSidebar.tsx
+++ b/dashboard/src/components/chats/ChatSidebar.tsx
@@ -154,16 +154,19 @@ function ChatSidebar({
{chat.pinned && <Pin size={15} role="img" aria-label={t('chats.rowActions.pinnedLabel')} />}
</span>
)}
- {/* A negative count is a chat marked unread (Baileys reports -1): a badge with no number. */}
+ {/* A negative count is a chat marked unread (Baileys reports -1): a badge with no number. Each badge is an
+ image, as the flags beside it are: a label on a bare span is dropped by most screen readers. */}
{chat.unreadCount < 0 ? (
<span
className="chat-unread-badge"
+ role="img"
title={t('chats.markedUnread')}
aria-label={t('chats.markedUnread')}
/>
) : chat.unreadCount > 0 ? (
<span
className="chat-unread-badge"
+ role="img"
title={t('chats.unreadBadge', { count: chat.unreadCount })}
aria-label={t('chats.unreadBadge', { count: chat.unreadCount })}
>