Skip to content

TalkBack, 10 of 10: Announce connection test feedback - #6168

Draft
eliotcougar wants to merge 7 commits into
2dust:masterfrom
eliotcougar:fix/accessibility-connection-tests
Draft

eliotcougar wants to merge 7 commits into
2dust:masterfrom
eliotcougar:fix/accessibility-connection-tests

Conversation

@eliotcougar

@eliotcougar eliotcougar commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Part 10 separates connection-test feedback from the continuously changing visual status:

  • The bottom row exposes Connected or Not connected and a native, localized Check connectivity action only while connected.
  • Current-test and bulk-test progress remain visible but inert to TalkBack.
  • An assertive live region publishes Testing, then the final current-test result or bulk completion. Fast results cannot replace the start message before it is published.
  • After the current result's live-region message retires, that result becomes available on the status row for subsequent navigation. Success/failure, full localized delay units, and available country/IP information are preserved.

Live-region implementation

Uses the exact same AccessibilityLiveRegionText implementation as Part 1, including locale spans, stable hidden idle node, frame-separated publication, and publication acknowledgement. The identical shared file keeps both branches independently buildable and avoids an add/add conflict.

Test messages are queued in publication order and held for one second after publication acknowledgement. This is a semantics lifetime, not a claim that the application can detect when TalkBack has finished speaking. Collection is limited to the resumed screen. Leaving it clears transient messages; a result received in the background remains durable ViewModel state and can be read upon return without replaying old speech.

There are no direct accessibility announcements, focus requests, native-role suppressions, or new interactive Snackbar/Toast nodes. Repeated identical tests retain distinct event IDs.

Request ownership and cancellation

  • Current and bulk requests carry independent UUIDs. Replies from older requests cannot finish newer tests, including repeated bulk tests in the same group.
  • A bulk test cancelled from its notification reports cancellation rather than successful completion. Empty service-side batches also retire without false completion feedback.
  • Current tests use daemon acknowledgement, so a missing daemon does not leave the UI indefinitely testing.
  • Native current probes have an owned scope. Replacing a probe, stopping the core, or reloading it cancels pending feedback. Cancellation checks prevent an old native result from being published, and a request-specific cancellation reply retires the UI's pending state. Cancellation does not claim to interrupt a blocking JNI call immediately.
  • Request IDs are optional Intent metadata. Existing serialized result and test-command payloads are unchanged; native library APIs and persisted data formats are unchanged.
  • State transitions and publication IDs stay on the main thread; cache reloads and native/network work remain on background dispatchers.

Localization and scope

All nine supported catalogs contain the completion, stable connected-state, and spoken delay resources. Russian connection-delay phrasing uses the accusative singular, independently of the server-list delay resource. No XML catalogs were split, and this revision changes no translation text.

The permanent Android test fixture and copy-only status helpers were removed. Focused JVM regressions cover queue ordering, repeated results, cancellation, stale publication callbacks, and current/bulk request ownership. Temporary Android instrumentation is outside the PR.

Validation

Validated revision: 94fe07227 (same tree as the merge-test candidate).

  • 64 JVM tests passed, including the seven focused feedback/request regressions.
  • Play Store debug Kotlin compilation and x86_64 APK assembly passed.
  • An external Android 13 / TalkBack-enabled probe exercised the real screen and ViewModel with controlled current-test replies. It verified same-main-thread-turn start/result ordering, repeated success and failure, delayed result exposure, stale replies after stop/replacement, and background-result retention without replay.
  • Real repository broadcasts verified matching bulk request IDs, rejection of stale completion, inert progress, and terminal completion publication.
  • The actual CoreTestService notification-cancel command path cleared testing without announcing Testing complete.
  • The real ordered-broadcast daemon-absent path retired a pending test without fabricating a result.
  • All three added resource keys exist exactly once in all nine locale catalogs.
  • Twenty pairwise merge simulations passed against current upstream and Parts 1–9 in both orders. The Part 1 shared live-region file is byte-identical after Git normalization; the merged repository and ViewModel event paths were inspected.
  • Whitespace checks passed. Generated native inputs, APKs, temporary instrumentation, and local instructions are not included.

