Skip to content

Add link menu actions for screen readers - #2132

Open
mehranlatifi83 wants to merge 1 commit into
DrKLO:masterfrom
mehranlatifi83:fix/talkback-link-menu-unreachable
Open

mehranlatifi83 wants to merge 1 commit into
DrKLO:masterfrom
mehranlatifi83:fix/talkback-link-menu-unreachable

Conversation

@mehranlatifi83

@mehranlatifi83 mehranlatifi83 commented Sep 28, 2026 •

Copy link
Copy Markdown

Problem

Long pressing a link in a message opens a menu (open in app or browser, copy, and options for usernames and hashtags). TalkBack exposes links through its links menu, which can only open them; Android has no way to long press a link from there. So screen reader users cannot reach this menu.

Fix

In ChatMessageCell, add an accessibility action for each link that has such a menu, labeled with the link, that opens the same menu through the same code as a long press. These actions come after the message's other actions. Mentions (which open a profile on long press) and bot commands (which insert the command) have no menu and get no action.

Action ids come from a fixed list of resource ids (R.id.acc_action_...). TalkBack only lists a custom action when its id is above 0x01FFFFFF (AccessibilityNodeInfoUtils.isCustomAction), so ids from View.generateViewId() would never be shown.

Testing

With TalkBack on, focus a message with a link and a hashtag and open its actions.

Before: the link menu could not be reached. After: an action for each link opens it.

A link in a message, held down, opens a menu of what can be done with
it: opening it in the app or in a browser, copying it, and for a
username or a hashtag, what belongs to those. A screen reader reaches
the links of a message through its own list of them, and that list can
only open a link. It has no way of holding one down, and Android has no
way for it to, so for someone reading with a screen reader the menu was
not there at all.

Each link that has such a menu is given an action of its own on the
message now, named by the link, that opens the very same menu through
the very same code a link held down goes through. The actions come after
everything else the message offers, and the links stay where they are,
in the screen reader's own list. A name that opens a profile when held,
and a bot command, which is put into the field when held, have no menu
and get no action.

The ids of the actions are taken from a fixed list of resource ids. Ids
handed out for views are small numbers, and TalkBack lists a custom
action only when its id is above 0x01FFFFFF, so actions with such ids
were never shown.
@mehranlatifi83
mehranlatifi83 force-pushed the fix/talkback-link-menu-unreachable branch from 9e1f4f7 to 627e7c8 Compare October 1, 2026 23:01
@mehranlatifi83 mehranlatifi83 changed the title Give each link of a message the menu it has when held Oct 1, 2026
@mehranlatifi83
mehranlatifi83 force-pushed the fix/talkback-link-menu-unreachable branch from 627e7c8 to 416a024 Compare October 3, 2026 17:51
@mehranlatifi83
mehranlatifi83 force-pushed the fix/talkback-link-menu-unreachable branch from 416a024 to b569f96 Compare October 13, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant