Skip to content

TalkBack, 1 of 10: Add accessible transient message live regions - #6157

Draft
eliotcougar wants to merge 20 commits into
2dust:masterfrom
eliotcougar:fix/accessibility-live-regions
Draft

eliotcougar wants to merge 20 commits into
2dust:masterfrom
eliotcougar:fix/accessibility-live-regions

Conversation

@eliotcougar

@eliotcougar eliotcougar commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

First of the focused TalkBack series: make transient feedback accessible while keeping visual Snackbar messages out of the navigation order.

All normal, success, error, and informational feedback is mirrored to a locale-tagged polite live region. Service start/stop results and errors preventing a requested start use assertive feedback. The renderer keeps a stable node, publishes a genuine text change over successive frames, hides the idle node, ignores blank text, and suppresses rapid duplicates with the same priority. Ordered presentation preserves preceding status changes; accessibility services retain control of speech scheduling.

The daemon supplies the name of the profile that actually started, so accessible success text does not depend on a selection that may already have changed. The visible success message remains unchanged. With no active Snackbar consumer, permission-aware background notifications provide replaceable feedback through a single notification ID. Their titles use localized channel resources and respect user settings. VPN setup failure now uses the existing localized service-failure resource instead of an English literal. Android 24–25 notification expiry is not implemented; those notifications remain dismissible and replaceable.

Synced with v2.3.15 (57907cf354d9) using a merge commit. Review confirmed that DNS final-query ordering, WireGuard DNS defaults, Hysteria default ports, subscription metadata and infinity/RTL figures, OkHttp 5.5.1, workflow configuration, and native dependency pins are preserved. The shared live-region renderer matches Parts 2, 4, and 9 exactly. The already-resumed-host fix in #6227 applies to its separate process-owned host registry; this PR retains its existing SharedFlow/controller architecture.

Validation on b022648a6:

  • Nine focused live-region/channel tests passed; the full Play Store and F-Droid suites each passed 133 tests with zero failures, errors, or skips.
  • Kotlin compilation, debug APK assembly, and full lint passed for both distributions; lint reported zero errors.
  • The matching official v26.10.31 AAR and HEV 2.19.3 inputs were verified for all four ABIs. Both assembled ARM64 APKs contain the exact expected libgojni.so, libhev-socks5-tunnel.so, and libhevsockstun.so bytes.
  • All ten resource catalogs passed preservation, duplicate-key, translation-presence, and placeholder checks. git diff --check passed.

Not run: current-head TalkBack spoken output, semantics/focus order, touch/keyboard/D-pad activation, theme/inset rendering, notification-permission behavior, and VPN/proxy/root service start, failure, stop, and restart scenarios. No ADB target is available; emulator ownership is unresolved and no emulator was launched. Broader foreground lifecycle handoff guarantees remain outside this PR.

@eliotcougar eliotcougar changed the title TalkBack, 1 of N: Add accessible transient message live regions TalkBack, 1 of 10: Add accessible transient message live regions Aug 30, 2026
eliotcougar added a commit to eliotcougar/v2rayNG that referenced this pull request Aug 30, 2026
…essibility

Retain the original button call site and name the existing modal-opening callback locally. This avoids an adjacent-hunk conflict between the independent modal replacement in 2dust#6157 and the switch semantics in this PR, without changing behavior or importing notification code.
@eliotcougar
eliotcougar marked this pull request as ready for review August 30, 2026 22:29
@eliotcougar

eliotcougar commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor Author

I tested the whole set on my Pixel 9 pro with Android 17. The AI tested it on Android 13 and 15 VMs.
The individual PRs have no intersections and can be merged in any order and combination.

This PR is the largest as it expands the Toast notification system and makes it compatible with accessibility mode. As a result, it touches every activity that can emit a Toast notification. Unlike the previously rejected PR, it doesn't use the deprecated direct announcements or other workarounds. Instead, it relies on a live-region and a regular notification channel fallback, and follows the official Android accessibility guidelines.

Other PRs are focused on individual Activities and are much smaller and easier to review.

@eliotcougar
eliotcougar marked this pull request as draft September 5, 2026 11:11
@eliotcougar

eliotcougar commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor Author