Not run

  • Physical-device speech/voice and full spoken-utterance timing checks. The emulator probe preserved TalkBack and inspected native accessibility content/events; it does not assert that every phrase was audibly completed.
  • Actual blocking JNI cancellation and stop/reload races across VPN, proxy-only, and root modes. Request invalidation was checked through controlled replies; the native cancellation path was compiled and reviewed.
  • Full theme, layout, keyboard/D-pad, Android-version, and locale-fluency matrices; no visual layout or activation handler was redesigned.

The emulator's original APK and accessibility settings were preserved, with existing subscriptions and profiles left intact.

Keep bottom-bar accessibility semantics tied to the stable connection state while visual test progress continues to update. Emit assertive, locale-aware announcements only for test start and terminal current or bulk results, with localized spoken delay units and the native connection-test action intact.
@eliotcougar eliotcougar changed the title TalkBack, 10 of N: Announce connection test feedback TalkBack, 10 of 10: Announce connection test feedback Aug 30, 2026
Use millisekundu after the connection succeeded in phrase for one millisecond and other counts ending in one. The connection-test plural is already separate from standalone server-row delay units, whose nominative remains unchanged.

Play Store debug resource compilation and APK assembly pass. This changes no connection-test progress or result lifetime behavior.
@aliRahimi1997

Copy link
Copy Markdown
Contributor

I tested this PR with TalkBack.

The connection-test result itself is announced correctly when the test finishes, and there is no problem with that announcement.

The issue is that the result does not remain available on the “Check status” button after the test completes.

For example, if the test reports “Connected” and I hear it at that moment, everything is fine. However, if I do not hear the announcement, there is no result left on the button for TalkBack to read later. I have to run the connection test again to get the result announced again.

So the problem is not that the button cannot read its status when it has one. The problem is that the test result is not retained as persistent accessible information on the button after the test finishes.

Could you please check whether the latest connection-test result can remain exposed through the appropriate accessibility semantics/content of the button after the test completes, while keeping the existing one-time announcement?

I did not observe any other issue with the connection-test announcement.

@eliotcougar

Copy link
Copy Markdown
Contributor Author

The testing progress and result was hidden from TalkBack to prevent duplicate announcements (from the status bar and the live region at the same time). I guess, we can reset the hidden state after it was spoken once.

@eliotcougar
eliotcougar marked this pull request as draft August 31, 2026 09:25
Expose the localized current-test result as merged row text after its short-lived assertive live-region node retires. Keep the connection label stable and hide result text during another test, bulk progress, or disconnection. Reuse the full delay formatter and app-locale spans without changing visual text or native actions.

Cover success and error results, repeated event IDs, and retained state in JVM tests. Add an Android accessibility-tree regression for live-region visibility, repeated results, and the native connection-check action.
@eliotcougar
eliotcougar marked this pull request as ready for review August 31, 2026 12:31
aliRahimi1997 added a commit to aliRahimi1997/v2rayNG that referenced this pull request Aug 31, 2026
Adopt the overlapping terminology corrections from PR 2dust#6169 and carry them into branch-only plural and accessibility resources. This keeps later merge resolution from restoring stale Bakhtiari wording.
Keep feature-specific additions away from the common translated lines changed by neighboring accessibility PRs. Preserve every resource name, value and placeholder in the existing catalog.
Reuse Part 1's live-region primitive and queue start/result publication only while the screen is resumed. Keep terminal results readable after transient feedback retires, without direct announcements or focus changes.

Correlate current and bulk IPC replies by request ID, distinguish notification cancellation from completion, and acknowledge absent or cancelled native tests. Own native probe cancellation across replacement, stop, and reload so late replies cannot become fresh feedback.

Replace the permanent Android fixture and copy-only helper tests with focused request/queue regressions. Validation: 64 JVM tests, Play Store debug compilation/assembly, TalkBack-preserving external emulator checks, and 20 clean pairwise merge simulations. Actual JNI stop/reload races across all service modes were not run.
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.

2 participants