Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(dashboard): say that message actions follow non-pointer focus
Yudhi Armyndharisc63aefd531f3
diff --git a/dashboard/src/components/chats/ChatThread.test.ts b/dashboard/src/components/chats/ChatThread.test.tsindex b37a1eb22..cca898371 100644--- a/dashboard/src/components/chats/ChatThread.test.ts+++ b/dashboard/src/components/chats/ChatThread.test.ts@@ -1153,7 +1153,7 @@ for (const { when, pageHasFocus } of PAGE_BLURS) {// Chats.css shows the actions while focus is inside a bubble, but a click focuses the bubble too, and// its menu would stay drawn over the message after the pointer left. The thread marks pointer use and the// stylesheet reveals on focus only without the mark. jsdom has no layout, so the selectors are pinned.-test('a click marks pointer use, a key press clears it, and the stylesheet reveals on keyboard focus only', () => {+test('a pointer press marks pointer use, a key press clears it, and focus reveals the actions only without the mark', () => {const { container } = renderThread('operator', [PROMPT, { ...PROMPT, id: 'db-2', waMessageId: 'wamid.2' }]);const thread = container.querySelector<HTMLElement>('.room-messages');assert.ok(thread);@@ -1170,7 +1170,10 @@ test('a click marks pointer use, a key press clears it, and the stylesheet revea]) {const rule = css.split('\n').find(line => line.includes(target));assert.ok(rule, `${target} reveals the menu on focus`);- assert.ok(rule.includes('.room-messages:not([data-pointer])'), `${target} is gated on keyboard modality`);+ assert.ok(+ rule.includes('.room-messages:not([data-pointer])'),+ `${target} reveals only while the pointer mark is off`,+ );}});diff --git a/dashboard/src/components/chats/ChatThread.tsx b/dashboard/src/components/chats/ChatThread.tsxindex 00598f3bb..1e05469d5 100644--- a/dashboard/src/components/chats/ChatThread.tsx+++ b/dashboard/src/components/chats/ChatThread.tsx@@ -99,8 +99,8 @@ function ChatThread({// The message actions sit behind hover, so a keyboard user reaches them through the bubble that carries// them: the bubbles are one tab stop (the focused message, else the newest), the arrow keys move between- // them, and the actions show while keyboard focus is inside a bubble (Chats.css). Links, previews and- // buttons inside a message stay stops of their own.+ // them, and the actions show while focus is inside a bubble, unless a pointer brought it (Chats.css).+ // Links, previews and buttons inside a message stay stops of their own.const hasActions = useCallback((message: ChatMessageView) => canWrite && message.type !== 'revoked' && Boolean(message.waMessageId),[canWrite],