GPT-6 Astra worked the entire day making the accessibility PR set better and review-friendly as much as possible.
The new model seems to be less prone to overengineering and implementing useless protections against situations that don't happen.
Spent 65% of the weekly credit and a full phone battery.
I'm going to test all 10 combined (with 4,069 additions and 677 deletions across 82 files, including regtests) tomorrow after a good night sleep, and fix any remaining UI/UX problems.

There are several small general UI fixes here and there in the accessibility set. I'm not yet sure if I should separate them into tiny separate PRs... They are tiny...

Remove the custom Toast view used when no Compose Snackbar host is active.

Keep foreground feedback on the existing inert Snackbar and live-region path. When no host is available, post a low-importance, auto-canceling notification that replaces the previous transient message and opens the app when tapped. Respect notification permission and global notification settings instead of bypassing the user's choice.

Use localized notification-channel names and add regression coverage for foreground/background routing and notification eligibility.
Acknowledge service results only when an active UI consumer accepts them; otherwise let the daemon post the final success, stop, or failure through the ordinary notification fallback. Avoid replacing a startup failure with cleanup-only stop feedback.

Use one transient notification ID for every fallback message, reset its native ten-second timeout on replacement, and clear stale background feedback when a foreground Snackbar is delivered. Refresh localized channel names in place without changing channel IDs or user-controlled settings.

Validation: 69 Play Store JVM tests and x86_64 debug build passed with JDK 21. API 30 emulator checks covered background success/failure, UI-process-absent start/stop, replacement, expiry, and Russian channel names. TalkBack speech was not rerun. Native timeout is supported on API 26 and newer.
Name the channels Subscription updates, Connection checks, and Other notifications using their own resources in all nine supported locales. Leave the main service title and existing channel identifiers and behavior unchanged, so names refresh in place without resetting user preferences.

Add regression tests for dedicated title-resource mappings and stable channel identifiers. Focused notification tests, the full Play Store JVM suite, and ARM64 debug assembly passed.
Make every foreground message eligible for a polite live-region update by default, retaining assertive service feedback and the inert visual Snackbar. Replace the per-app explanation toast with the existing OK-only modal used by the per-app accessibility PR.

Carry the daemon snapshot of the successfully started profile name in the success event instead of reading a potentially newer UI selection. Keep channel configuration inside its API 26 guard, without lint suppression.

Validation: 74 Play Store debug unit tests, Kotlin compilation and debug assembly pass. The NotificationHelper lint errors are gone; lint still reports four pre-existing API errors in root process waits and base themes. Stop/restart lifecycle changes remain out of scope.
Extract the existing locale-aware live-region renderer without changing transient-message behavior. Host action feedback above screen content in AppTheme so list status updates are not occluded by a Scaffold.

Keep repeated identical messages as distinct events, expire only the current event, and hide the idle host from accessibility navigation. The same small host is shared by the independently mergeable list branches; it does not request focus or emit manual accessibility announcements.

Validation: 77 Play Store debug JVM tests, Kotlin compilation, app/test APK assembly, and native live-region event checks through the focused list and combined builds. Not run: listening verification in every locale.
Keep transient accessibility state in the existing window-owned snackbar controller. Serialize publication for each semantics lifetime, prioritize pending service results, and discard pending feedback when the host pauses. This prevents a burst of routine messages from cancelling an assertive result before its text is published; TalkBack still owns speech scheduling.

Remove redundant polite arguments, the unused custom-action feedback host from Part 1, and test-only delivery/notification abstractions. Keep the reusable renderer and leave custom-action feedback in its consuming focused branches. Restore the shared theme to upstream to preserve independent mergeability.

Replace trivial helper tests with seven state regressions and four Android checks covering native accessibility export, inert snackbar semantics, lifecycle clearing, fallback replacement/cancellation, and channel-setting preservation. Validation: 69 JVM tests, Kotlin compilation, Play Store debug and test APK assembly, four Pixel API 37.1 checks with TalkBack 17 enabled, and both merge orders with all nine other focused branches plus upstream.
Give the host a single explicit owner instead of combining a supplied SnackbarHostState with a composition-local controller. Remove the unused LocalAppSnackbar provider. Keep this behavior-preserving wiring change shared by the notification, subscription, routing and server-row PRs so they remain independently mergeable.
Drop the three androidTest files introduced during the Part 1 review and remove their dedicated Compose UI test dependency, as requested. Retain the existing JVM regression tests, upstream test configuration, and all production accessibility fixes. The removed checks remain recoverable from Git history.

