Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): lighten the read tick on the dark bubble

Yudhi Armyndharis10a35de74ee3
diff --git a/dashboard/src/App.css b/dashboard/src/App.css
index 4738949f3..5afcc4661 100644
--- a/dashboard/src/App.css
+++ b/dashboard/src/App.css
@@ -52,6 +52,9 @@
--text-muted: #94a3b8; /* Slate 400; 5.71:1 on Slate 800 (AA) */
--border: #334155; /* Slate 700 */
--info: #60a5fa; /* Blue 400 — lighter so it reads over the dark translucent-blue tints */
+ /* The read tick on the dark outgoing bubble (#005c4b), where --info is 3.14:1: Sky 300 is 4.78:1, the 4.5:1 the glyph
+ is held to. The delivered tick keeps the bubble's text colour (#e9edef), so the two stay apart by hue. */
+ --read-tick: #7dd3fc;
/* On the dark surfaces success and warning already clear AA (6.42:1 and 6.81:1), so they
keep their base value; error is 3.89:1 on Slate 800 and is lightened instead, to a value that still
clears 4.65:1 on the darkest error tint behind it (20 percent over Slate 800). */
@@ -88,6 +91,7 @@
--text-muted: #94a3b8;
--border: #334155;
--info: #60a5fa;
+ --read-tick: #7dd3fc;
/* On the dark surfaces success and warning already clear AA (6.42:1 and 6.81:1), so they
keep their base value; error is 3.89:1 on Slate 800 and is lightened instead, to a value that still
clears 4.65:1 on the darkest error tint behind it (20 percent over Slate 800). */
diff --git a/dashboard/src/pages/Chats.css b/dashboard/src/pages/Chats.css
index 43581d550..a81444f1f 100644
--- a/dashboard/src/pages/Chats.css
+++ b/dashboard/src/pages/Chats.css
@@ -774,20 +774,20 @@
.chats-page .message-status-icon.read {
/* The WhatsApp blue is 2.13:1 on the outgoing bubble, and these checks are TEXT, not an icon.
- Darkened to clear 4.5:1 there and on white; the status is also spelled out in aria-label/title,
+ Darkened to clear 4.5:1 there (4.62:1) and on white; the status is also spelled out in aria-label/title,
since delivered and read otherwise differ only by this colour. */
color: #337592;
}
-/* That blue is for the light bubble (1.56:1 on the dark green one). On the dark bubble the info blue clears
- the 3:1 a status glyph needs; the status is also spelled out in aria-label/title. */
+/* That blue is for the light bubble (4.62:1 on it, 1.56:1 on the dark green one). On the dark bubble the read tick
+ takes --read-tick, 4.78:1 there where --info is 3.14:1; the status is also spelled out in aria-label/title. */
[data-theme='dark'] .chats-page .message-status-icon.read {
- color: var(--info);
+ color: var(--read-tick);
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme='light']) .chats-page .message-status-icon.read {
- color: var(--info);
+ color: var(--read-tick);
}
}
diff --git a/dashboard/src/theme-contrast.test.ts b/dashboard/src/theme-contrast.test.ts
index 7059e1d15..58ed2e244 100644
--- a/dashboard/src/theme-contrast.test.ts
+++ b/dashboard/src/theme-contrast.test.ts
@@ -87,6 +87,10 @@ test('time stamps and read ticks on the outgoing bubble clear their ratios in bo
assert.match(chats, /\.message-bubble\.outgoing \.message-time\s*\{\s*color:\s*var\(--text-secondary\)/);
const secondaryLight = contrast(rgb(hexOf(blockAfter(LIGHT), '--text-secondary')), light);
assert.ok(secondaryLight >= 4.5, `light time stamp ${secondaryLight.toFixed(2)}:1`);
+ const lightTick = /\.chats-page \.message-status-icon\.read\s*\{[^}]*?color:\s*(#[0-9a-f]{6})/i.exec(chats);
+ assert.ok(lightTick, 'Chats.css has no light read tick colour');
+ const tickLight = contrast(rgb(lightTick[1]), light);
+ assert.ok(tickLight >= 4.5, `light read tick ${tickLight.toFixed(2)}:1`);
// The dark bubble and its read tick are written twice: once under [data-theme='dark'], once for the system theme.
const escape = (text: string): string => text.replace(/[[\]().]/g, '\\$&');
for (const [anchor, prefix] of [
@@ -100,14 +104,16 @@ test('time stamps and read ticks on the outgoing bubble clear their ratios in bo
assert.ok(bubble, `Chats.css has no outgoing bubble rule under ${prefix}`);
assert.match(
chats,
- new RegExp(`${escape(prefix)}\\.chats-page \\.message-status-icon\\.read\\s*\\{\\s*color:\\s*var\\(--info\\)`),
+ new RegExp(
+ `${escape(prefix)}\\.chats-page \\.message-status-icon\\.read\\s*\\{\\s*color:\\s*var\\(--read-tick\\)`,
+ ),
`Chats.css has no read tick rule under ${prefix}`,
);
const dark = rgb(bubble[1]);
const secondary = contrast(rgb(hexOf(blockAfter(anchor), '--text-secondary')), dark);
assert.ok(secondary >= 4.5, `${anchor} time stamp ${secondary.toFixed(2)}:1`);
- const tick = contrast(rgb(hexOf(blockAfter(anchor), '--info')), dark);
- assert.ok(tick >= 3, `${anchor} read tick ${tick.toFixed(2)}:1 (a status glyph needs 3:1)`);
+ const tick = contrast(rgb(hexOf(blockAfter(anchor), '--read-tick')), dark);
+ assert.ok(tick >= 4.5, `${anchor} read tick ${tick.toFixed(2)}:1 (the glyph is held to the 4.5:1 of text)`);
}
});