Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): mark the active chat filter by weight as well

Yudhi Armyndharis2bea307f1c70
diff --git a/dashboard/src/pages/Chats.css b/dashboard/src/pages/Chats.css
index 52bf920ce..e235d369a 100644
--- a/dashboard/src/pages/Chats.css
+++ b/dashboard/src/pages/Chats.css
@@ -594,10 +594,12 @@
background: var(--chat-hover);
}
+/* Heavier as well as tinted, so the chosen filter does not stand out by colour alone. */
.chats-page .chat-filter-pill.active {
background: var(--chat-pill-active-bg);
border-color: transparent;
color: var(--chat-pill-active-text);
+ font-weight: 600;
}
/* Lists */
diff --git a/dashboard/src/pages/Chats.css.test.ts b/dashboard/src/pages/Chats.css.test.ts
index 864e30e33..1e3059695 100644
--- a/dashboard/src/pages/Chats.css.test.ts
+++ b/dashboard/src/pages/Chats.css.test.ts
@@ -22,3 +22,15 @@ test('the new chat search clear button is a small icon button that does not grow
// Taller than the line of text it sits beside, so its block margin takes the difference back.
assert.match(rule[1], /margin-block:\s*-0\.5rem/);
});
+
+test('the active filter pill is heavier than the others, so it does not differ by colour alone', () => {
+ const weight = (selector: string): number => {
+ const rule = new RegExp(`${selector.replace(/[.]/g, '\\.')}\\s*\\{([^}]*)\\}`).exec(css);
+ assert.ok(rule, `no rule for ${selector}`);
+ return Number(/font-weight:\s*(\d+)/.exec(rule[1])?.[1]);
+ };
+ assert.ok(
+ weight('.chats-page .chat-filter-pill.active') > weight('.chats-page .chat-filter-pill'),
+ 'the active pill has the weight of the others',
+ );
+});