Repository navigation
Add link menu actions for screen readers - #2132
Open
mehranlatifi83 wants to merge 1 commit into
Open
mehranlatifi83 wants to merge 1 commit into
mehranlatifi83 wants to merge 1 commit into
Conversation
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
force-pushed
the
fix/talkback-link-menu-unreachable
branch
from
October 1, 2026 23:01
9e1f4f7 to
627e7c8
Compare
mehranlatifi83
force-pushed
the
fix/talkback-link-menu-unreachable
branch
from
October 3, 2026 17:51
627e7c8 to
416a024
Compare
mehranlatifi83
force-pushed
the
fix/talkback-link-menu-unreachable
branch
from
October 13, 2026 11:44
416a024 to
b569f96
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 above0x01FFFFFF(AccessibilityNodeInfoUtils.isCustomAction), so ids fromView.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.