TalkBack, 8 of 10: Improve shared navigation and action labels - #6166
eliotcougar wants to merge 5 commits into
Conversation
Place page titles first within each top-app-bar traversal group, hide redundant drawer branding, and provide localized names for clear-search, App Picker More, and Logcat clipboard actions.
|
I tested PR #6166 on a real device with TalkBack enabled. Most of the shared navigation and action labels work correctly. I found two issues in the navigation drawer:
When the navigation drawer is opened, TalkBack initially places accessibility focus on a node that speaks nothing. I have to swipe once before the first actual navigation item is announced. Ideally, when the drawer opens, accessibility focus should start on the first meaningful navigation item rather than on a silent/non-actionable node, if this can be achieved using the standard Android/Compose accessibility mechanisms.
The navigation items are announced with "Tab" at the end. For example: "Settings, tab" The items otherwise work correctly. Could you please check whether this "Tab" role is actually the intended semantic role for these NavigationDrawerItem entries, or whether it is being introduced by the accessibility changes in this PR? I am intentionally not suggesting a custom TalkBack announcement or manually manipulating accessibility focus. I would prefer to preserve the native semantic contract and fix the underlying semantics/structure if necessary. Other shared action labels in this PR worked correctly in my testing. |
|
I will address the first issue. However, the second one has to stay. Tab is the default role of the Navigation drawer items. I intentionally did not override the roles anywhere in the new implementation. |
The branding text was already hidden, but its non-interactive Material Surface remained exposed as a silent accessibility stop. Hide that container as well while preserving the existing text exclusion, native drawer dismissal, item roles, and visual layout. No focus requests or locale-specific labels are introduced. Add a device regression test for hidden branding/header semantics and the native dismiss action. It fails on the previous APK and passes with the fix on API 30. All 57 unit tests and Play Store debug assembly pass. Not run: spoken TalkBack traversal, because TalkBack is not installed on the emulator.
Set a state-dependent native click label on the existing start/stop floating action button. TalkBack can describe double-tap Connect or Disconnect while retaining the existing accessible button name, native button semantics and MainAction.ToggleService dispatch. Add concise translations in all nine existing locale catalogs. Do not add a second action, custom announcement, focus request or service lifecycle change. Validation: 57 Play Store debug JVM tests, compilation and app/test APK assembly; focused button/drawer emulator tests and the nine-test combined main-screen suite. The button test verifies both labels, stable accessibility focus and unchanged accessibility-click, touch, Enter, Space and D-pad activation, waiting for asynchronous native action metadata updates. Not run: listening verification in every locale.
The localized service action label and its onClick import were inserted at the same locations as the connection-test PR live region and semantic imports, causing conflicts despite independent behavior. Relocate only those two existing lines into unchanged blocks. Keep the native FAB callback, Connect/Disconnect label, and all connection-test semantics intact without copying features between the focused PRs. Validation: standalone and paired Play Store JVM tests and Kotlin compilation pass; all 45 branch pairs merge in both orders with identical trees. The ten-PR stack also merges textually in both orders; its separate upstream routing-deletion API mismatch remains outside this fix. No runtime behavior or test files changed.
Give the existing Menu button a localized native click-action label without replacing its callback or role. Rely on Material 3 TopAppBar to provide its traversal group and keep only the lower title traversal index, preserving title-first ordering and the import boundary with the per-app accessibility branch. Remove the two permanent Android-test files from this focused contribution. Preserve their scenarios and unpublished test edits as external local QA. Leave both drawer hiding modifiers and the bottom-bar placement that avoids Part 10 conflicts unchanged. Validation: 57 JVM tests, Play Store debug compilation and x86_64 assembly passed. A TalkBack-enabled emulator check confirmed title-before-navigation traversal links on six screens, native Menu action labeling, accessibility/touch/Enter/Space/D-pad activation, drawer hiding and dismissal, search clearing, and App Picker overflow naming. These native-tree and input checks do not claim recorded TalkBack speech.
Summary
Improve shared navigation and action labels without replacing native controls:
retaining its existing Start service / Stop service accessible name.
Implementation
The title has
traversalIndex = -1f. Material 3 already makesTopAppBara traversalgroup, so there is no duplicate group modifier. This changes order only within the
bar; it does not request accessibility focus or rewrite window announcements.
Search mode keeps its existing text-input behavior. The small title-index modifier
keeps the shared top-bar imports separate from Part 6's
AppListItemchanges.Both the drawer header container and its text use
hideFromAccessibility. Theseare separate semantic nodes; hiding the container does not by itself hide its
child text in the pinned Compose version. Drawer destinations keep Material's
native roles, labels, selection semantics, and activation. Native drawer dismissal
is unchanged.
Menu and service-button action labels augment
onClicksemantics with a label anda null action. Their existing
IconButton/FloatingActionButtoncallbacks stillown activation. This does not introduce another click handler, duplicate custom
action, role suppression, or manual TalkBack announcement. Accessibility services
remain responsible for presenting their action menu and gesture hints.
Official guidance:
traversal ordering
and hiding decorative semantics.
Scope and compatibility
No service lifecycle, repository, subscription-update, paging, or server-selection
behavior changes. Main server rows, group-tab names/counts, and delay units remain
in Part 9; connection-test status and live-region feedback remain in Part 10.
This part does not touch
MainGroupTab,MainServerPager, orMainViewModel.The existing bottom-bar import and label placement is deliberately retained to
avoid overlap with Part 10. The redundant traversal-group helper and this PR's two
permanent Android-test files have been removed. UI checks are maintained as local
external QA, not test scaffolding in the contribution.
Localization
Clear search, Copy log to clipboard, Connect, and Disconnect are supplied in all
nine supported catalogs: English, Arabic, Bengali, Bakhtiari, Persian, Russian,
Vietnamese, Simplified Chinese, and Traditional Chinese. Menu and More options
reuse existing translated resources. No new translation changes were needed for
the review refinements.
Validation
Reviewed revision:
5ab00cd5642518c8382ccc3f191e6f6bf5c552db.:app:testPlaystoreDebugUnitTest: 57 tests passed, no failures, errors, or skips.:app:compilePlaystoreDebugKotlinand:app:assemblePlaystoreDebug -PABI_FILTERS=x86_64: passed. Final Gradle checkswere repeated on the committed revision.
title-before-navigation traversal links on Config, Settings, Subscriptions,
Logcat, About, and App Picker. The title ordering remained intact without the
redundant traversal-group modifier.
target; opened the drawer through accessibility click, injected touch, Enter,
Space, and D-pad center. Confirmed native dismissal and that no visible branding
or silent header precedes the drawer destinations.
normal title, and App Picker's accessible overflow name.
nine reused Menu-action entries for presence, uniqueness, and nonempty text.
accessibility branches passed in both orders with identical trees. These are
textual compatibility checks, not a full combined-build test.
git diff --check: passed. No Android-test scaffolding, generated native inputs,or instruction changes remain in the PR diff.
Not run
traversal links, node properties, and injected input do not prove exact spoken
wording or actual TalkBack gesture behavior.
dynamic-color, and single/double-column layout matrix. Runtime checks used one
English x86_64 emulator configuration.
leaves the bottom-bar service labels and implementation unchanged.