Open Bug 2034875 Opened 6 months ago Updated 1 month ago

The "NEW" badge text is not exposed to assistive technology

Categories

(Firefox for Android :: Contextual AI, defect)

All
Android
defect

Tracking

()

Accessibility Severity s2

People

(Reporter: ayeddi, Unassigned)

References

Details

(Keywords: access, good-first-bug, Whiteboard: [fxdroid][group1])

Attachments

(1 file)

Steps to reproduce

  1. Have TalkBack running
  2. Open Nighly on any webpage
  3. Navigate to and activate More options button (kebab/app menu)
  4. Navigate to and activate More button in the app menu
  5. In the expanded menu, navigate to and focus with TalkBack the Summarize page button with a NEW badge and observe the screen reader's announcement

Expected behavior

TalkBack announces the New text as part of the button' accessible name, i.e. Summarize page, New, before announcing the role of the control (button)

Actual behavior

TalkBack ignores the New text even though it is visually presented as a part of the button's visible label, it announces: Summarize page before announcing the role of the control (button). TB users won't be aware the badge is there at all.

Device information

  • Firefox version: 152.0a1 (build #2016156887)
  • Android device model: Samsung Galaxy A54
  • Android OS version: 15

Any additional information?

Component: Toolbar → Contextual AI

The severity field is not set for this bug.
:matt-tighe, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(mtighe)
Severity: -- → S3
Flags: needinfo?(mtighe)
Whiteboard: [fxdroid][group1]

The severity field for this bug is set to S3. However, the accessibility severity is higher, .
:matt-tighe, could you consider increasing the severity?

For more information, please visit BugBot documentation.

Flags: needinfo?(mtighe)
Flags: needinfo?(mtighe)

Couldn't reproduce or verify this automatically (no Android build or emulator available), so it needs a developer to verify. The cause is clear from the code, though:

MenuItem() (fenix components/menu/compose/MenuItem.kt) uses clearAndSetSemantics, which sets contentDescription to the label plus description plus stateDescription. This drops the semantics of anything inside afterContent, including the StatusBadge. AddToTabGroupMenuItem works around this by passing the badge text as stateDescription. SummarizationMenuItem.kt does not.

Suggested fix in SummarizationMenuItem.kt (it isn't built yet):

val badgeText = stringResource(R.string.browser_menu_summarize_page_badge)
MenuItem(
    label = stringResource(id = R.string.browser_menu_summarize_page),
    stateDescription = if (summarizationMenuState.showNewFeatureBadge) badgeText else "",
    ...
    afterContent = { if (summarizationMenuState.showNewFeatureBadge) StatusBadge(..., status = badgeText) },
)

The UI test selectors find this item by its exact content description, so they need to switch to substring matching:

  • summarizePageButton() in ThreeDotMenuMainRobot.kt: add substring = true.
  • SUMMARIZE_PAGE_BUTTON in MainMenuSelectors.kt: use COMPOSE_BY_CONTENT_DESCRIPTION_SUBSTRING.

No other main-menu StatusBadge usage has this problem.


If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: