Skip to content

Tap the edit and mark-up buttons again when a tap turns into a long press - #684

Merged
andiwand merged 1 commit into
mainfrom
tap-again-after-a-long-press
Sep 24, 2026
Merged

andiwand merged 1 commit into
mainfrom
tap-again-after-a-long-press

Conversation

@andiwand

@andiwand andiwand commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

build_test on main fails on API 26, and testODT and testPDF are two of the failing tests. The cause is in the test, not in the app.

On the API 26 emulator of CI, Espresso sometimes sends the touch up too late. Android then reads the tap as a long press:

W MotionEvents: Overslept and turned a tap into a long press

A long press on a DocumentActions button only shows the tooltip. The click listener does not run, menu_edit never logs, and the page stays read-only. Every failure of testODT and testPDF in the last five runs on main has this line in its logcat.

Change

  • clickThroughLongPress() is click(rollbackAction) with a rollback action that does nothing. If a tap turns into a long press, Espresso 3.7.0 taps again, up to three times.
  • The taps on menu_edit (testODT, aSheetIsEditedInEveryEdition) and menu_annotate (testPDF) use it.
  • The taps on the strip tools do not change, because a long press there opens the colour popup.

Not in this PR

LargeTextTests.aMegabyteOfTextOpensAndIsSearchable (API 26 and 30) and DarkModeTests (API 34) fail for other reasons.

🤖 Generated with Claude Code

…ress

On the API 26 emulator of CI, Espresso sometimes sends the touch up too
late. Android then reads the tap as a long press, and the logcat says
"Overslept and turned a tap into a long press". A long press on a
DocumentActions button only shows the tooltip, so the click listener
does not run and the test fails. Every failure of testODT and testPDF in
the last five runs on main has this line in its logcat.

The taps on menu_edit and menu_annotate now use click() with a rollback
action that does nothing, so Espresso taps again, up to three times. The
taps on the strip tools stay as they are, because a long press there
opens the colour popup.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Ph3Q6se1Ah28qfcunYHG7
@andiwand
andiwand merged commit 4d7df0e into main Sep 24, 2026
2 checks passed
@andiwand
andiwand deleted the tap-again-after-a-long-press branch September 24, 2026 12:18
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