Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
fix(dashboard): reveal message actions with a tap, not always
Yudhi Armyndharis13f362f0c92f
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex a6704d935..405015330 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -40,7 +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.+- Mark dashboard chat messages as tappable on touch screens, so iOS reveals their reply, react and delete actions on a tap as hover does with a mouse.- Fit the dashboard chat room's menu to the room's height, scrolling its entries, so a short window no longer cuts off the last ones.- Keep a member's name and number at the start edge of the dashboard group dialog in right-to-left languages, where a Latin name and every number sat at the left.- Name an unnamed dashboard chat by its formatted number on its list row, in its menu, dialogs and toasts and on the reply banner, instead of the bare digits of its id.diff --git a/dashboard/src/hover-reveal.test.ts b/dashboard/src/hover-reveal.test.tsindex 83743c94f..d1d6bdf0f 100644--- a/dashboard/src/hover-reveal.test.ts+++ b/dashboard/src/hover-reveal.test.ts@@ -42,21 +42,15 @@ test('the chat row menu trigger stays visible where there is no hover', () => {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', () => {+// The message actions (reply, react, delete) show on hover or keyboard focus. A touch screen reveals them with a tap,+// which iOS turns into hover only on an element it takes for clickable: the bubble container is marked so there.+test('a tap reveals the message actions on a touch screen, as hover does with a mouse', () => {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',+ /\.chats-page \.message-bubble-container:hover \.message-actions-menu/,+ 'the actions are no longer revealed by hovering their message',);+ const rule = /\.chats-page \.message-bubble-container\s*\{([^}]*)\}/.exec(mediaBody('(hover: none)'));+ assert.ok(rule, 'no message rule under (hover: none)');+ assert.match(rule[1], /cursor:\s*pointer/, 'iOS gives no hover to a tap on a message it does not take for clickable');});diff --git a/dashboard/src/pages/Chats.css b/dashboard/src/pages/Chats.cssindex d4f0ec1ae..0b17d00c1 100644--- a/dashboard/src/pages/Chats.css+++ b/dashboard/src/pages/Chats.css@@ -2609,15 +2609,12 @@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. */+/* A touch screen reveals the actions with a tap, as a mouse does with hover. iOS Safari gives :hover on a tap only to an+ element it takes for clickable, and a message has no click handler of its own; a pointer cursor marks it as one,+ with no other effect on a screen that has no pointer to show. */@media (hover: none) {- .chats-page .message-actions-menu {- display: flex;- position: static;- background: transparent;- box-shadow: none;+ .chats-page .message-bubble-container {+ cursor: pointer;}}