Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): show message actions on touch screens

Yudhi Armyndharis99e52f708fcf
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5b39f36f3..fd1a40d1c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- 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.
+- Keep the reply, react and delete actions of dashboard chat messages visible beside each bubble on touch screens, which have no hover to reveal them.
## [0.26.0] - 2026-10-28
diff --git a/dashboard/src/hover-reveal.test.ts b/dashboard/src/hover-reveal.test.ts
index 20c3b5a37..83743c94f 100644
--- a/dashboard/src/hover-reveal.test.ts
+++ b/dashboard/src/hover-reveal.test.ts
@@ -13,19 +13,22 @@ const css = readFileSync(join(dirname(fileURLToPath(import.meta.url)), 'pages/Ch
'',
);
-// The body of the first @media block whose condition is `query`, found by matching braces.
+// The bodies of every @media block whose condition is `query`, found by matching braces.
function mediaBody(query: string): string {
- const at = css.indexOf(`@media ${query}`);
- assert.notEqual(at, -1, `Chats.css has no @media ${query}`);
- const open = css.indexOf('{', at);
- let depth = 1;
- let i = open + 1;
- while (i < css.length && depth) {
- if (css[i] === '{') depth++;
- else if (css[i] === '}') depth--;
- i++;
+ const bodies: string[] = [];
+ for (let at = css.indexOf(`@media ${query}`); at !== -1; at = css.indexOf(`@media ${query}`, at + 1)) {
+ const open = css.indexOf('{', at);
+ let depth = 1;
+ let i = open + 1;
+ while (i < css.length && depth) {
+ if (css[i] === '{') depth++;
+ else if (css[i] === '}') depth--;
+ i++;
+ }
+ bodies.push(css.slice(open + 1, i - 1));
}
- return css.slice(open + 1, i - 1);
+ assert.notEqual(bodies.length, 0, `Chats.css has no @media ${query}`);
+ return bodies.join('\n');
}
test('the chat row menu trigger stays visible where there is no hover', () => {
@@ -38,3 +41,22 @@ test('the chat row menu trigger stays visible where there is no hover', () => {
assert.ok(rule, 'no trigger rule under (hover: none)');
assert.match(rule[1], /opacity:\s*1/);
});
+
+// The message actions (reply, react, delete) show on hover or keyboard focus. A tap on a message's text gives neither on
+// iOS, where a tap on an element with no click handler of its own fires no mouse events, so they stay visible there.
+test('the message actions stay visible where there is no hover, beside the bubble and not over its text', () => {
+ assert.match(
+ css,
+ /\.chats-page \.message-actions-menu\s*\{[^}]*position:\s*absolute;[^}]*display:\s*none;/,
+ 'the actions are no longer hidden over the bubble by default',
+ );
+ const rule = /\.chats-page \.message-actions-menu\s*\{([^}]*)\}/.exec(mediaBody('(hover: none)'));
+ assert.ok(rule, 'no actions rule under (hover: none)');
+ assert.match(rule[1], /display:\s*flex/);
+ assert.match(rule[1], /position:\s*static/, 'laid over the bubble the actions would hide its text');
+ // The rule has to come after the base rule it overrides, which has the same specificity.
+ assert.ok(
+ css.lastIndexOf('@media (hover: none)') > css.indexOf('.chats-page .message-actions-menu {'),
+ 'the touch rule comes before the rule that hides the actions, which then wins',
+ );
+});
diff --git a/dashboard/src/pages/Chats.css b/dashboard/src/pages/Chats.css
index 3c7d6d512..da1803bc3 100644
--- a/dashboard/src/pages/Chats.css
+++ b/dashboard/src/pages/Chats.css
@@ -2580,6 +2580,18 @@
display: flex;
}
+/* A touch screen has no hover to reveal them, and a tap on a message's text is no click on iOS, so the actions stay
+ visible there. They sit beside the bubble, in the gap the container keeps for them: over its corner they would hide
+ the start of every short message. */
+@media (hover: none) {
+ .chats-page .message-actions-menu {
+ display: flex;
+ position: static;
+ background: transparent;
+ box-shadow: none;
+ }
+}
+
/* A bubble is a keyboard stop (ChatThread): the ring says which message the arrow keys act on. */
.chats-page .message-bubble-container:focus-visible {
outline: 2px solid var(--focus-ring);