Validation: Play Store debug assembly and git diff --check passed. No tests were rerun; production sources and existing JVM tests are unchanged.
Keep the renderer identical to the focused action-feedback branches. Hosts may start their presentation interval after text publication; existing notification callers omit the callback and retain their current behavior.
Restore FIFO publication so later assertive results cannot overtake earlier service-state changes. Pass the host controller explicitly and share the localized started-server message between foreground feedback and background notifications.

Retain current upstream asset validation, editor state, metadata and update-result plurals. Remove the obsolete alternate service-start formatter and its superseded test. Play Store debug compilation, manifest processing and JVM tests pass.
Drop the unused INFO toast type and color, together with the unrequested long-duration flag and forwarding. Keep the existing short snackbar duration and normal, success and error styling. Per-app help already uses a dialog.

This restores the reviewed notification surface without changing FIFO live-region publication, accessibility urgency or foreground/background message routing. Validation: LiveRegionMessageStateTest and the full Play Store debug JVM suite (86 tests), including compilation and manifest processing, passed. No device tests run.
@eliotcougar
eliotcougar force-pushed the fix/accessibility-live-regions branch from 9174748 to 4f2af77 Compare September 10, 2026 09:37
Keep the native service result stream lossless through the upstream event channel. Preserve failure details, the daemon-provided started-server name, assertive terminal feedback and the notification fallback. Extend the upstream long-duration and informational message API without dropping accessibility message text, and reuse the merged localized channel titles instead of defining duplicate resources.

Validation: 107 JVM tests, Kotlin compilation and PlaystoreDebug assembly passed. An API 37 emulator probe with TalkBack enabled verified assertive inert terminal live regions, idle-node removal and expiring replacement notifications while backgrounded. Full physical-device and all-mode service lifecycle regression testing was not run.
Keep upstream subscription usage parsing, group metadata, the new main-screen group bar, dependency updates and native source revisions. Resolve the MainViewModel import overlap by retaining both localized service-result text and subscription-info parsing; keep daemon-confirmed feedback and the existing inert live-region host intact.

Complete the feature strings in the newly supported Azerbaijani locale, including final service-stop wording and the connected-server announcement. Validation: full Play Store JVM suite, Kotlin compilation and x86_64 debug assembly pass. Runtime feedback validation is tracked separately from compilation.
Place this feature's translated resources near their owning screens and align shared action resources across the TalkBack set. Every resource entry, value, attribute, placeholder and plural item is unchanged; catalogs remain in the existing strings.xml files. This avoids same-location insert conflicts, including the newly supported Azerbaijani locale and Bakhtiari catalog.

Exact-entry XML preservation, duplicate-key and whitespace checks pass. Full JVM/Kotlin/APK checks passed before this content-neutral catalog relocation; the final committed-tree build checks follow separately.
eliotcougar added a commit to eliotcougar/v2rayNG that referenced this pull request Oct 22, 2026
Integrate the verified current PR tip d631877 onto upstream 01b4630. Keep the focused branch unchanged and the integration local-only.
Preserve the focused accessibility behavior while taking the current DNS final-query ordering, WireGuard DNS defaults, Hysteria port handling, subscription figures and RTL updates, and official native dependency revisions. Follow-up validation uses the matching v26.10.31 AAR and HEV 2.19.3 inputs.
Pass setup failures through the existing localized service-failure fallback instead of publishing an English-only literal. Foreground assertive feedback and the background notification now use the same app-locale resource, without changing VPN setup or teardown.
eliotcougar added a commit to eliotcougar/v2rayNG that referenced this pull request Nov 2, 2026
Integrate the published fix/accessibility-live-regions head b022648 after its upstream compatibility review. Preserve the focused PR history and its latest fixes.
eliotcougar added a commit to eliotcougar/v2rayNG that referenced this pull request Nov 14, 2026
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