Skip to content

fix(a11y): label ExtendedFloatingActionButtons for screen readers - #22

Merged
SiteRelEnby merged 2 commits into
mainfrom
fix/extended-fab-a11y
Jul 10, 2026
Merged

SiteRelEnby merged 2 commits into
mainfrom
fix/extended-fab-a11y

Conversation

@SiteRelEnby

Copy link
Copy Markdown
Collaborator

Problem

The home "Switch" FAB exposes no node to the accessibility tree - no name, no content-description, no clickable node at its bounds (confirmed via a uiautomator dump). TalkBack users cannot perceive or activate the home screen's primary action.

Root cause: the three-slot ExtendedFloatingActionButton keeps its label in the text slot, which Material3 wraps in an AnimatedVisibility for the expand/collapse animation. That wrapper can drop the text's semantics, leaving the merged FAB node unlabeled - and an unlabeled merged clickable node effectively disappears from the a11y tree.

Fix

Set the accessibility label directly on each affected FAB via Modifier.semantics { contentDescription = ... }, so the label never depends on the animated child, plus a testTag for UI automation.

Same construction (icon contentDescription = null + label in the text slot) exists in four places, so all four are fixed for consistency:

Screen Label testTag
Home Switch home_switch_fab
Polls New poll polls_new_fab
Reminders New reminder reminders_new_fab
Channels you own New invite channels_new_fab

The plain FloatingActionButtons elsewhere (Members, Groups, Journals, People, Custom fields) already give their Icon a contentDescription, so they were never affected and are left as-is.

Testing

  • :app:testPlayReleaseUnitTest green
  • :app:assemblePlayRelease green (through R8)
  • Not device-tested here; worth a TalkBack pass that each FAB now announces its action, and a uiautomator re-dump to confirm the nodes appear with the labels / testTags above.

The three-slot ExtendedFloatingActionButton keeps its label in the text
slot, which Material3 wraps in an AnimatedVisibility for the
expand/collapse animation. That can drop the text's semantics, leaving
the merged FAB node unlabeled - it exposes no name, content-description
or clickable node to the accessibility tree (confirmed via uiautomator
on the home "Switch" button). TalkBack users can't find or activate it.

Set the label directly on each affected FAB via semantics
contentDescription so it never depends on the animated child, and add a
testTag for UI automation. Covers all four instances of this pattern:
home Switch, New poll, New reminder, New invite. The plain
FloatingActionButtons elsewhere already label their icon, so they're
unaffected.
@SiteRelEnby
SiteRelEnby merged commit 8233a97 into main Jul 10, 2026
1 check passed
@SiteRelEnby
SiteRelEnby deleted the fix/extended-fab-a11y branch July 10, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant