Skip to content

Respect Reduce Transparency in the dictionary selection popup - #46

Closed
Batmancpu wants to merge 3 commits into
black-box-bihar-newsfrom
a11y/dictionary-popup-reduce-transparency-2026-11-09
Closed

Batmancpu wants to merge 3 commits into
black-box-bihar-newsfrom
a11y/dictionary-popup-reduce-transparency-2026-11-09

Conversation

@Batmancpu

@Batmancpu Batmancpu commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Evidence

The active integration branch adds an app-wide Reduce Transparency preference in You → Settings → Appearance and persists it through LocalStore.reduceTransparency().

The standalone dictionary popup (DictionaryActivity, exported for Android ACTION_PROCESS_TEXT) did not read that preference. It unconditionally enabled FLAG_BLUR_BEHIND on Android 12+ and kept the translucent popup surface at alpha 0.86. The popup therefore ignored the user's saved Reduce Transparency choice even though the rest of the integration UI consumes it.

The active consolidation is PR #34. This proposal is deliberately stacked on its integration branch rather than creating a main-based change that cannot compile against main's older LocalStore (which does not yet contain the integration appearance preference).

Change

  • Restore LocalStore.reduceTransparency(applicationContext) on Dispatchers.IO; do not load the shared preferences file on the popup's main thread.
  • Use an opaque, unblurred surface while the saved preference is being restored.
  • When Reduce Transparency is enabled, clear/avoid FLAG_BLUR_BEHIND and use a 0.985 surface alpha.
  • When disabled, preserve the existing appearance: API 31+ blur-behind and alpha 0.86; older Android alpha 0.94 without blur.
  • Add a pure DictionarySurfacePolicy and four JVM tests covering reduced/normal appearance on modern/legacy Android.
  • Preserve the separate Reduce Motion behaviour from the integration base, WordNet lookup, native text-selection action menu, popup geometry, dim amount, navigation and data model.

Verification — 9 November 2026

Natural PR validation passed.

  • Run #386 passed on exact PR head 55afb9ab662d2926675f0a57737d3f817b1fc2cb.
  • WordNet generation: 151,456 unique words.
  • :app:testDebugUnitTest: passed.
  • :app:assembleDebug: passed.
  • Artifact 13646383188: 39,131,459 bytes; expires 23 November 2026.
  • Release publication: skipped as expected on a pull-request run.
  • No workflow was manually dispatched or rerun.

The integration base advanced by one unrelated commit after this branch was created: black-box-bihar-news@11b709aa9f357437fa7315035d4a383b79d7d4af. This PR is three commits ahead / one behind that branch; GitHub currently reports it mergeable with a clean merge state. The intervening commit changes feed-navigation/UI and documentation files, not the dictionary popup. That updated base independently passed natural push #387 and PR #388, including JVM tests, APK assembly and artifact upload. Those runs validate the base commit, not a rebased combined PR #46 head.

Risks / limitations

  • The preference is sampled once when the short-lived popup opens. Changing Appearance while the popup is already open takes effect the next time it opens; no observer or polling timer is added.
  • During the off-main preference read, the popup temporarily uses the safer opaque/unblurred treatment. Normal glass is restored after the stored preference is loaded.
  • This PR must be integrated after or together with PR #34, because the app-wide appearance preference exists on that integration branch, not canonical main.
  • CI/JVM success does not establish physical-device rendering, TalkBack, memory or thermal behaviour. No OPPO device verification is available.

Canonical main remains unchanged.

Copy link
Copy Markdown
Owner Author

Closing as redundant: the current base branch black-box-bihar-news@23acb979ccc903aaab53f2fdaa67e9610ba2c2f0 now contains byte-identical versions of all three files changed by this PR:

  • DictionaryActivity.kt — blob fe878fec24128639ad9055f3df8f268cc4e2a843
  • DictionarySurfacePolicy.kt — blob 7cc8906dab9a48d56db2064a9657d4ebf8caaee1
  • DictionarySurfacePolicyTest.kt — blob a3f957a7837f43166d2a9ce09335a1bc401da6b3

The integration branch therefore already includes this exact Reduce Transparency implementation and tests. The natural exact-head run for the integration branch is #394, which passed JVM tests and APK assembly. This PR is being closed without merging; the code remains in PR #34's base. Physical-device screenshot/TalkBack/Reduce Transparency verification is still outstanding.

@Batmancpu Batmancpu closed this Nov 9, 2026
@Batmancpu
Batmancpu deleted the a11y/dictionary-popup-reduce-transparency-2026-11-09 branch November 14, 2026 10:51
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