about summary refs log tree commit diff
path: root/src/screens
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-05-20 11:36:08 -0700
committerGitHub <noreply@github.com>2024-05-20 11:36:08 -0700
commit492216a584d8feef674dab898466dbb80af2a4f3 (patch)
tree6fad284faf1d5be400f286550bb5832ccf6cf047 /src/screens
parent24f8794d4db517540a2151440deb51bba171f89a (diff)
downloadvoidsky-492216a584d8feef674dab898466dbb80af2a4f3.tar.zst
[🐴] Screenreader accessibility actions for individual chat items (#4116)
* add accessibility tap to messages

* add a label for the accessibility action

* improve accessibility actions on chat list items

* adjust types

* more consistent wording

* make the strings localizable
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/Messages/List/ChatListItem.tsx18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/screens/Messages/List/ChatListItem.tsx b/src/screens/Messages/List/ChatListItem.tsx
index 9a9a78ba7..027e4aae3 100644
--- a/src/screens/Messages/List/ChatListItem.tsx
+++ b/src/screens/Messages/List/ChatListItem.tsx
@@ -127,6 +127,10 @@ function ChatListItemReady({
     })
   }, [convo.id, navigation])
 
+  const onLongPress = useCallback(() => {
+    menuControl.open()
+  }, [menuControl])
+
   return (
     <View
       // @ts-expect-error web only
@@ -135,10 +139,20 @@ function ChatListItemReady({
       onFocus={onFocus}
       onBlur={onMouseLeave}>
       <Button
-        label={profile.displayName || profile.handle}
         onPress={onPress}
         style={[a.flex_1]}
-        onLongPress={isNative ? menuControl.open : undefined}>
+        onLongPress={isNative ? onLongPress : undefined}
+        label={profile.displayName || profile.handle}
+        accessibilityHint={_(msg`Go to conversation with ${profile.handle}`)}
+        accessibilityActions={
+          isNative
+            ? [
+                {name: 'magicTap', label: _(msg`Open conversation options`)},
+                {name: 'longpress', label: _(msg`Open conversation options`)},
+              ]
+            : undefined
+        }
+        onAccessibilityAction={onLongPress}>
         {({hovered, pressed, focused}) => (
           <View
             style={[