Skip to content

TalkBack reads a list item and its marker as one stop - #669

Open
bpappin wants to merge 1 commit into
mikepenz:developfrom
bpappin:feature/668_TalkBack_stops_on_a_list_item_marker
Open

bpappin wants to merge 1 commit into
mikepenz:developfrom
bpappin:feature/668_TalkBack_stops_on_a_list_item_marker

Conversation

@bpappin

@bpappin bpappin commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Description

TalkBack gave every list item two stops: the marker first ("Bullet", or "1."), then the item's text on the next swipe. MarkdownListItem grouped the marker and the content with isTraversalGroup = true, which sets reading order but does not combine the two into one stop, so the marker's MarkdownBasicText was focusable on its own.

Key Changes:

  1. One stop per item: In MarkdownList.kt, the list item row now uses semantics(mergeDescendants = true). The marker is read with its item: "Bullet, Item 1" or "1. Item 1". It keeps isTraversalGroup = true.
  2. Items with links: since Fixed talkBack skipping paragraphs with link by marking them merged #570, a paragraph with links merges itself so TalkBack does not skip it (TalkBack skips paragraphs with links #569). Inside a list item that merge would leave the marker on its own again. A new internal composition local, LocalMarkdownMergingAncestor, is set by the list item. MarkdownText skips its own merge while it is set, so the paragraph joins the item's stop and keeps its link annotations (Link element is ignored when TalkBack is enabled #487).
  3. Nested lists: a nested list's items merge themselves, so they stay separate stops and are not read as part of the item that holds them.
  4. List semantics: the list exposes CollectionInfo and each item CollectionItemInfo, so TalkBack announces "In list, 3 items" and each item's position ("1 of 3").

Everything inside one item, such as two paragraphs or a code block, is now read as that item's single stop.

Fixes #668

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build configuration change
  • Other (please describe):

How Has This Been Tested?

  • Unit tests: five new tests in MarkdownA11yTest. Each failed before the change and passes after it:

    • a bulleted item is one stop read with its bullet, and no stop holds the bullet alone
    • an ordered item is read with its number, in a list starting at 3
    • an item with a link is one stop with its bullet and keeps its link
    • a nested list's items stay their own stops
    • the list exposes its item count and each item's position

    ./gradlew :multiplatform-markdown-renderer-m3:jvmTest :multiplatform-markdown-renderer:jvmTest. The existing tests pass, including link_paragraph_merges_yet_keeps_both_links from Fixed talkBack skipping paragraphs with link by marking them merged #570.

  • Screenshots: ./gradlew :sample:android:verifyPaparazzi passes (156 snapshots), so the change affects semantics only and nothing is drawn differently.

  • API: ./gradlew apiCheck passes. The new composition local is internal.

  • Manual: the Android sample app with TalkBack 17 on an API 37 emulator. Swiping through the ordered and unordered lists reads "1. Item 1, 1 of 3, in list, 3 items" and "Bullet, Item 1, 1 of 3, in list, 3 items", one stop per item.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

- List item row merges its marker and content into one screen-reader stop
- Lists expose CollectionInfo and items CollectionItemInfo
- Paragraphs with links leave merging to an enclosing list item
- Add internal LocalMarkdownMergingAncestor
- Add list accessibility tests to MarkdownA11yTest

This branch has not been deployed

No deployments
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.

TalkBack stops on a list item's marker and its text separately

1 participant