Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): round the chat unread badge and cap overflow (#880)

Yudhi Armyndhariscfc8e7995d93
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 64e5b285b..7b8be10b3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+### Fixed
+
+- **Chat list unread badge shape and overflow.** The unread-count badge in the chats sidebar rendered as an uneven oval and grew without bound as the count climbed. It now uses a fixed height with border-box sizing so a single digit is a true circle and larger counts form a rounded pill, and its label is capped at `99+`. The badge also exposes the exact unread count to assistive technology and as a hover tooltip.
+
## [0.10.7] - 2026-07-23
### Changed
diff --git a/dashboard/src/i18n/locales/ar.json b/dashboard/src/i18n/locales/ar.json
index ebba8f1e3..d13ac5515 100644
--- a/dashboard/src/i18n/locales/ar.json
+++ b/dashboard/src/i18n/locales/ar.json
@@ -84,6 +84,7 @@
"loadingChats": "جارٍ تحميل المحادثات...",
"empty": "لا توجد محادثات",
"noMessageYet": "لا توجد رسائل بعد",
+ "unreadBadge": "{{count}} رسائل غير مقروءة",
"loadingMessages": "جارٍ تحميل الرسائل...",
"noMessagesInChat": "لا توجد رسائل بعد. أرسل الرسالة الأولى للبدء!",
"downloadDocument": "تنزيل المستند",
diff --git a/dashboard/src/i18n/locales/en.json b/dashboard/src/i18n/locales/en.json
index f2cb6b9d3..e6d36aef5 100644
--- a/dashboard/src/i18n/locales/en.json
+++ b/dashboard/src/i18n/locales/en.json
@@ -84,6 +84,7 @@
"loadingChats": "Loading chats...",
"empty": "No chats",
"noMessageYet": "No messages yet",
+ "unreadBadge": "{{count}} unread messages",
"loadingMessages": "Loading messages...",
"noMessagesInChat": "No messages yet. Send the first message to get started!",
"downloadDocument": "Download document",
diff --git a/dashboard/src/i18n/locales/es.json b/dashboard/src/i18n/locales/es.json
index d931ca4fa..4c7ce2e53 100644
--- a/dashboard/src/i18n/locales/es.json
+++ b/dashboard/src/i18n/locales/es.json
@@ -84,6 +84,7 @@
"loadingChats": "Cargando chats...",
"empty": "Sin chats",
"noMessageYet": "Aún sin mensajes",
+ "unreadBadge": "{{count}} mensajes sin leer",
"loadingMessages": "Cargando mensajes...",
"noMessagesInChat": "Aún no hay mensajes. ¡Envía el primero para empezar!",
"downloadDocument": "Descargar documento",
diff --git a/dashboard/src/i18n/locales/fr.json b/dashboard/src/i18n/locales/fr.json
index cf7dfd48b..976a9b918 100644
--- a/dashboard/src/i18n/locales/fr.json
+++ b/dashboard/src/i18n/locales/fr.json
@@ -84,6 +84,7 @@
"loadingChats": "Chargement des discussions...",
"empty": "Aucune discussion",
"noMessageYet": "Aucun message pour le moment",
+ "unreadBadge": "{{count}} messages non lus",
"loadingMessages": "Chargement des messages...",
"noMessagesInChat": "Aucun message pour le moment. Envoyez le premier message pour commencer !",
"downloadDocument": "Télécharger le document",
diff --git a/dashboard/src/i18n/locales/he.json b/dashboard/src/i18n/locales/he.json
index 71bdebb3c..1b200f2d8 100644
--- a/dashboard/src/i18n/locales/he.json
+++ b/dashboard/src/i18n/locales/he.json
@@ -84,6 +84,7 @@
"loadingChats": "טוען שיחות...",
"empty": "אין שיחות",
"noMessageYet": "אין הודעות עדיין",
+ "unreadBadge": "{{count}} הודעות שלא נקראו",
"loadingMessages": "טוען הודעות...",
"noMessagesInChat": "אין הודעות עדיין. שלח את ההודעה הראשונה כדי להתחיל!",
"downloadDocument": "הורדת מסמך",
diff --git a/dashboard/src/i18n/locales/it.json b/dashboard/src/i18n/locales/it.json
index e7a8a2060..7bad2c7db 100644
--- a/dashboard/src/i18n/locales/it.json
+++ b/dashboard/src/i18n/locales/it.json
@@ -84,6 +84,7 @@
"loadingChats": "Caricamento chat...",
"empty": "Nessuna chat",
"noMessageYet": "Ancora nessun messaggio",
+ "unreadBadge": "{{count}} messaggi non letti",
"loadingMessages": "Caricamento messaggi...",
"noMessagesInChat": "Ancora nessun messaggio. Invia il primo messaggio per iniziare!",
"downloadDocument": "Scarica documento",
diff --git a/dashboard/src/i18n/locales/ko.json b/dashboard/src/i18n/locales/ko.json
index 17666701f..a4c534381 100644
--- a/dashboard/src/i18n/locales/ko.json
+++ b/dashboard/src/i18n/locales/ko.json
@@ -84,6 +84,7 @@
"loadingChats": "채팅 불러오는 중...",
"empty": "채팅 없음",
"noMessageYet": "아직 메시지 없음",
+ "unreadBadge": "읽지 않은 메시지 {{count}}개",
"loadingMessages": "메시지 불러오는 중...",
"noMessagesInChat": "아직 메시지가 없습니다. 첫 메시지를 보내 대화를 시작하세요!",
"downloadDocument": "문서 다운로드",
diff --git a/dashboard/src/i18n/locales/pt-BR.json b/dashboard/src/i18n/locales/pt-BR.json
index 867bbec2b..651764e1c 100644
--- a/dashboard/src/i18n/locales/pt-BR.json
+++ b/dashboard/src/i18n/locales/pt-BR.json
@@ -84,6 +84,7 @@
"loadingChats": "Carregando chats...",
"empty": "Sem chats",
"noMessageYet": "Ainda sem mensagens",
+ "unreadBadge": "{{count}} mensagens não lidas",
"loadingMessages": "Carregando mensagens...",
"noMessagesInChat": "Ainda não há mensagens. Envie a primeira para começar!",
"downloadDocument": "Baixar documento",
diff --git a/dashboard/src/i18n/locales/te.json b/dashboard/src/i18n/locales/te.json
index 492c3d08d..70e4a3667 100644
--- a/dashboard/src/i18n/locales/te.json
+++ b/dashboard/src/i18n/locales/te.json
@@ -84,6 +84,7 @@
"loadingChats": "చాట్‌లను లోడ్ చేస్తోంది...",
"empty": "చాట్‌లు లేవు",
"noMessageYet": "ఇంకా సందేశాలు లేవు",
+ "unreadBadge": "{{count}} చదవని సందేశాలు",
"loadingMessages": "సందేశాలను లోడ్ చేస్తోంది...",
"noMessagesInChat": "ఇంకా సందేశాలు లేవు. ప్రారంభించడానికి మొదటి సందేశాన్ని పంపండి!",
"downloadDocument": "డాక్యుమెంట్‌ను డౌన్‌లోడ్ చేయి",
diff --git a/dashboard/src/i18n/locales/zh-CN.json b/dashboard/src/i18n/locales/zh-CN.json
index 7e0ede8a3..2cc8e8587 100644
--- a/dashboard/src/i18n/locales/zh-CN.json
+++ b/dashboard/src/i18n/locales/zh-CN.json
@@ -84,6 +84,7 @@
"loadingChats": "正在加载聊天...",
"empty": "没有聊天",
"noMessageYet": "暂无消息",
+ "unreadBadge": "{{count}} 条未读消息",
"loadingMessages": "正在加载消息...",
"noMessagesInChat": "暂无消息。发送第一条消息即可开始!",
"downloadDocument": "下载文档",
diff --git a/dashboard/src/i18n/locales/zh-HK.json b/dashboard/src/i18n/locales/zh-HK.json
index 5e21a1fb9..dfa517786 100644
--- a/dashboard/src/i18n/locales/zh-HK.json
+++ b/dashboard/src/i18n/locales/zh-HK.json
@@ -84,6 +84,7 @@
"loadingChats": "正在載入聊天...",
"empty": "沒有聊天",
"noMessageYet": "尚無訊息",
+ "unreadBadge": "{{count}} 條未讀訊息",
"loadingMessages": "正在載入訊息...",
"noMessagesInChat": "尚無訊息。傳送第一則訊息即可開始!",
"downloadDocument": "下載文件",
diff --git a/dashboard/src/pages/Chats.css b/dashboard/src/pages/Chats.css
index 1ad620158..2087b8278 100644
--- a/dashboard/src/pages/Chats.css
+++ b/dashboard/src/pages/Chats.css
@@ -221,14 +221,19 @@
}
.chats-page .chat-unread-badge {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ box-sizing: border-box;
+ height: 20px;
+ min-width: 20px;
+ padding: 0 6px;
background: var(--primary);
color: white;
font-size: 0.75rem;
font-weight: 700;
- padding: 0.125rem 0.375rem;
- border-radius: 10px;
- min-width: 14px;
- text-align: center;
+ line-height: 1;
+ border-radius: 999px;
box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
}
diff --git a/dashboard/src/pages/Chats.tsx b/dashboard/src/pages/Chats.tsx
index 49e87470f..50e99c46a 100644
--- a/dashboard/src/pages/Chats.tsx
+++ b/dashboard/src/pages/Chats.tsx
@@ -966,7 +966,15 @@ export function Chats() {
<span className="no-message">{t('chats.noMessageYet')}</span>
)}
</span>
- {chat.unreadCount > 0 && <span className="chat-unread-badge">{chat.unreadCount}</span>}
+ {chat.unreadCount > 0 && (
+ <span
+ className="chat-unread-badge"
+ title={t('chats.unreadBadge', { count: chat.unreadCount })}
+ aria-label={t('chats.unreadBadge', { count: chat.unreadCount })}
+ >
+ {chat.unreadCount > 99 ? '99+' : chat.unreadCount}
+ </span>
+ )}
</div>
</div>
</div>