android-app icon indicating copy to clipboard operation
android-app copied to clipboard

"Add tag" and "Annotate" missing in context menu (Android 12)

Open madalu opened this issue 2 years ago • 3 comments

After the upgrade to Android 12 on a Pixel 3a, I find that "Add tag" and "Annotate" no longer appear in the context menu after selecting text. However, they do appear if I select text and then (while the context menu is open) scroll the screen, turn the screen on and off, swipe into the app switcher and then return to the app, swipe notifications up and down, etc. (basically anything that redraws or refreshes the screen).

This seems to be the relevant issue on the Google bug tracker: https://issuetracker.google.com/issues/200172520 Google marked it as "won't fix" with the following comment:

It is a hack to override the onActionModeStarted to modify the menu item list. onActionModeStarted was just meant to notify the app that the action mode was started. It didn't meant to be a place for developers to update the menus. The correct way to do that is to provide your own ActionMode.Callback and update your menu items in either onCreateActionMode and onPrepareActionMode.

Steps to reproduce the issue (on Android 12)

  1. Select text within a Wallabag article
  2. Notice "Add tag" and "Annotate" (if annotations are enabled) are missing from the menu
  3. Perform an action that redraws or refreshes the screen (scroll, swipe notifications down and back up, etc.)
  4. Notice "Add tag" and (optionally) "Annotate" are present in the menu.

Environment details

  • wallabag app version: 2.4.3
  • wallabag app installation source: F-Droid
  • Android OS version: Android 12
  • Android ROM: Stock
  • Android hardware: Pixel 3a

madalu avatar Nov 04 '21 14:11 madalu

confirmed on latest Calyx OS update to Android 12 on a Pixel 4a.

and nice bug report by the way, complete with the upstream reference (and fix!!)

anarcat avatar Jan 29 '22 00:01 anarcat

Yeah, thanks for the detailed bug report!

I tried to address it back in November, but I think I encountered some problems. I've been quite busy lately, but I'll see if I can give it another shot soon.

di72nn avatar Jan 29 '22 07:01 di72nn

@di72nn do you have a branch with your attempts handy? I have the same issue on a Pixel 6a/Android 13, and would like to try fixing it.

shtrom avatar Dec 06 '22 12:12 shtrom